]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/combobox.cpp
Invalidate notebook best size when pages are added or removed
[wxWidgets.git] / src / mac / carbon / combobox.cpp
index 6ca5ce57db62b76934edd9a6c3f4a130be74a78b..27f2e3349356b0abb0bdcbd03466d3337e68e1e4 100644 (file)
@@ -62,9 +62,6 @@ public:
         : wxTextCtrl( cb , 1 )
     {
         m_cb = cb;
-
-        // remove the default minsize, the combobox will have one instead
-        SetSizeHints(-1,-1);
     }
 
 protected:
@@ -145,9 +142,6 @@ public:
         : wxChoice( cb , 1 )
     {
         m_cb = cb;
-
-        // remove the default minsize, the combobox will have one instead
-        SetSizeHints(-1,-1);
     }
 
 protected:
@@ -205,6 +199,8 @@ wxComboBox::~wxComboBox()
 
 wxSize wxComboBox::DoGetBestSize() const
 {
+    if (!m_choice && !m_text)
+        return GetSize();
     wxSize size = m_choice->GetBestSize();
     
     if ( m_text != NULL )
@@ -323,7 +319,6 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
     }
 
     m_choice = new wxComboBoxChoice(this, style );
-    m_choice->SetSizeHints( wxSize( POPUPWIDTH , POPUPHEIGHT ) ) ;
     wxSize csize = size;
     if ( style & wxCB_READONLY )
     {
@@ -344,7 +339,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
         m_choice->DoAppend( choices[ i ] );
     }
 
-    SetBestSize(csize);   // Needed because it is a wxControlWithItems
+    SetBestSize(size);   // Needed because it is a wxControlWithItems
 
     return TRUE;
 }