32#ifndef __INCLUDE__CONFIRM_H__
33#define __INCLUDE__CONFIRM_H__
36#include <wx/richmsgdlg.h>
50 enum KD_TYPE { KD_NONE, KD_INFO, KD_QUESTION, KD_WARNING, KD_ERROR };
52 KIDIALOG( wxWindow* aParent,
const wxString& aMessage,
const wxString& aCaption,
54 KIDIALOG( wxWindow* aParent,
const wxString& aMessage, KD_TYPE aType,
55 const wxString& aCaption =
"" );
59 m_cancelMeansCancel =
false;
60 return wxRichMessageDialog::SetOKCancelLabels( ok,
cancel );
64 void DoNotShowCheckbox( wxString file,
int line );
67 bool DoNotShowAgain()
const;
68 void ForceShowAgain();
70 bool Show(
bool aShow =
true )
override;
71 int ShowModal()
override;
75 static wxString getCaption( KD_TYPE aType,
const wxString& aCaption );
76 static long getStyle( KD_TYPE aType );
104 const std::function<
bool()>& aSaveFunction );
143 const wxString& aExtraInfo = wxEmptyString );
154 const wxString& aExtraInfo = wxEmptyString );
181 const wxString& aMessage,
182 const wxString& aDetailedMessage = wxEmptyString,
183 const wxString& aOKLabel = wxEmptyString,
184 const wxString& aCancelLabel = wxEmptyString,
185 bool* aApplyToAll =
nullptr );
199 const wxString& aMessage,
200 const wxArrayString& aOptions );
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
KD_TYPE
< Dialog type. Selects appropriate icon and default dialog title
bool SetOKCancelLabels(const ButtonLabel &ok, const ButtonLabel &cancel) override
Shows the 'do not show again' checkbox.
KICOMMON_API void DisplayErrorMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo=wxEmptyString)
Display an error message with aMessage.
KICOMMON_API void DisplayInfoMessage(wxWindow *parent, const wxString &aMessage, const wxString &aExtraInfo=wxEmptyString)
Display an informational message box with aMessage.
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.
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.
KICOMMON_API bool ConfirmRevertDialog(wxWindow *parent, const wxString &aMessage)
Display a confirmation dialog for a revert action.
KICOMMON_API bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
KICOMMON_API void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime=0)
Display an error or warning message box with aMessage.
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.
KICOMMON_API bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
KICOMMON_API int UnsavedChangesDialog(wxWindow *aParent, const wxString &aMessage, bool *aApplyToAll)
A specialized version of HandleUnsavedChanges which handles an apply-to-all checkbox.