]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
Fix return value of wxGenericTreeCtrl::FindItem().
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index d9c650ae2955bd767ca01bd99572c1ba4646024f..bc8d2601bb177eeb6086c534cd5c596968b97081 100644 (file)
@@ -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))
@@ -3143,7 +3151,7 @@ void TestMessageBoxDialog::PrepareMessageDialog(wxMessageDialogBase &dlg)
 
 void TestMessageBoxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
 {
-    wxMessageDialog dlg(this, GetMessage(), GetTitle(), GetStyle());
+    wxMessageDialog dlg(this, GetMessage(), GetBoxTitle(), GetStyle());
     PrepareMessageDialog(dlg);
 
     wxString btnName;
@@ -3231,7 +3239,7 @@ void TestRichMessageDialog::AddAdditionalFlags(wxSizer *sizer)
 
 void TestRichMessageDialog::OnApply(wxCommandEvent& WXUNUSED(event))
 {
-    wxRichMessageDialog dlg(this, GetMessage(), GetTitle(), GetStyle());
+    wxRichMessageDialog dlg(this, GetMessage(), GetBoxTitle(), GetStyle());
     PrepareMessageDialog(dlg);
 
     dlg.ShowCheckBox(m_textCheckBox->GetValue(),