From: Jaakko Salli Date: Sat, 18 Jul 2009 08:33:55 +0000 (+0000) Subject: Added wxGTK wxBitmapComboBox::DoGetBestSize() implementation that takes bitmap size... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c90e98dcb66aa20cf64fa0f5633026c2f74dab1a?ds=sidebyside Added wxGTK wxBitmapComboBox::DoGetBestSize() implementation that takes bitmap size into acccount. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/bmpcbox.h b/include/wx/gtk/bmpcbox.h index 95e3e873c0..bfa3399b3b 100644 --- a/include/wx/gtk/bmpcbox.h +++ b/include/wx/gtk/bmpcbox.h @@ -133,6 +133,8 @@ protected: virtual void GTKCreateComboBoxWidget(); virtual void GTKInsertComboBoxTextItem( unsigned int n, const wxString& text ); + virtual wxSize DoGetBestSize() const; + wxSize m_bitmapSize; int m_bitmapCellIndex; diff --git a/src/gtk/bmpcbox.cpp b/src/gtk/bmpcbox.cpp index 4b42a746ab..7743cd1465 100644 --- a/src/gtk/bmpcbox.cpp +++ b/src/gtk/bmpcbox.cpp @@ -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 // ----------------------------------------------------------------------------