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
This commit is contained in:
Vadim Zeitlin
2012-04-17 13:57:18 +00:00
parent 95cb88191c
commit d60a9c00e4
2 changed files with 9 additions and 4 deletions

View File

@@ -2931,6 +2931,10 @@ bool TestMessageBoxDialog::Create()
// this sizer allows to configure the messages shown in the message box // this sizer allows to configure the messages shown in the message box
wxSizer * const wxSizer * const
sizerMsgs = new wxStaticBoxSizer(wxVERTICAL, this, "&Messages"); 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:")); sizerMsgs->Add(new wxStaticText(this, wxID_ANY, "&Main message:"));
m_textMsg = new wxTextCtrl(this, wxID_ANY, "Hello from a box!", m_textMsg = new wxTextCtrl(this, wxID_ANY, "Hello from a box!",
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
@@ -3139,7 +3143,7 @@ void TestMessageBoxDialog::PrepareMessageDialog(wxMessageDialogBase &dlg)
void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
{ {
wxMessageDialog dlg(this, GetMessage(), "Test Message Box", GetStyle()); wxMessageDialog dlg(this, GetMessage(), GetTitle(), GetStyle());
PrepareMessageDialog(dlg); PrepareMessageDialog(dlg);
wxString btnName; wxString btnName;
@@ -3227,8 +3231,7 @@ void TestRichMessageDialog::AddAdditionalFlags(wxSizer *sizer)
void TestRichMessageDialog::OnApply(wxCommandEvent& WXUNUSED(event)) void TestRichMessageDialog::OnApply(wxCommandEvent& WXUNUSED(event))
{ {
wxRichMessageDialog dlg(this, GetMessage(), "Test Rich Message Dialog", wxRichMessageDialog dlg(this, GetMessage(), GetTitle(), GetStyle());
GetStyle());
PrepareMessageDialog(dlg); PrepareMessageDialog(dlg);
dlg.ShowCheckBox(m_textCheckBox->GetValue(), dlg.ShowCheckBox(m_textCheckBox->GetValue(),

View File

@@ -208,6 +208,7 @@ public:
bool Create(); bool Create();
protected: protected:
wxString GetTitle() { return m_textTitle->GetValue(); }
wxString GetMessage() { return m_textMsg->GetValue(); } wxString GetMessage() { return m_textMsg->GetValue(); }
long GetStyle(); long GetStyle();
@@ -251,7 +252,8 @@ private:
MsgDlgIcon_Max MsgDlgIcon_Max
}; };
wxTextCtrl *m_textMsg, wxTextCtrl *m_textTitle,
*m_textMsg,
*m_textExtMsg; *m_textExtMsg;
wxCheckBox *m_buttons[Btn_Max]; wxCheckBox *m_buttons[Btn_Max];