diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:23:48 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:23:48 +0200 |
commit | ee1c8c5c25d25dfa42120125a8a45dc9831ee412 (patch) | |
tree | 67aa287157db954e0cadeee05b4aad331eb2ecf2 /ui/msg_popup.h | |
parent | 5.13 (diff) | |
download | FreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.tar.gz FreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.tar.bz2 FreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.zip |
5.14
Diffstat (limited to 'ui/msg_popup.h')
-rw-r--r-- | ui/msg_popup.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/ui/msg_popup.h b/ui/msg_popup.h index c5557480..5e59eb6b 100644 --- a/ui/msg_popup.h +++ b/ui/msg_popup.h @@ -19,8 +19,8 @@ struct ReturnErrorDlg { enum ButtonPressed { - BUTTON_IGNORE = 1, - BUTTON_RETRY = 2, + BUTTON_RETRY = 1, + BUTTON_IGNORE = 2, BUTTON_CANCEL = 4 }; }; @@ -60,21 +60,30 @@ struct ReturnQuestionDlg }; }; -struct CheckBox +class QuestConfig; +ReturnQuestionDlg::ButtonPressed showQuestionDlg(wxWindow* parent, int activeButtons, const wxString& messageText, const QuestConfig& cfg); + +class QuestConfig { - CheckBox(const wxString& label, bool& value) : label_(label), value_(value) {} +public: + QuestConfig() : checkBoxValue() {} + QuestConfig& setCaption (const wxString& label) { caption = label; return *this; } + QuestConfig& setLabelYes(const wxString& label) { labelYes = label; return *this; } + QuestConfig& setLabelNo (const wxString& label) { labelNo = label; return *this; } + QuestConfig& showCheckBox(bool& value, const wxString& label) { checkBoxLabel = label; checkBoxValue = &value; return *this; } + +private: + friend ReturnQuestionDlg::ButtonPressed showQuestionDlg(wxWindow* parent, int activeButtons, const wxString& messageText, const QuestConfig& cfg); - wxString label_; //in - bool& value_; //in/out + wxString caption; + wxString labelYes; //overwrite default "Yes, No" labels + wxString labelNo; // + //optional checkbox: + bool* checkBoxValue; //in/out + wxString checkBoxLabel; //in }; -ReturnQuestionDlg::ButtonPressed showQuestionDlg(wxWindow* parent, - int activeButtons, - const wxString& messageText, - const wxString& caption = wxString(), - const wxString& labelYes = wxString(), //overwrite default "Yes, No" labels - const wxString& labelNo = wxString(), // - CheckBox* checkbox = nullptr); +ReturnQuestionDlg::ButtonPressed showQuestionDlg(wxWindow* parent, int activeButtons, const wxString& messageText, const QuestConfig& cfg = QuestConfig()); } #endif // MESSAGEPOPUP_H_INCLUDED |