// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "univcombobox.h"
#endif
}
protected:
- void OnButton(wxCommandEvent& event) { m_combo->ShowPopup(); }
+ void OnButton(wxCommandEvent& WXUNUSED(event)) { m_combo->ShowPopup(); }
virtual wxSize DoGetBestClientSize() const
{
// 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;
{
// 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;
// ----------------------------------------------------------------------------
void wxComboControl::DoSetSize(int x, int y,
- int width, int height,
+ int width, int WXUNUSED(height),
int sizeFlags)
{
// combo height is always fixed
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)
if (pos == GetCount())
return DoAppend(item);
- GetLBox()->Insert(1, &item, pos);
+ GetLBox()->Insert(item, pos);
return pos;
}