dabo Commit
Revision 3644
Date: 2007-11-11 06:53:26 -0800 (Sun, 11 Nov 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3644

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

Log:
Added default size and position for forms. Currently when you run an app for 
the first time, the forms open up much too small, and you need to resize them 
before you can do anything with them. These defaults will at least help ensure 
that a reasonably-sized form is initially displayed.

I left them as simple attributes for now; we can discuss whether these should 
become full Properties, or whether the developer can simply override them if 
needed, since they only come into play once in the lifetime of an app on a 
machine.


Diff:
Modified: trunk/dabo/ui/uiwx/dFormMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dFormMixin.py    2007-11-08 15:45:02 UTC (rev 3643)
+++ trunk/dabo/ui/uiwx/dFormMixin.py    2007-11-11 14:53:26 UTC (rev 3644)
@@ -62,6 +62,12 @@
                self._tempForm = False
                # Transparency level
                self._transparency = None
+               # Defaults for window sizing
+               self._defaultLeft = 50
+               self._defaultTop = 50
+               self._defaultWidth = 600
+               self._defaultHeight = 500
+               self._defaultState = "Normal"
 
                super(dFormMixin, self).__init__(preClass, parent, properties, 
                                attProperties, *args, **kwargs)
@@ -415,11 +421,11 @@
                """
                if self.Application and self.SaveRestorePosition:
                        name = self.getAbsoluteName()
-                       left = self.Application.getUserSetting("%s.left" % name)
-                       top = self.Application.getUserSetting("%s.top" % name)
-                       width = self.Application.getUserSetting("%s.width" % 
name)
-                       height = self.Application.getUserSetting("%s.height" % 
name)
-                       state = 
self.Application.getUserSetting("%s.windowstate" % name)
+                       left = self.Application.getUserSetting("%s.left" % 
name, self._defaultLeft)
+                       top = self.Application.getUserSetting("%s.top" % name, 
self._defaultTop)
+                       width = self.Application.getUserSetting("%s.width" % 
name, self._defaultWidth)
+                       height = self.Application.getUserSetting("%s.height" % 
name, self._defaultHeight)
+                       state = 
self.Application.getUserSetting("%s.windowstate" % name, self._defaultState)
 
                        if isinstance(left, int) and isinstance(top, int):
                                self.Position = (left,top)




_______________________________________________
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]

Reply via email to