KiCad PCB EDA Suite
Loading...
Searching...
No Matches
confirm.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
31
32#ifndef __INCLUDE__CONFIRM_H__
33#define __INCLUDE__CONFIRM_H__
34
35#include <kicommon.h>
36#include <wx/string.h>
37#include <wx/arrstr.h>
38
39class wxWindow;
40
41
42#if defined( _WIN32 ) && wxCHECK_VERSION( 3, 3, 0 )
43#define KICAD_MESSAGE_DIALOG_BASE wxGenericMessageDialog
44#define KICAD_RICH_MESSAGE_DIALOG_BASE wxGenericRichMessageDialog
45#else
46#define KICAD_MESSAGE_DIALOG_BASE wxMessageDialog
47#define KICAD_RICH_MESSAGE_DIALOG_BASE wxRichMessageDialog
48#endif
49
50
55KICOMMON_API bool AskOverrideLock( wxWindow* aParent, const wxString& aMessage );
56
57
68KICOMMON_API bool HandleUnsavedChanges( wxWindow* aParent, const wxString& aMessage,
69 const std::function<bool()>& aSaveFunction );
70
74
75
85KICOMMON_API int UnsavedChangesDialog( wxWindow* aParent, const wxString& aMessage,
86 bool* aApplyToAll );
87
88KICOMMON_API int UnsavedChangesDialog( wxWindow* aParent, const wxString& aMessage );
89
90
94KICOMMON_API bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage );
95
96
100KICOMMON_API void DisplayError( wxWindow* aParent, const wxString& aText );
101
109KICOMMON_API void DisplayErrorMessage( wxWindow* aParent, const wxString& aMessage,
110 const wxString& aExtraInfo = wxEmptyString );
111
112
120KICOMMON_API void DisplayInfoMessage( wxWindow* parent, const wxString& aMessage,
121 const wxString& aExtraInfo = wxEmptyString );
122
131KICOMMON_API bool IsOK( wxWindow* aParent, const wxString& aMessage );
132
147KICOMMON_API int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning,
148 const wxString& aMessage,
149 const wxString& aDetailedMessage = wxEmptyString,
150 const wxString& aOKLabel = wxEmptyString,
151 const wxString& aCancelLabel = wxEmptyString,
152 bool* aApplyToAll = nullptr );
153
154
155
165KICOMMON_API int SelectSingleOption( wxWindow* aParent, const wxString& aTitle,
166 const wxString& aMessage,
167 const wxArrayString& aOptions );
168
169#endif /* __INCLUDE__CONFIRM_H__ */
KICOMMON_API void DisplayErrorMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo=wxEmptyString)
Display an error message with aMessage.
Definition confirm.cpp:202
KICOMMON_API void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
Definition confirm.cpp:177
KICOMMON_API void DisplayInfoMessage(wxWindow *parent, const wxString &aMessage, const wxString &aExtraInfo=wxEmptyString)
Display an informational message box with aMessage.
Definition confirm.cpp:230
KICOMMON_API int SelectSingleOption(wxWindow *aParent, const wxString &aTitle, const wxString &aMessage, const wxArrayString &aOptions)
Display a dialog with radioboxes asking the user to select an option.
Definition confirm.cpp:289
KICOMMON_API bool AskOverrideLock(wxWindow *aParent, const wxString &aMessage)
Display a dialog indicating the file is already open, with an option to reset the lock.
Definition confirm.cpp:42
KICOMMON_API bool ConfirmRevertDialog(wxWindow *parent, const wxString &aMessage)
Display a confirmation dialog for a revert action.
Definition confirm.cpp:118
KICOMMON_API bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
Definition confirm.cpp:131
KICOMMON_API int GetLastUnsavedChangesResponse()
Return the result code from the last call to HandleUnsavedChanges(): wxID_YES, wxID_NO or wxID_CANCEL...
Definition confirm.cpp:144
KICOMMON_API int OKOrCancelDialog(wxWindow *aParent, const wxString &aWarning, const wxString &aMessage, const wxString &aDetailedMessage=wxEmptyString, const wxString &aOKLabel=wxEmptyString, const wxString &aCancelLabel=wxEmptyString, bool *aApplyToAll=nullptr)
Display a warning dialog with aMessage and returns the user response.
Definition confirm.cpp:150
KICOMMON_API bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition confirm.cpp:259
KICOMMON_API int UnsavedChangesDialog(wxWindow *aParent, const wxString &aMessage, bool *aApplyToAll)
A specialized version of HandleUnsavedChanges which handles an apply-to-all checkbox.
Definition confirm.cpp:64
#define KICOMMON_API
Definition kicommon.h:28