X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e520c3f75cbfb0ed6a751576d7032ef196a1817d..e0dec8753abaf97e006ea1185bfb6775b28df0a8:/samples/dialogs/dialogs.cpp?ds=inline diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index ce73b79e39..bc8d2601bb 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -670,7 +670,7 @@ MyFrame::MyFrame(const wxString& title) // satisfy this condition and need to define and connect a separate id. static const int DIALOGS_SYSTEM_ABOUT = 0x4010; - menu->Append(DIALOGS_SYSTEM_ABOUT, "&About..."); + menu->Append(DIALOGS_SYSTEM_ABOUT, "&About"); Connect(DIALOGS_SYSTEM_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::ShowSimpleAboutDialog)); } @@ -1747,6 +1747,9 @@ void MyFrame::OnRequestUserAttention(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnNotifMsgAuto(wxCommandEvent& WXUNUSED(event)) { + // Notice that the notification remains shown even after the + // wxNotificationMessage object itself is destroyed so we can show simple + // notifications using temporary objects. if ( !wxNotificationMessage ( "Automatic Notification", @@ -1756,6 +1759,11 @@ void MyFrame::OnNotifMsgAuto(wxCommandEvent& WXUNUSED(event)) { wxLogStatus("Failed to show notification message"); } + + // But it doesn't have to be a temporary, of course. + wxNotificationMessage n("Dummy Warning", "Example of a warning notification."); + n.SetFlags(wxICON_ERROR); + n.Show(5); // Just for testing, use 5 second delay. } void MyFrame::OnNotifMsgShow(wxCommandEvent& WXUNUSED(event)) @@ -2931,6 +2939,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 +3151,7 @@ void TestMessageBoxDialog::PrepareMessageDialog(wxMessageDialogBase &dlg) void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event)) { - wxMessageDialog dlg(this, GetMessage(), "Test Message Box", GetStyle()); + wxMessageDialog dlg(this, GetMessage(), GetBoxTitle(), GetStyle()); PrepareMessageDialog(dlg); wxString btnName; @@ -3227,8 +3239,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(), GetBoxTitle(), GetStyle()); PrepareMessageDialog(dlg); dlg.ShowCheckBox(m_textCheckBox->GetValue(),