dabo Commit
Revision 6957
Date: 2011-11-01 11:54:52 -0700 (Tue, 01 Nov 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6957
Changed:
U trunk/dabo/ui/uiwx/dSplitter.py
Log:
Added the 'CanUnsplit' property. Setting this to False (default=True) will
prevent the window from unsplitting when double-clicking the sash if the
MinimumPanelSize property is non-zero.
Diff:
Modified: trunk/dabo/ui/uiwx/dSplitter.py
===================================================================
--- trunk/dabo/ui/uiwx/dSplitter.py 2011-10-28 19:35:01 UTC (rev 6956)
+++ trunk/dabo/ui/uiwx/dSplitter.py 2011-11-01 18:54:52 UTC (rev 6957)
@@ -108,7 +108,11 @@
"""
def __init__(self, parent, properties=None, attProperties=None, *args,
**kwargs):
self._baseClass = dSplitter
- baseStyle = wx.SP_3D | wx.SP_LIVE_UPDATE | wx.SP_PERMIT_UNSPLIT
+ unsplitAtt = self._extractKey((kwargs, properties,
attProperties), "CanUnsplit", "True")
+ self._canUnsplit = unsplitAtt.upper()[0] == "T"
+ baseStyle = wx.SP_3D | wx.SP_LIVE_UPDATE
+ if self._canUnsplit:
+ baseStyle = baseStyle | wx.SP_PERMIT_UNSPLIT
style = self._extractKey((kwargs, properties, attProperties),
"style", baseStyle)
self._createPanes = self._extractKey(attProperties,
"createPanes", None)
if self._createPanes is not None:
@@ -293,6 +297,10 @@
self.split()
+ def _getCanUnsplit(self):
+ return self._canUnsplit
+
+
def _getMinPanelSize(self):
return self.GetMinimumPaneSize()
@@ -437,6 +445,11 @@
self.unsplit()
+ CanUnsplit = property(_getCanUnsplit, None, None,
+ _("""Can the control be unsplit (i.e., only the first
pane visible),
+ even with a non-zero MinimumPanelSize? Can only be set
when the control
+ is created; read-only afterwards. Default=True
(bool)"""))
+
MinimumPanelSize = property(_getMinPanelSize, _setMinPanelSize, None,
_("Controls the minimum width/height of the panels.
(int)"))
_______________________________________________
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]