]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/odcombo.cpp
wxchar.h doesn't have to be C file anymore, it's C++
[wxWidgets.git] / src / generic / odcombo.cpp
index 34940a642713a593ab967c182c3af826a73df2ec..3e62b8349d553f1260ea780ae7d894b50af3d636 100644 (file)
@@ -116,7 +116,7 @@ void wxVListBoxComboPopup::PaintComboControl( wxDC& dc, const wxRect& rect )
 
         if ( m_value >= 0 )
         {
-            OnDrawItem(dc,rect,m_value,wxODCB_PAINTING_CONTROL);
+            OnDrawItem(dc,rect,m_value,flags);
             return;
         }
     }
@@ -129,13 +129,20 @@ void wxVListBoxComboPopup::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) co
     // TODO: Maybe this code could be moved to wxVListBox::OnPaint?
     dc.SetFont(m_useFont);
 
+    int flags = 0;
+
     // Set correct text colour for selected items
     if ( wxVListBox::GetSelection() == (int) n )
+    {
         dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) );
+        flags |= wxODCB_PAINTING_SELECTED;
+    }
     else
+    {
         dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT) );
+    }
 
-    OnDrawItem(dc,rect,(int)n,0);
+    OnDrawItem(dc,rect,(int)n,flags);
 }
 
 wxCoord wxVListBoxComboPopup::OnMeasureItem(size_t n) const