]> git.saurik.com Git - wxWidgets.git/commitdiff
Set foreground colour when drawing items in the VListBox
authorRobin Dunn <robin@alldunn.com>
Mon, 29 Dec 2003 19:24:16 +0000 (19:24 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 29 Dec 2003 19:24:16 +0000 (19:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/wxVListBox.py

index b588fba1e0dd20e510bb39ba26e41a83201888b0..cbe77076982dabd041b02a4d83bd26934ffab5b3 100644 (file)
@@ -15,6 +15,11 @@ class MyVListBox(wx.VListBox):
     # n'th item on the dc within the rect.  How it is drawn, and what
     # is drawn is entirely up to you.
     def OnDrawItem(self, dc, rect, n):
+        if self.GetSelection() == n:
+            c = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)
+        else:
+            c = self.GetForegroundColour()#wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT) 
+        dc.SetTextForeground(c)
         dc.DrawLabel(self._getItemText(n), rect,
                      wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL)