Added wxMSW wxBitmapComboBox::DoGetBestSize(), which takes bitmap size into account.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2009-07-18 07:31:09 +00:00
parent 6a1df26215
commit 41ce9ae1b0
2 changed files with 15 additions and 0 deletions

View File

@@ -120,6 +120,7 @@ protected:
virtual void DoDeleteOneItem(unsigned int n); virtual void DoDeleteOneItem(unsigned int n);
virtual bool OnAddBitmap(const wxBitmap& bitmap); virtual bool OnAddBitmap(const wxBitmap& bitmap);
virtual wxSize DoGetBestSize() const;
void RecreateControl(); void RecreateControl();
private: private:

View File

@@ -183,6 +183,20 @@ wxBitmapComboBox::~wxBitmapComboBox()
Clear(); Clear();
} }
wxSize wxBitmapComboBox::DoGetBestSize() const
{
wxSize best = wxComboBox::DoGetBestSize();
wxSize bitmapSize = GetBitmapSize();
wxCoord useHeightBitmap = EDIT_HEIGHT_FROM_CHAR_HEIGHT(bitmapSize.y);
if ( best.y < useHeightBitmap )
{
best.y = useHeightBitmap;
CacheBestSize(best);
}
return best;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Item manipulation // Item manipulation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------