int WXUNUSED(width), int WXUNUSED(height) )
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
+ wxString choice;
if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetStringSelection();
- else
- return wxT("");
+ choice = dialog.GetStringSelection();
+
+ return choice;
}
// Overloaded for backward compatibility
int WXUNUSED(width), int WXUNUSED(height) )
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
+ int choice;
if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetSelection();
+ choice = dialog.GetSelection();
else
- return -1;
+ choice = -1;
+
+ return choice;
}
// Overloaded for backward compatibility
int WXUNUSED(width), int WXUNUSED(height) )
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices, (char **)client_data);
+ void *data;
if ( dialog.ShowModal() == wxID_OK )
- return dialog.GetSelectionClientData();
+ data = dialog.GetSelectionClientData();
else
- return NULL;
+ data = NULL;
+
+ return data;
}
// Overloaded for backward compatibility
m_dialogStyle = style;
wxBeginBusyCursor();
-
+
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
// 1) text message
topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
-
+
// 2) list box
- m_listbox = new wxListBox( this, wxID_LISTBOX, wxDefaultPosition, wxSize(160,100) ,
+ m_listbox = new wxListBox( this, wxID_LISTBOX, wxDefaultPosition, wxSize(160,100) ,
n, choices, wxLB_ALWAYS_SB );
m_listbox->SetSelection( m_selection );
if (clientData)
SetAutoLayout( TRUE );
SetSizer( topsizer );
-
+
topsizer->SetSizeHints( this );
topsizer->Fit( this );