summaryrefslogtreecommitdiff
path: root/wx+/popup_dlg.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-06-26 11:59:57 -0400
committerB. Stack <bgstack15@gmail.com>2022-06-26 11:59:57 -0400
commit03efe856012a55165542a3ac5c9055c25723f5e8 (patch)
treef820b53379f3d14e103e2663e8b0ecd38d1b2105 /wx+/popup_dlg.h
parentMerge branch 'b11.21' into 'master' (diff)
downloadFreeFileSync-03efe856012a55165542a3ac5c9055c25723f5e8.tar.gz
FreeFileSync-03efe856012a55165542a3ac5c9055c25723f5e8.tar.bz2
FreeFileSync-03efe856012a55165542a3ac5c9055c25723f5e8.zip
add upstream 11.22
Diffstat (limited to 'wx+/popup_dlg.h')
-rw-r--r--wx+/popup_dlg.h11
1 files changed, 7 insertions, 4 deletions
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 <set>
+#include <unordered_set>
+#include <unordered_map>
#include <zen/zstring.h>
#include <wx/window.h>
#include <wx/bitmap.h>
@@ -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 <wx+/image_resources.h>
-struct PopupDialogCfg;
-
enum class DialogInfoType
{
info,
@@ -53,6 +52,8 @@ enum class QuestionButton2
no = static_cast<int>(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<ConfirmationButton3> disabledButtons;
+ std::unordered_set<ConfirmationButton3> disabledButtons;
+ std::unordered_map<ConfirmationButton3, wxImage> buttonImages;
Zstring soundFileAlertPending;
bool* checkBoxValue = nullptr; //in/out
wxString checkBoxLabel;
bgstack15