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
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
71
81KICOMMON_API int UnsavedChangesDialog( wxWindow* aParent, const wxString& aMessage,
82 bool* aApplyToAll );
83
84KICOMMON_API int UnsavedChangesDialog( wxWindow* aParent, const wxString& aMessage );
85
86
90KICOMMON_API bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage );
91
92
96KICOMMON_API void DisplayError( wxWindow* aParent, const wxString& aText );
97
105KICOMMON_API void DisplayErrorMessage( wxWindow* aParent, const wxString& aMessage,
106 const wxString& aExtraInfo = wxEmptyString );
107
108
116KICOMMON_API void DisplayInfoMessage( wxWindow* parent, const wxString& aMessage,
117 const wxString& aExtraInfo = wxEmptyString );
118
127KICOMMON_API bool IsOK( wxWindow* aParent, const wxString& aMessage );
128
143KICOMMON_API int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning,
144 const wxString& aMessage,
145 const wxString& aDetailedMessage = wxEmptyString,
146 const wxString& aOKLabel = wxEmptyString,
147 const wxString& aCancelLabel = wxEmptyString,
148 bool* aApplyToAll = nullptr );
149
150
151
161KICOMMON_API int SelectSingleOption( wxWindow* aParent, const wxString& aTitle,
162 const wxString& aMessage,
163 const wxArrayString& aOptions );
164
165#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:194
KICOMMON_API void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:169
KICOMMON_API void DisplayInfoMessage(wxWindow *parent, const wxString &aMessage, const wxString &aExtraInfo=wxEmptyString)
Display an informational message box with aMessage.
Definition: confirm.cpp:222
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:281
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:129
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:142
KICOMMON_API bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:251
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