From a2851207a67cf0ca12bf83611ecd6a4367d30f53 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Sun, 23 Nov 2008 11:30:24 +0000 Subject: [PATCH] Render cell background in renderer only if rendering on propgrid canvas git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/editors.cpp | 2 ++ src/propgrid/property.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index ae1d0c79b2..87ea4c0d88 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -691,6 +691,8 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, if ( flags & wxODCB_PAINTING_CONTROL ) renderFlags |= wxPGCellRenderer::Control; + else + renderFlags |= wxPGCellRenderer::ChoicePopup; if ( flags & wxODCB_PAINTING_SELECTED ) renderFlags |= wxPGCellRenderer::Selected; diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 10ba288e65..53a26de39f 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -149,8 +149,10 @@ int wxPGCellRenderer::PreDrawCell( wxDC& dc, const wxRect& rect, const wxPGCell& dc.SetTextForeground(cell.GetFgCol()); } - // Draw Background - dc.DrawRectangle(rect); + // Draw Background, but only if not rendering in control + // (as control already has rendered correct background). + if ( !(flags & (Control|ChoicePopup)) ) + dc.DrawRectangle(rect); const wxBitmap& bmp = cell.GetBitmap(); if ( bmp.Ok() && -- 2.45.2