]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/combobox.cpp
allow compilation with wxUSE_CHOICEDLG set to 0
[wxWidgets.git] / src / mac / carbon / combobox.cpp
index 643732eb239ee95cfec6460c339198acca5dcc96..f158ee702e41278547ba0f162dee22f7a2e779bd 100644 (file)
@@ -59,6 +59,9 @@ public:
         : wxTextCtrl( cb , 1 )
     {
         m_cb = cb;
+
+        // remove the default minsize, the combobox will have one instead
+        SetSizeHints(-1,-1);
     }
 
 protected:
@@ -139,6 +142,9 @@ public:
         : wxChoice( cb , 1 )
     {
         m_cb = cb;
+
+        // remove the default minsize, the combobox will have one instead
+        SetSizeHints(-1,-1);
     }
 
 protected:
@@ -156,7 +162,8 @@ protected:
     virtual wxSize DoGetBestSize() const
     {
         wxSize sz = wxChoice::DoGetBestSize() ;
-        sz.x = POPUPWIDTH ;
+        if (! m_cb->HasFlag(wxCB_READONLY) )
+            sz.x = POPUPWIDTH;
         return sz ;
     }  
 
@@ -342,6 +349,11 @@ wxString wxComboBox::GetValue() const
     return result;
 }
 
+int wxComboBox::GetCount() const
+{ 
+    return m_choice->GetCount() ; 
+}
+
 void wxComboBox::SetValue(const wxString& value)
 {
     int s = FindString (value);