From a90597a355dfb39fcf3b95503b1f9426ec2b383e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 12 Jan 2015 20:23:58 +0000 Subject: [PATCH] Don't attempt to draw element-specific bitmap when drawing wxPGChoices element inside the control field of wxEnumProperty with wxPGComboBox. The only bitmap which can be drawn in the control field is a "general" value bitmap (assigned to the property). Closes #16781 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/editors.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 923a434704..29459269ec 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -756,8 +756,6 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, if ( item < 0 ) return; - wxSize cis; - const wxBitmap* itemBitmap = NULL; if ( item >= 0 && choices.IsOk() && choices.Item(item).GetBitmap().IsOk() && comValIndex == -1 ) @@ -765,10 +763,11 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, // // Decide what custom image size to use - if ( itemBitmap ) + // (Use item-specific bitmap only if not drawn in the control field.) + wxSize cis; + if ( itemBitmap && !(flags & wxODCB_PAINTING_CONTROL) ) { - cis.x = itemBitmap->GetWidth(); - cis.y = itemBitmap->GetHeight(); + cis = itemBitmap->GetSize(); } else { @@ -850,8 +849,9 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, if ( p->m_valueBitmap && item != pCb->GetSelection() ) useCustomPaintProcedure = false; // If current choice had a bitmap set by the application, then - // use it instead of any custom paint procedure. - else if ( itemBitmap ) + // use it instead of any custom paint procedure + // (only if not drawn in the control field). + else if ( itemBitmap && !(flags & wxODCB_PAINTING_CONTROL) ) useCustomPaintProcedure = false; if ( useCustomPaintProcedure )