dabo Commit
Revision 4573
Date: 2008-10-21 17:00:19 -0700 (Tue, 21 Oct 2008)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/4573

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

Log:
Fixed dGrid headers on Windows.

Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2008-10-21 23:46:10 UTC (rev 4572)
+++ trunk/dabo/ui/uiwx/dGrid.py 2008-10-22 00:00:19 UTC (rev 4573)
@@ -2280,11 +2280,17 @@
 
        
 
-       def _paintHeader(self):
+       def _paintHeader(self, updateBox=None, _paintDC=False):
                w = self._getWxHeader()
-               dc = wx.PaintDC(w)
-               updateBox = w.GetUpdateRegion().GetBox()
 
+               if updateBox is None:
+                       updateBox = w.GetClientRect()
+
+               if _paintDC:
+                       dc = wx.PaintDC(w)
+               else:
+                       dc = wx.ClientDC(w)
+
                for col in self._columns:
                        headerRect = col._getHeaderRect()
                        intersect = wx.IntersectRect(updateBox, headerRect)
@@ -3715,10 +3721,12 @@
 
        def __onWxHeaderPaint(self, evt):
                self.raiseEvent(dEvents.GridHeaderPaint, evt)
-               #evt.Skip()
-               self._paintHeader()
+               updateBox = self._getWxHeader().GetUpdateRegion().GetBox()
+               if sys.platform.startswith("win"):
+                       dabo.ui.callAfter(self._paintHeader, updateBox)
+               else:
+                       self._paintHeader(updateBox, _paintDC=True)
 
-
        def _getColRowForPosition(self, pos):
                """Used in the mouse event handlers to stuff the col, row into 
EventData."""
                col = self.getColNumByX(pos[0])




_______________________________________________
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