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:
@@ -903,9 +903,15 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
|
|||||||
|
|
||||||
if ( choices.IsOk() && item >= 0 && comValIndex < 0 )
|
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);
|
cell = &choices.Item(item);
|
||||||
renderer = wxPGGlobalVars->m_defaultRenderer;
|
renderer = wxPGGlobalVars->m_defaultRenderer;
|
||||||
int imageOffset = renderer->PreDrawCell(dc, rect, *cell,
|
int imageOffset = renderer->PreDrawCell(dc, r, *cell,
|
||||||
renderFlags );
|
renderFlags );
|
||||||
if ( imageOffset )
|
if ( imageOffset )
|
||||||
imageOffset += wxCC_CUSTOM_IMAGE_MARGIN1 +
|
imageOffset += wxCC_CUSTOM_IMAGE_MARGIN1 +
|
||||||
|
Reference in New Issue
Block a user