X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1169a91932273bc84c23ed9dbd0a2da064d59d66..3527e5324247dca419d71d4e4658b20c6f10340a:/src/univ/combobox.cpp diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 53d2c180fc..494df2c0b8 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -213,25 +213,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) // 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; @@ -299,7 +280,7 @@ wxComboControl::~wxComboControl() { // 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; @@ -671,9 +652,9 @@ wxSize wxComboListBox::DoGetBestClientSize() const // wxComboBox // ---------------------------------------------------------------------------- -wxComboBox::wxComboBox() +void wxComboBox::Init() { - Init(); + m_lbox = (wxListBox *)NULL; } wxComboBox::wxComboBox(wxWindow *parent, @@ -681,21 +662,30 @@ 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, @@ -704,7 +694,7 @@ 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)