added wxGetMultiChoice() (which refuses to work for some reason - will fix

a.s.a.p.)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-11-03 20:52:17 +00:00
parent 53ccf1c0ba
commit d6c9c1b71e
7 changed files with 689 additions and 182 deletions

View File

@@ -60,6 +60,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(DIALOGS_PASSWORD_ENTRY, MyFrame::PasswordEntry)
EVT_MENU(DIALOGS_NUM_ENTRY, MyFrame::NumericEntry)
EVT_MENU(DIALOGS_SINGLE_CHOICE, MyFrame::SingleChoice)
EVT_MENU(DIALOGS_MULTI_CHOICE, MyFrame::MultiChoice)
EVT_MENU(DIALOGS_FILE_OPEN, MyFrame::FileOpen)
EVT_MENU(DIALOGS_FILE_OPEN2, MyFrame::FileOpen2)
EVT_MENU(DIALOGS_FILES_OPEN, MyFrame::FilesOpen)
@@ -127,6 +128,7 @@ bool MyApp::OnInit()
file_menu->Append(DIALOGS_PASSWORD_ENTRY, "&Password entry\tCtrl-P");
file_menu->Append(DIALOGS_NUM_ENTRY, "&Numeric entry\tCtrl-N");
file_menu->Append(DIALOGS_SINGLE_CHOICE, "&Single choice\tCtrl-C");
file_menu->Append(DIALOGS_MULTI_CHOICE, "M&ultiple choice\tCtrl-U");
file_menu->AppendSeparator();
file_menu->Append(DIALOGS_TIP, "&Tip of the day\tCtrl-T");
file_menu->AppendSeparator();
@@ -349,6 +351,30 @@ void MyFrame::SingleChoice(wxCommandEvent& WXUNUSED(event) )
}
}
void MyFrame::MultiChoice(wxCommandEvent& WXUNUSED(event) )
{
const wxString choices[] = { "One", "Two", "Three", "Four", "Five" } ;
int n = 5;
wxArrayInt selections;
size_t count = wxGetMultipleChoices(selections,
"This is a small sample\n"
"A multi-choice convenience dialog",
"Please select a value",
n, (const wxString *)choices,
this);
if ( count )
{
wxLogMessage("You selected %u items:", count);
for ( size_t n = 0; n < count; n++ )
{
wxLogMessage("\t%u: %u (%s)", n, selections[n],
choices[selections[n]].c_str());
}
}
//else: cancelled or nothing selected
}
void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
{
wxFileDialog dialog(this, "Testing open file dialog", "", "", "*.txt", 0);