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 (C) 1992-2024 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//#include <wx/richmsgdlg.h>
39//#include <vector>
40//#include <functional>
41
42class wxWindow;
43
44
49KICOMMON_API bool AskOverrideLock( wxWindow* aParent, const wxString& aMessage );
50
51
62KICOMMON_API bool HandleUnsavedChanges( wxWindow* aParent, const wxString& aMessage,
63 const std::function<bool()>& aSaveFunction );
64
65
75KICOMMON_API int UnsavedChangesDialog( wxWindow* aParent, const wxString& aMessage,
76 bool* aApplyToAll );
77
78KICOMMON_API int UnsavedChangesDialog( wxWindow* aParent, const wxString& aMessage );
79
80
84KICOMMON_API bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage );
85
86
92KICOMMON_API void DisplayError( wxWindow* aParent, const wxString& aText, int aDisplayTime = 0 );
93
101KICOMMON_API void DisplayErrorMessage( wxWindow* aParent, const wxString& aMessage,
102 const wxString& aExtraInfo = wxEmptyString );
103
104
112KICOMMON_API void DisplayInfoMessage( wxWindow* parent, const wxString& aMessage,
113 const wxString& aExtraInfo = wxEmptyString );
114
123KICOMMON_API bool IsOK( wxWindow* aParent, const wxString& aMessage );
124
139KICOMMON_API int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning,
140 const wxString& aMessage,
141 const wxString& aDetailedMessage = wxEmptyString,
142 const wxString& aOKLabel = wxEmptyString,
143 const wxString& aCancelLabel = wxEmptyString,
144 bool* aApplyToAll = nullptr );
145
146
147
157KICOMMON_API int SelectSingleOption( wxWindow* aParent, const wxString& aTitle,
158 const wxString& aMessage,
159 const wxArrayString& aOptions );
160
161#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:195
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:279
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:44
KICOMMON_API bool ConfirmRevertDialog(wxWindow *parent, const wxString &aMessage)
Display a confirmation dialog for a revert action.
Definition: confirm.cpp:119
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:130
KICOMMON_API void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime=0)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:170
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:143
KICOMMON_API bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:250
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:66
#define KICOMMON_API
Definition: kicommon.h:28