X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/676dd1dc302f20f601e31d3772a0a0e0215723f0..48a2e193ec60bca94903706a7fd7528e9311037e:/src/generic/bmpcboxg.cpp?ds=sidebyside diff --git a/src/generic/bmpcboxg.cpp b/src/generic/bmpcboxg.cpp index 3432680bd6..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); } @@ -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;