X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/befee9b7138622434d29acf09427d69a1e7c68ee..e3d358bbe4940c85304e9193010b27ba04c9fb86:/src/msw/bmpcbox.cpp diff --git a/src/msw/bmpcbox.cpp b/src/msw/bmpcbox.cpp index 6ae9044a2d..19a5d3a050 100644 --- a/src/msw/bmpcbox.cpp +++ b/src/msw/bmpcbox.cpp @@ -131,6 +131,7 @@ void wxBitmapComboBox::RecreateControl() wxString value = GetValue(); wxPoint pos = GetPosition(); wxSize size = GetSize(); + size.y = GetBestSize().y; wxArrayString strings = GetStrings(); wxComboBox::DoClear(); @@ -176,6 +177,8 @@ void wxBitmapComboBox::RecreateControl() { SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); } + + ::SendMessage(GetHwnd(), CB_SETITEMHEIGHT, 0, MeasureItem(0)); } wxBitmapComboBox::~wxBitmapComboBox() @@ -183,6 +186,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 // ---------------------------------------------------------------------------- @@ -294,7 +311,7 @@ bool wxBitmapComboBox::OnAddBitmap(const wxBitmap& bitmap) return true; } - + return false; } @@ -351,7 +368,7 @@ bool wxBitmapComboBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) if ( pos == -1 ) return FALSE; - int flags = 0; + int flags = 0; if ( lpDrawItem->itemState & ODS_COMBOBOXEDIT ) flags |= wxODCB_PAINTING_CONTROL; if ( lpDrawItem->itemState & ODS_SELECTED )