X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f85391ea7ec33be616af1a323e2d5c2e0f6e74f..c5e2dc6f5ba909192ff6c22ead5e7600a00bad0f:/src/univ/combobox.cpp diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 4c122a1904..83ecde8dc1 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "univcombobox.h" #endif @@ -93,7 +93,7 @@ public: } protected: - void OnButton(wxCommandEvent& event) { m_combo->ShowPopup(); } + void OnButton(wxCommandEvent& WXUNUSED(event)) { m_combo->ShowPopup(); } virtual wxSize DoGetBestClientSize() const { @@ -123,6 +123,8 @@ public: // implement wxComboPopup methods virtual bool SetSelection(const wxString& value); + virtual void SetSelection(int n, bool select) + { wxListBox::SetSelection( n, select); }; virtual wxControl *GetControl() { return this; } virtual void OnShow(); virtual wxCoord GetBestWidth() const; @@ -290,7 +292,7 @@ wxComboControl::~wxComboControl() // ---------------------------------------------------------------------------- void wxComboControl::DoSetSize(int x, int y, - int width, int height, + int width, int WXUNUSED(height), int sizeFlags) { // combo height is always fixed @@ -655,13 +657,44 @@ void wxComboBox::Init() m_lbox = (wxListBox *)NULL; } +wxComboBox::wxComboBox(wxWindow *parent, + wxWindowID id, + const wxString& value, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style, + const wxValidator& validator, + const wxString& name) +{ + Init(); + + Create(parent, id, value, pos, size, choices, style, validator, name); +} + +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) +{ + wxCArrayString chs(choices); + + return Create(parent, id, value, pos, size, chs.GetCount(), + chs.GetStrings(), style, validator, name); +} + bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, int n, - const wxString *choices, + const wxString choices[], long style, const wxValidator& validator, const wxString& name)