};
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
wxTextCtrl *m_text;
DECLARE_EVENT_TABLE()
- DECLARE_NO_COPY_CLASS(MyRearrangeDialog)
+ wxDECLARE_NO_COPY_CLASS(MyRearrangeDialog);
};
BEGIN_EVENT_TABLE(MyRearrangeDialog, wxRearrangeDialog)