-bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& message,
- const wxString& WXUNUSED(caption), int n,
- const wxString *choices, wxChar **clientData, long style,
- const wxPoint& WXUNUSED(pos) )
-{
- m_dialogStyle = style;
- m_selection = 0;
- m_stringSelection = _T("");
- m_clientData = NULL;
-
- wxBeginBusyCursor();
-
- wxSize message_size( wxSplitMessage2( message, this ) );
-
- wxButton *ok = (wxButton *) NULL;
- wxButton *cancel = (wxButton *) NULL;
- wxList m_buttons;
-
- int y = message_size.y + 15;
-
- int listbox_height = wxMin( 160, n*20 );
-
- wxListBox *listBox = new wxListBox( this, wxID_LISTBOX, wxPoint(10, y), wxSize(240, listbox_height),
- n, choices, wxLB_ALWAYS_SB );
- listBox->SetSelection( m_selection );
- if (clientData)
- {
- for (int i = 0; i < n; i++)
- listBox->SetClientData(i, clientData[i]);
- }
-
- y += listbox_height + 35;
-
- if (style & wxOK)
- {
- ok = new wxButton( this, wxID_OK, _("OK"), wxPoint(-1,y), wxSize(80,-1) );
- m_buttons.Append( ok );
- }