dabo Commit
Revision 6191
Date: 2010-11-14 17:48:20 -0800 (Sun, 14 Nov 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6191

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

Log:
Added the MinSizerWidth and MinSizerHeight properties, and set them both to 
default to 100px initially. This will ensure that the control is never sized to 
zero pixels when given a proportion of 0, as was happening previously. In my 
testing, 100px seemed like a reasonable default, but I'm open to arguments for 
other defaults.


Diff:
Modified: trunk/dabo/ui/uiwx/dSlidePanelControl.py
===================================================================
--- trunk/dabo/ui/uiwx/dSlidePanelControl.py    2010-11-11 23:35:01 UTC (rev 
6190)
+++ trunk/dabo/ui/uiwx/dSlidePanelControl.py    2010-11-15 01:48:20 UTC (rev 
6191)
@@ -397,6 +397,8 @@
                self.__inSingletonProcess = False
                # Flag to track the currently expanded panel in Singleton 
format.
                self.__openPanel = None
+               # Ensures that the control has a minimum size.
+               self._minSizerWidth = self._minSizerHeight = 100
 
                dcm.dControlMixin.__init__(self, preClass, parent, properties, 
attProperties, *args, **kwargs)
 
@@ -494,6 +496,9 @@
                if not self:
                        # The object may have already been released.
                        return
+               self.SetMinSize((self.MinSizerWidth, self.MinSizerHeight))
+               for kid in self.Children:
+                       kid.SetMinSize((self.MinSizerWidth, 
self.MinSizerHeight))
                self.Layout()
 
 
@@ -650,6 +655,26 @@
                        self._properties["ExpandContent"] = val
 
 
+       def _getMinSizerHeight(self):
+               return self._minSizerHeight
+
+       def _setMinSizerHeight(self, val):
+               if self._constructed():
+                       self._minSizerHeight = val
+               else:
+                       self._properties["MinSizerHeight"] = val
+
+
+       def _getMinSizerWidth(self):
+               return self._minSizerWidth
+
+       def _setMinSizerWidth(self, val):
+               if self._constructed():
+                       self._minSizerWidth = val
+               else:
+                       self._properties["MinSizerWidth"] = val
+
+
        def _getPanelClass(self):
                try:
                        return self._panelClass
@@ -731,6 +756,12 @@
                        _("""When True, the panels size themselves to the size 
of this object.
                        Otherwise, panels only take up as much space as they 
need. (default=True) (bool)"""))
 
+       MinSizerHeight = property(_getMinSizerHeight, _setMinSizerHeight, None,
+                       _("Minimum height for the control. Default=100px  
(int)"))
+
+       MinSizerWidth = property(_getMinSizerWidth, _setMinSizerWidth, None,
+                       _("Minimum width for the control. Default=100px  
(int)"))
+
        PanelClass = property(_getPanelClass, _setPanelClass, None,
                        _("""Specifies the class of control to use for panels 
by default. (dSlidePanel)
                        This really only applies when using the PanelCount 
property to set the



_______________________________________________
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