]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/bmpcbox.cpp
the wx part knows better whether it has the focus (may be the embedded NSView, not...
[wxWidgets.git] / src / gtk / bmpcbox.cpp
index 6cbf891530fa55685d3e20eaf972b15cfba95e0e..3ec26bd7c8298fc61092af9b0ea4fa13b7b346a4 100644 (file)
@@ -164,6 +164,19 @@ GdkWindow *wxBitmapComboBox::GTKGetWindow(wxArrayGdkWindows& windows) const
     return wxChoice::GTKGetWindow(windows);
 }
 
+wxSize wxBitmapComboBox::DoGetBestSize() const
+{
+    wxSize best = wxComboBox::DoGetBestSize();
+
+    int delta = GetBitmapSize().y - GetCharHeight();
+    if ( delta > 0 )
+    {
+        best.y += delta;
+        CacheBestSize(best);
+    }
+    return best;
+}
+
 // ----------------------------------------------------------------------------
 // Item manipulation
 // ----------------------------------------------------------------------------
@@ -264,6 +277,15 @@ int wxBitmapComboBox::Insert(const wxString& item, const wxBitmap& bitmap,
     return n;
 }
 
+int wxBitmapComboBox::Insert(const wxString& item, const wxBitmap& bitmap,
+                             unsigned int pos, void *clientData)
+{
+    const int n = wxComboBox::Insert(item, pos, clientData);
+    if ( n != wxNOT_FOUND )
+        SetItemBitmap(n, bitmap);
+    return n;
+}
+
 void wxBitmapComboBox::GTKInsertComboBoxTextItem( unsigned int n, const wxString& text )
 {
     GtkComboBox* combobox = GTK_COMBO_BOX( m_widget );
@@ -288,6 +310,8 @@ void wxBitmapComboBox::WriteText(const wxString& value)
 {
     if ( GetEntry() )
         wxComboBox::WriteText(value);
+    else
+        SetStringSelection(value);
 }
 
 wxString wxBitmapComboBox::GetValue() const