dabo Commit
Revision 6768
Date: 2011-08-09 03:39:05 -0700 (Tue, 09 Aug 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6768
Changed:
U trunk/dabo/ui/uiwx/dListControl.py
Log:
Update ExpandColumn property setter code.
Diff:
Modified: trunk/dabo/ui/uiwx/dListControl.py
===================================================================
--- trunk/dabo/ui/uiwx/dListControl.py 2011-08-09 10:38:03 UTC (rev 6767)
+++ trunk/dabo/ui/uiwx/dListControl.py 2011-08-09 10:39:05 UTC (rev 6768)
@@ -611,19 +611,24 @@
def _setExpandColumn(self, val):
if self._constructed():
+ columnCount = self.ColumnCount
if isinstance(val, basestring):
val = val.upper().strip()
else:
- if val >= self.ColumnCount:
+ if val >= columnCount and columnCount > 0:
raise IndexError(_("Invalid column %s
specified for dListControl.ExpandColumn") % val)
if self._expandColumn != val:
- self._resetSize(self._expandColumn)
- self._expandColumn = val
- if isinstance(val, (int, long)):
- # Need to decrease by one, since the
mixin uses a 1-based column numbering
- self.setResizeColumn(val+1)
+ if columnCount == 0:
+ self._expandColumn = val
else:
- self.setResizeColumn(val)
+ if self._expandColumn:
+
self._resetSize(self._expandColumn)
+ self._expandColumn = val
+ if isinstance(val, (int, long)):
+ # Need to decrease by one,
since the mixin uses a 1-based column numbering
+ self.setResizeColumn(val + 1)
+ else:
+ self.setResizeColumn(val)
else:
self._properties["ExpandColumn"] = val
_______________________________________________
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]