From e83844692e1e83324e9eaa5e9009d55df6df83b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 20 Jul 2006 14:37:47 +0000 Subject: [PATCH] [ 1524693 ] wxOwnerDrawnComboBox focus paint fix. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/combo/combo.cpp | 4 +++- src/generic/odcombo.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index a136903a67..5f8e7fea59 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -228,8 +228,10 @@ public: int item, int flags ) const { - // If item is selected or even, use the default rendering. + // If item is selected or even, or we are painting the + // combo control itself, use the default rendering. if ( GetVListBoxComboPopup()->IsCurrent((size_t)item) || + (flags & wxODCB_PAINTING_CONTROL) || (item & 1) == 0 ) { wxOwnerDrawnComboBox::OnDrawBackground(dc,rect,item,flags); diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index c2a9e98294..1e9926cd8e 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -1041,7 +1041,8 @@ wxCoord wxOwnerDrawnComboBox::OnMeasureItemWidth( size_t WXUNUSED(item) ) const void wxOwnerDrawnComboBox::OnDrawBackground(wxDC& dc, const wxRect& rect, int item, int flags) const { // we need to render selected and current items differently - if ( GetVListBoxComboPopup()->IsCurrent((size_t)item) ) + if ( GetVListBoxComboPopup()->IsCurrent((size_t)item) || + (flags & wxODCB_PAINTING_CONTROL) ) { DrawFocusBackground(dc, rect, -- 2.45.2