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
This commit is contained in:
@@ -756,8 +756,6 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
|
|||||||
if ( item < 0 )
|
if ( item < 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxSize cis;
|
|
||||||
|
|
||||||
const wxBitmap* itemBitmap = NULL;
|
const wxBitmap* itemBitmap = NULL;
|
||||||
|
|
||||||
if ( item >= 0 && choices.IsOk() && choices.Item(item).GetBitmap().IsOk() && comValIndex == -1 )
|
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
|
// 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 = itemBitmap->GetSize();
|
||||||
cis.y = itemBitmap->GetHeight();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -850,8 +849,9 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
|
|||||||
if ( p->m_valueBitmap && item != pCb->GetSelection() )
|
if ( p->m_valueBitmap && item != pCb->GetSelection() )
|
||||||
useCustomPaintProcedure = false;
|
useCustomPaintProcedure = false;
|
||||||
// If current choice had a bitmap set by the application, then
|
// If current choice had a bitmap set by the application, then
|
||||||
// use it instead of any custom paint procedure.
|
// use it instead of any custom paint procedure
|
||||||
else if ( itemBitmap )
|
// (only if not drawn in the control field).
|
||||||
|
else if ( itemBitmap && !(flags & wxODCB_PAINTING_CONTROL) )
|
||||||
useCustomPaintProcedure = false;
|
useCustomPaintProcedure = false;
|
||||||
|
|
||||||
if ( useCustomPaintProcedure )
|
if ( useCustomPaintProcedure )
|
||||||
|
Reference in New Issue
Block a user