Fix drawing choice item bitmap when using wxPGEditor_Choice.

Horizontal alignment of bitmap associated with wxPGChoice item drawn in wxPGComboBox (in wxPropertyGrid::OnComboItemPaint) needs to be adjusted by 1 pixel (as it is already done for text label) in order to get the bitmap in the same position when wxPGComboBox is selected.
This commit is contained in:
Artur Wieczorek 2015-07-05 21:17:35 +02:00
parent a253cdb413
commit 6f3003c3e1

View File

@ -903,9 +903,15 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
if ( choices.IsOk() && item >= 0 && comValIndex < 0 )
{
// This aligns bitmap horizontally so that it is
// on the same position as bitmap drawn for static content
// (without editor).
wxRect r(rect);
r.x -= 1;
cell = &choices.Item(item);
renderer = wxPGGlobalVars->m_defaultRenderer;
int imageOffset = renderer->PreDrawCell(dc, rect, *cell,
int imageOffset = renderer->PreDrawCell(dc, r, *cell,
renderFlags );
if ( imageOffset )
imageOffset += wxCC_CUSTOM_IMAGE_MARGIN1 +