]> git.saurik.com Git - wxWidgets.git/commitdiff
[ 1524693 ] wxOwnerDrawnComboBox focus paint fix.
authorWłodzimierz Skiba <abx@abx.art.pl>
Thu, 20 Jul 2006 14:37:47 +0000 (14:37 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Thu, 20 Jul 2006 14:37:47 +0000 (14:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/combo/combo.cpp
src/generic/odcombo.cpp

index a136903a679e3b1746c70d81791daced1517250a..5f8e7fea591c87fcaeeac2dcf82873aa8f80d9be 100644 (file)
@@ -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);
index c2a9e98294802c28dfe13f59e957f25f5a7c7777..1e9926cd8e74b2b3cad59f56516631b0565fcb48 100644 (file)
@@ -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,