X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f2335ba564d835bed8c8ad11c057d7b4a0e5249c..0fe243db0c0447b69917eaa6d3a0e32743229638:/samples/dialogs/dialogs.cpp?ds=sidebyside diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 15f1d8964a..ceed79323d 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -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)