dabo Commit
Revision 4451
Date: 2008-08-26 09:49:28 -0700 (Tue, 26 Aug 2008)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/4451

Changed:
U   trunk/dabo/ui/uiwx/dGrid.py

Log:
Fixed problem on Windows where the text color would stay the same as the prior 
column.

Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2008-08-26 16:07:02 UTC (rev 4450)
+++ trunk/dabo/ui/uiwx/dGrid.py 2008-08-26 16:49:28 UTC (rev 4451)
@@ -2255,14 +2255,17 @@
        def _paintHeader(self, colObj=None):
                w = self._getWxHeader()
                dc = wx.ClientDC(w)
+               
                if colObj is None:
                        # Normal case: from EVT_PAINT
                        updateBox = w._updateBox
                else:
                        # Special case: redraw the header for a specific column
                        updateBox = colObj._getHeaderRect()
+
                x1 = updateBox[0]
                x2 = x1 + updateBox[2]
+
                while x2 > x1:
                        sortIndicator = False
                        left = x1
@@ -2273,21 +2276,24 @@
                        x1 += colObj.Width
                        rect = colObj._getHeaderRect()
                        dc.SetClippingRegion(rect.x, rect.y, rect.width, 
rect.height)
+       
+                       holdBrush = dc.GetBrush()
+                       holdPen = dc.GetPen()
 
                        fcolor = colObj.HeaderForeColor
                        if fcolor is None:
                                fcolor = self.HeaderForeColor
+                               if fcolor is None:
+                                       fcolor = (0,0,0)
 
                        bcolor = colObj.HeaderBackColor
                        if bcolor is None:
                                bcolor = self.HeaderBackColor
 
+
                        dc.SetTextForeground(fcolor)
                        font = colObj.HeaderFont._nativeFont
 
-                       holdBrush = dc.GetBrush()
-                       holdPen = dc.GetPen()
-
                        if bcolor is not None:
                                dc.SetBrush(wx.Brush(bcolor, wx.SOLID))
                                dc.SetPen(wx.Pen(None, width=0))
@@ -2361,6 +2367,8 @@
                        dc.DrawLabel("%s" % colObj.Caption, trect, wxav|wxah)
                        dc.DestroyClippingRegion()
 
+
+
        def showColumn(self, col, visible):
                """If the column is not shown and visible=True, show it. 
Likewise
                but opposite if visible=False.




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to