diff options
Diffstat (limited to 'wx+/popup_dlg.cpp')
-rw-r--r-- | wx+/popup_dlg.cpp | 38 |
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_; }; //######################################################################################## |