]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
remove wxNewEventFunctor() overload which allowed calls to "Bind(evt, &WrongClass...
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index 15f1d8964abd53fb01889921f63cfa979aee790b..ceed79323d8f4dea7ee642e5b6449f14f355ce50 100644 (file)
@@ -809,25 +809,32 @@ void MyFrame::MultiChoice(wxCommandEvent& WXUNUSED(event) )
     };
 
     wxArrayInt selections;
-    size_t count = wxGetMultipleChoices(selections,
+    const int count = wxGetSelectedChoices(selections,
                                         _T("This is a small sample\n")
                                         _T("A multi-choice convenience dialog"),
                                         _T("Please select a value"),
                                         WXSIZEOF(choices), choices,
                                         this);
-    if ( count )
+    if ( count >= 0 )
     {
         wxString msg;
-        msg.Printf(wxT("You selected %u items:\n"), (unsigned)count);
-        for ( size_t n = 0; n < count; n++ )
+        if ( count == 0 )
+        {
+            msg = wxT("You did not select any items");
+        }
+        else
         {
-            msg += wxString::Format(wxT("\t%u: %u (%s)\n"),
-                                    (unsigned)n, (unsigned)selections[n],
-                                    choices[selections[n]].c_str());
+            msg.Printf(wxT("You selected %u items:\n"), (unsigned)count);
+            for ( int n = 0; n < count; n++ )
+            {
+                msg += wxString::Format(wxT("\t%u: %u (%s)\n"),
+                                        (unsigned)n, (unsigned)selections[n],
+                                        choices[selections[n]].c_str());
+            }
         }
         wxLogMessage(msg);
     }
-    //else: cancelled or nothing selected
+    //else: cancelled
 }
 #endif // wxUSE_CHOICEDLG
 
@@ -980,7 +987,7 @@ private:
     wxTextCtrl *m_text;
 
     DECLARE_EVENT_TABLE()
-    DECLARE_NO_COPY_CLASS(MyRearrangeDialog)
+    wxDECLARE_NO_COPY_CLASS(MyRearrangeDialog);
 };
 
 BEGIN_EVENT_TABLE(MyRearrangeDialog, wxRearrangeDialog)