From: Vadim Zeitlin Date: Tue, 17 Apr 2012 13:57:18 +0000 (+0000) Subject: Add possibility to change the test message box title in dialog sample. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d60a9c00e4a76d578639d46ed1a0984a06f9c732 Add possibility to change the test message box title in dialog sample. All the other message box elements were configurable, so why not this one. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index d281082dd8..d9c650ae29 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -2931,6 +2931,10 @@ bool TestMessageBoxDialog::Create() // this sizer allows to configure the messages shown in the message box wxSizer * const sizerMsgs = new wxStaticBoxSizer(wxVERTICAL, this, "&Messages"); + sizerMsgs->Add(new wxStaticText(this, wxID_ANY, "&Title:")); + m_textTitle = new wxTextCtrl(this, wxID_ANY, "Test Message Box"); + sizerMsgs->Add(m_textTitle, wxSizerFlags().Expand().Border(wxBOTTOM)); + sizerMsgs->Add(new wxStaticText(this, wxID_ANY, "&Main message:")); m_textMsg = new wxTextCtrl(this, wxID_ANY, "Hello from a box!", wxDefaultPosition, wxDefaultSize, @@ -3139,7 +3143,7 @@ void TestMessageBoxDialog::PrepareMessageDialog(wxMessageDialogBase &dlg) void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) { - wxMessageDialog dlg(this, GetMessage(), "Test Message Box", GetStyle()); + wxMessageDialog dlg(this, GetMessage(), GetTitle(), GetStyle()); PrepareMessageDialog(dlg); wxString btnName; @@ -3227,8 +3231,7 @@ void TestRichMessageDialog::AddAdditionalFlags(wxSizer *sizer) void TestRichMessageDialog::OnApply(wxCommandEvent& WXUNUSED(event)) { - wxRichMessageDialog dlg(this, GetMessage(), "Test Rich Message Dialog", - GetStyle()); + wxRichMessageDialog dlg(this, GetMessage(), GetTitle(), GetStyle()); PrepareMessageDialog(dlg); dlg.ShowCheckBox(m_textCheckBox->GetValue(), diff --git a/samples/dialogs/dialogs.h b/samples/dialogs/dialogs.h index bfc8fa086f..68dc77d2a4 100644 --- a/samples/dialogs/dialogs.h +++ b/samples/dialogs/dialogs.h @@ -208,6 +208,7 @@ public: bool Create(); protected: + wxString GetTitle() { return m_textTitle->GetValue(); } wxString GetMessage() { return m_textMsg->GetValue(); } long GetStyle(); @@ -251,7 +252,8 @@ private: MsgDlgIcon_Max }; - wxTextCtrl *m_textMsg, + wxTextCtrl *m_textTitle, + *m_textMsg, *m_textExtMsg; wxCheckBox *m_buttons[Btn_Max];