dabo Commit
Revision 3616
Date: 2007-11-02 12:00:31 -0700 (Fri, 02 Nov 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3616

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

Log:
My last fix resulted in the showing of the dialog not being too smooth. This one
centers and sizes the dialog before being shown, and then does it again after
being shown. Solves the initial problem while not ruining the experience for 
others.


Diff:
Modified: trunk/dabo/ui/uiwx/dDialog.py
===================================================================
--- trunk/dabo/ui/uiwx/dDialog.py       2007-11-02 18:51:01 UTC (rev 3615)
+++ trunk/dabo/ui/uiwx/dDialog.py       2007-11-02 19:00:31 UTC (rev 3616)
@@ -70,11 +70,20 @@
                self.show()
 
 
-       def show(self):
+       def _afterShow(self):
                if self.AutoSize:
-                       wx.CallAfter(self.Fit)
+                       self.Fit()
                if self.Centered:
-                       wx.CallAfter(self.Centre)
+                       self.Centre()
+
+
+       def show(self):
+               # Call _afterShow() once immediately, and then once after the 
dialog is visible, which
+               # will correct minor mistakes such as the height of wordwrapped 
labels not being 
+               # accounted for. If we only called it after the dialog was 
already shown, then we
+               # risk the dialog being too jumpy.
+               self._afterShow()
+               dabo.ui.callAfter(self._afterShow)
                retVals = {wx.ID_OK : kons.DLG_OK, 
                                wx.ID_CANCEL : kons.DLG_CANCEL}
                if self.Modal:




_______________________________________________
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