dabo Commit
Revision 3790
Date: 2007-12-11 11:28:39 -0800 (Tue, 11 Dec 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3790
Changed:
U trunk/dabo/ui/uiwx/dGrid.py
Log:
Added the ability to set whether or not a particular column is resizable.
Previously, we could only set this on or off for all columns at the grid
level. See the new dColumn.Resizable property.
Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2007-12-11 17:50:02 UTC (rev 3789)
+++ trunk/dabo/ui/uiwx/dGrid.py 2007-12-11 19:28:39 UTC (rev 3790)
@@ -1253,6 +1253,13 @@
return self._rendererClass
+ def _getResizable(self):
+ return getattr(self, "_resizable", True)
+
+ def _setResizable(self, val):
+ self._resizable = bool(val)
+
+
def _getSearchable(self):
try:
v = self._searchable
@@ -1526,6 +1533,13 @@
self.CustomRendererClass if set, or the default
renderer class for the
datatype of the field. (varies)"""))
+ Resizable = property(_getResizable, _setResizable, None,
+ _("""Specifies whether this column is resizable by the
user.
+
+ Note also the dGrid.ResizableColumns property - if that
is set
+ to False, columns will not be resizable even if their
Resizable
+ property is set to True."""))
+
Searchable = property(_getSearchable, _setSearchable, None,
_("""Specifies whether this column's incremental search
is enabled.
Default: True. The grid's Searchable property will
override this setting.
@@ -3232,12 +3246,11 @@
def __onWxGridColSize(self, evt):
- if not self.ResizableColumns:
+ if self.ResizableColumns and
self.Columns[evt.GetRowOrCol()].Resizable:
+ self.raiseEvent(dEvents.GridColSize, evt)
+ else:
evt.Veto()
self._paintHeader()
- else:
- self.raiseEvent(dEvents.GridColSize, evt)
- evt.Skip()
def __onWxGridSelectCell(self, evt):
_______________________________________________
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/dabo-dev/[EMAIL PROTECTED]