From 03efe856012a55165542a3ac5c9055c25723f5e8 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 26 Jun 2022 11:59:57 -0400 Subject: add upstream 11.22 --- wx+/popup_dlg.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'wx+/popup_dlg.h') diff --git a/wx+/popup_dlg.h b/wx+/popup_dlg.h index 12c19c14..ca4a7591 100644 --- a/wx+/popup_dlg.h +++ b/wx+/popup_dlg.h @@ -7,7 +7,8 @@ #ifndef POPUP_DLG_H_820780154723456 #define POPUP_DLG_H_820780154723456 -#include +#include +#include #include #include #include @@ -19,8 +20,6 @@ namespace zen //parent window, optional: support correct dialog placement above parent on multiple monitor systems //this module requires error, warning and info image files in Icons.zip, see -struct PopupDialogCfg; - enum class DialogInfoType { info, @@ -53,6 +52,8 @@ enum class QuestionButton2 no = static_cast(ConfirmationButton3::decline), }; +struct PopupDialogCfg; + void showNotificationDialog(wxWindow* parent, DialogInfoType type, const PopupDialogCfg& cfg); ConfirmationButton showConfirmationDialog(wxWindow* parent, DialogInfoType type, const PopupDialogCfg& cfg, const wxString& labelAccept); ConfirmationButton2 showConfirmationDialog(wxWindow* parent, DialogInfoType type, const PopupDialogCfg& cfg, const wxString& labelAccept, const wxString& labelAccept2); @@ -69,6 +70,7 @@ struct PopupDialogCfg PopupDialogCfg& setMainInstructions (const wxString& label) { textMain = label; return *this; } //set at least one of these! PopupDialogCfg& setDetailInstructions(const wxString& label) { textDetail = label; return *this; } // PopupDialogCfg& disableButton(ConfirmationButton3 button) { disabledButtons.insert(button); return *this; } + PopupDialogCfg& setButtonImage(ConfirmationButton3 button, const wxImage& img) { buttonImages.emplace(button, img); return *this; } PopupDialogCfg& alertWhenPending(const Zstring& soundFilePath) { soundFileAlertPending = soundFilePath; return *this; } PopupDialogCfg& setCheckBox(bool& value, const wxString& label, ConfirmationButton3 disableWhenChecked = ConfirmationButton3::cancel) { @@ -85,7 +87,8 @@ private: wxString title; wxString textMain; wxString textDetail; - std::set disabledButtons; + std::unordered_set disabledButtons; + std::unordered_map buttonImages; Zstring soundFileAlertPending; bool* checkBoxValue = nullptr; //in/out wxString checkBoxLabel; -- cgit