dabo Commit
Revision 6340
Date: 2011-01-24 03:33:09 -0800 (Mon, 24 Jan 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6340

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

Log:
Fix dGrid _columnMetrics attribute issue.

Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2011-01-22 17:44:02 UTC (rev 6339)
+++ trunk/dabo/ui/uiwx/dGrid.py 2011-01-24 11:33:09 UTC (rev 6340)
@@ -2664,7 +2664,6 @@
                        txt = self.drawText("%s" % colObj.Caption, x, y, 
angle=textAngle,
                                        persist=False, dc=dc, useDefaults=True)
                        dc.DestroyClippingRegion()
-               self._headerMaxTextHeight = max([cht for cwd, cht in 
self._columnMetrics])
                if self.AutoAdjustHeaderHeight:
                        self.fitHeaderHeight()
                self._inHeaderPaint = False
@@ -2675,7 +2674,10 @@
                vertical captions or multi-line captions.
                """
                self._paintHeader()
-               self._headerMaxTextHeight = max([cht for cwd, cht in 
self._columnMetrics])
+               if self._columnMetrics:
+                       self._headerMaxTextHeight = max([cht for cwd, cht in 
self._columnMetrics])
+               else:
+                       self._headerMaxTextHeight = 0
                diff = (self._headerMaxTextHeight + 20) - self.HeaderHeight
                if diff:
                        self.HeaderHeight += diff



_______________________________________________
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