// wxComboControl creation
// ----------------------------------------------------------------------------
-wxComboControl::wxComboControl()
-{
- Init();
-}
-
-wxComboControl::wxComboControl(wxWindow *parent,
- wxWindowID id,
- const wxString& value,
- const wxPoint& pos,
- const wxSize& size,
- long style,
- const wxValidator& validator,
- const wxString& name)
-{
- Init();
-
- (void)Create(parent, id, value, pos, size, style, validator, name);
-}
-
void wxComboControl::Init()
{
m_popup = (wxComboPopup *)NULL;
{
// as the button and the text control are the parent's children and not
// ours, we have to delete them manually - they are not deleted
- // automatically by wxWindows when we're deleted
+ // automatically by wxWidgets when we're deleted
delete m_btn;
delete m_text;
// wxComboBox
// ----------------------------------------------------------------------------
-wxComboBox::wxComboBox()
+void wxComboBox::Init()
{
- Init();
+ m_lbox = (wxListBox *)NULL;
}
wxComboBox::wxComboBox(wxWindow *parent,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
- int n,
- const wxString *choices,
+ const wxArrayString& choices,
long style,
const wxValidator& validator,
const wxString& name)
{
Init();
- (void)Create(parent, id, value, pos, size, n, choices,
- style, validator, name);
+ Create(parent, id, value, pos, size, choices, style, validator, name);
}
-void wxComboBox::Init()
+bool wxComboBox::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxString& value,
+ const wxPoint& pos,
+ const wxSize& size,
+ const wxArrayString& choices,
+ long style,
+ const wxValidator& validator,
+ const wxString& name)
{
- m_lbox = (wxListBox *)NULL;
+ wxCArrayString chs(choices);
+
+ return Create(parent, id, value, pos, size, chs.GetCount(),
+ chs.GetStrings(), style, validator, name);
}
bool wxComboBox::Create(wxWindow *parent,
const wxPoint& pos,
const wxSize& size,
int n,
- const wxString *choices,
+ const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name)