X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c4e8f384d7c9a2e1f31e9602917f2d1318de01f..13e24d79876b78545ba300e6b6871bc47af60848:/src/generic/bmpcboxg.cpp?ds=sidebyside diff --git a/src/generic/bmpcboxg.cpp b/src/generic/bmpcboxg.cpp index e74fabd3c1..6aec2b629e 100644 --- a/src/generic/bmpcboxg.cpp +++ b/src/generic/bmpcboxg.cpp @@ -146,6 +146,9 @@ bool wxBitmapComboBox::Create(wxWindow *parent, void wxBitmapComboBox::PostCreate() { m_fontHeight = GetCharHeight() + EXTRA_FONT_HEIGHT; + + while ( m_bitmaps.GetCount() < GetCount() ) + m_bitmaps.Add( new wxBitmap() ); } wxBitmapComboBox::~wxBitmapComboBox() @@ -159,7 +162,7 @@ wxBitmapComboBox::~wxBitmapComboBox() void wxBitmapComboBox::SetItemBitmap(unsigned int n, const wxBitmap& bitmap) { - wxCHECK_RET( n < m_bitmaps.size(), wxT("invalid item index") ); + wxCHECK_RET( n < GetCount(), wxT("invalid item index") ); OnAddBitmap(bitmap); *GetBitmapPtr(n) = bitmap; @@ -169,7 +172,7 @@ void wxBitmapComboBox::SetItemBitmap(unsigned int n, const wxBitmap& bitmap) wxBitmap wxBitmapComboBox::GetItemBitmap(unsigned int n) const { - wxCHECK_MSG( n < m_bitmaps.size(), wxNullBitmap, wxT("invalid item index") ); + wxCHECK_MSG( n < GetCount(), wxNullBitmap, wxT("invalid item index") ); return *GetBitmapPtr(n); } @@ -319,7 +322,7 @@ void wxBitmapComboBox::DetermineIndent() if ( m_usedImgSize.x > 0 ) { - indent = m_usedImgSize.y + IMAGE_SPACING_LEFT + IMAGE_SPACING_RIGHT; + indent = m_usedImgSize.x + IMAGE_SPACING_LEFT + IMAGE_SPACING_RIGHT; m_imgAreaWidth = indent; indent -= 3; @@ -377,7 +380,8 @@ void wxBitmapComboBox::OnDrawBackground(wxDC& dc, { if ( GetCustomPaintWidth() == 0 || !(flags & wxODCB_PAINTING_SELECTED) || - item < 0 ) + item < 0 || + ( (flags & wxODCB_PAINTING_CONTROL) && (GetInternalFlags() & wxCC_FULL_BUTTON)) ) { wxOwnerDrawnComboBox::OnDrawBackground(dc, rect, item, flags); return;