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:
@@ -120,6 +120,7 @@ protected:
|
||||
virtual void DoDeleteOneItem(unsigned int n);
|
||||
|
||||
virtual bool OnAddBitmap(const wxBitmap& bitmap);
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
void RecreateControl();
|
||||
|
||||
private:
|
||||
|
@@ -183,6 +183,20 @@ wxBitmapComboBox::~wxBitmapComboBox()
|
||||
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
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user