// the margin between the text control and the choice
static const wxCoord MARGIN = 2;
+#if TARGET_API_MAC_OSX
+static const int POPUPWIDTH = 24;
+#else
static const int POPUPWIDTH = 18;
+#endif
static const int POPUPHEIGHT = 23;
: wxTextCtrl( cb , 1 )
{
m_cb = cb;
+
+ // remove the default minsize, the combobox will have one instead
+ SetSizeHints(-1,-1);
}
protected:
: wxChoice( cb , 1 )
{
m_cb = cb;
+
+ // remove the default minsize, the combobox will have one instead
+ SetSizeHints(-1,-1);
}
protected:
event2.SetString(m_cb->GetStringSelection());
m_cb->ProcessCommand(event2);
}
+ virtual wxSize DoGetBestSize() const
+ {
+ wxSize sz = wxChoice::DoGetBestSize() ;
+ if (! m_cb->HasFlag(wxCB_READONLY) )
+ sz.x = POPUPWIDTH;
+ return sz ;
+ }
private:
wxComboBox *m_cb;
}
m_choice = new wxComboBoxChoice(this, style );
-
+ m_choice->SetSizeHints( wxSize( POPUPWIDTH , POPUPHEIGHT ) ) ;
wxSize csize = size;
if ( style & wxCB_READONLY )
{
return result;
}
+int wxComboBox::GetCount() const
+{
+ return m_choice->GetCount() ;
+}
+
void wxComboBox::SetValue(const wxString& value)
{
int s = FindString (value);