summaryrefslogtreecommitdiff
path: root/wx+/popup_dlg.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2017-01-08 18:21:23 +0100
committerDaniel Wilhelm <shieldwed@outlook.com>2017-01-08 18:21:23 +0100
commitfe660cdff59aa3a939479ed60172e5c0803552b2 (patch)
tree045cf295b79de10f75ed6362c5836db25c9fc63a /wx+/popup_dlg.cpp
parent8.6 (diff)
downloadFreeFileSync-fe660cdff59aa3a939479ed60172e5c0803552b2.tar.gz
FreeFileSync-fe660cdff59aa3a939479ed60172e5c0803552b2.tar.bz2
FreeFileSync-fe660cdff59aa3a939479ed60172e5c0803552b2.zip
8.7
Diffstat (limited to 'wx+/popup_dlg.cpp')
-rw-r--r--wx+/popup_dlg.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/wx+/popup_dlg.cpp b/wx+/popup_dlg.cpp
index 918f44a5..f96884d9 100644
--- a/wx+/popup_dlg.cpp
+++ b/wx+/popup_dlg.cpp
@@ -86,27 +86,31 @@ public:
#ifdef ZEN_WIN
new zen::MouseMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere...; ownership passed to "this"
#endif
- wxString titleTmp = cfg.title;
+ wxBitmap iconTmp;
+ wxString titleTmp;
switch (type)
{
case DialogInfoType::INFO:
- //"information" is meaningless as caption text!
+ //"Information" is meaningless as caption text!
//confirmation doesn't use info icon
- //m_bitmapMsgType->Hide();
- //m_bitmapMsgType->SetSize(30, -1);
- //m_bitmapMsgType->SetBitmap(getResourceImage(L"msg_info"));
+ //iconTmp = getResourceImage(L"msg_info");
break;
case DialogInfoType::WARNING:
- if (titleTmp.empty()) titleTmp = _("Warning");
- m_bitmapMsgType->SetBitmap(getResourceImage(L"msg_warning"));
+ iconTmp = getResourceImage(L"msg_warning");
+ titleTmp = _("Warning");
break;
case DialogInfoType::ERROR2:
- if (titleTmp.empty()) titleTmp = _("Error");
- m_bitmapMsgType->SetBitmap(getResourceImage(L"msg_error"));
+ iconTmp = getResourceImage(L"msg_error");
+ titleTmp = _("Error");
break;
}
if (cfg.icon.IsOk())
- m_bitmapMsgType->SetBitmap(cfg.icon);
+ iconTmp = cfg.icon;
+
+ if (!cfg.title.empty())
+ titleTmp = cfg.title;
+ //-----------------------------------------------
+ m_bitmapMsgType->SetBitmap(iconTmp);
if (titleTmp.empty())
SetTitle(wxTheApp->GetAppDisplayName());
@@ -140,7 +144,7 @@ public:
if (!cfg.textDetail.empty())
{
- const wxString& text = L"\n" + cfg.textDetail + L"\n"; //add empty top/bottom lines *instead* of using border space!
+ const wxString& text = L"\n" + trimCpy(cfg.textDetail) + L"\n"; //add empty top/bottom lines *instead* of using border space!
setBestInitialSize(*m_textCtrlTextDetail, text, wxSize(maxWidth, maxHeight));
m_textCtrlTextDetail->ChangeValue(text);
}
@@ -185,14 +189,14 @@ private:
void OnButtonAffirmative(wxCommandEvent& event) override
{
if (checkBoxValue_)
- * checkBoxValue_ = m_checkBoxCustom->GetValue();
+ *checkBoxValue_ = m_checkBoxCustom->GetValue();
EndModal(static_cast<int>(ConfirmationButton3::DO_IT));
}
void OnButtonNegative(wxCommandEvent& event) override
{
if (checkBoxValue_)
- * checkBoxValue_ = m_checkBoxCustom->GetValue();
+ *checkBoxValue_ = m_checkBoxCustom->GetValue();
EndModal(static_cast<int>(ConfirmationButton3::DONT_DO_IT));
}
@@ -244,8 +248,8 @@ class zen::ConfirmationDialog3 : public StandardPopupDialog
{
public:
ConfirmationDialog3(wxWindow* parent, DialogInfoType type, const PopupDialogCfg3& cfg, const wxString& labelDoIt, const wxString& labelDontDoIt) :
- StandardPopupDialog(parent, type, cfg.pdCfg),
- buttonToDisableWhenChecked(cfg.buttonToDisableWhenChecked)
+ StandardPopupDialog(parent, type, cfg.pdCfg_),
+ buttonToDisableWhenChecked_(cfg.buttonToDisableWhenChecked_)
{
assert(contains(labelDoIt, L"&"));
assert(contains(labelDontDoIt, L"&"));
@@ -269,7 +273,7 @@ private:
void updateGui()
{
- switch (buttonToDisableWhenChecked)
+ switch (buttonToDisableWhenChecked_)
{
case ConfirmationButton3::DO_IT:
m_buttonAffirmative->Enable(!m_checkBoxCustom->GetValue());
@@ -282,7 +286,7 @@ private:
}
}
- const ConfirmationButton3 buttonToDisableWhenChecked;
+ const ConfirmationButton3 buttonToDisableWhenChecked_;
};
//########################################################################################
bgstack15