]> git.saurik.com Git - wxWidgets.git/commitdiff
added test for wxNO_DEFAULT in wxMessageBox
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 16 Apr 2002 19:29:52 +0000 (19:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 16 Apr 2002 19:29:52 +0000 (19:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dialogs/dialogs.cpp

index 18d11c22490430c366318208af1f18ce9045cc97..35a477e82954a00105902fbd5bfeee297cc35a25 100644 (file)
@@ -321,9 +321,25 @@ void MyFrame::LogDialog(wxCommandEvent& event)
 void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
 {
   wxMessageDialog dialog( NULL, "This is a message box\nA long, long string to test out the message box properly",
-      "Message box text", wxYES_NO|wxCANCEL|wxICON_INFORMATION);
+      "Message box text", wxNO_DEFAULT|wxYES_NO|wxCANCEL|wxICON_INFORMATION);
 
-  dialog.ShowModal();
+  switch ( dialog.ShowModal() )
+  {
+      case wxID_YES:
+          wxLogStatus("You pressed \"Yes\"");
+          break;
+
+      case wxID_NO:
+          wxLogStatus("You pressed \"No\"");
+          break;
+
+      case wxID_CANCEL:
+          wxLogStatus("You pressed \"Cancel\"");
+          break;
+
+      default:
+          wxLogError("Unexpected wxMessageDialog return code!");
+  }
 }
 
 void MyFrame::NumericEntry(wxCommandEvent& WXUNUSED(event) )