dabo Commit
Revision 6050
Date: 2010-10-02 11:08:29 -0700 (Sat, 02 Oct 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6050
Changed:
U trunk/dabo/ui/uiwx/dDialog.py
U trunk/dabo/ui/uiwx/dForm.py
U trunk/dabo/ui/uiwx/dFormMain.py
U trunk/dabo/ui/uiwx/dPemMixin.py
Log:
Suppress update() when the object is invisible; call update() when the
object becomes visible.
Refactor / clean up the Show() methods using super() and doing away with
the unneeded (*args, **kwargs), which is cleaner.
Diff:
Modified: trunk/dabo/ui/uiwx/dDialog.py
===================================================================
--- trunk/dabo/ui/uiwx/dDialog.py 2010-10-02 17:26:01 UTC (rev 6049)
+++ trunk/dabo/ui/uiwx/dDialog.py 2010-10-02 18:08:29 UTC (rev 6050)
@@ -63,14 +63,17 @@
super(dDialog, self)._afterInit()
- def Show(self, show=True, *args, **kwargs):
+ def Show(self, show=True):
self._gtk_show_fix(show)
- wx.Dialog.Show(self, show, *args, **kwargs)
+ return super(dDialog, self).Show(show)
- def ShowModal(self, *args, **kwargs):
+ def ShowModal(self):
self._gtk_show_fix(True)
- return wx.Dialog.ShowModal(self, *args, **kwargs)
+ # updates were potentially suppressed while the dialog
+ # wasn't visible, so update now.
+ self.update()
+ return super(dDialog, self).ShowModal()
def showModal(self):
Modified: trunk/dabo/ui/uiwx/dForm.py
===================================================================
--- trunk/dabo/ui/uiwx/dForm.py 2010-10-02 17:26:01 UTC (rev 6049)
+++ trunk/dabo/ui/uiwx/dForm.py 2010-10-02 18:08:29 UTC (rev 6050)
@@ -939,12 +939,14 @@
dForm.__bases__ = (BaseForm, wx.Frame)
_hackToFrame = classmethod(_hackToFrame)
- def Show(self, show=True, *args, **kwargs):
+ def Show(self, show=True):
self._gtk_show_fix(show)
if self.Modal:
dForm._hackToDialog()
- dForm.__bases__[-1].Show(self, show, *args, **kwargs)
+ #dForm.__bases__[-1].Show(self, show)
+ ret = super(dForm, self).Show(show)
dForm._hackToFrame()
+ return ret
def _getModal(self):
return getattr(self, "_modal", False)
@@ -995,12 +997,13 @@
kwargs["ShowToolBar"] = False
BaseForm.__init__(self, preClass, parent, properties,
attProperties, *args, **kwargs)
- def Show(self, show=True, *args, **kwargs):
+ def Show(self, show=True):
self._gtk_show_fix(show)
- wx.MiniFrame.Show(self, show, *args, **kwargs)
+ ret = super(dToolForm, self).Show(show)
+ #wx.MiniFrame.Show(self, show)
+ return ret
-
class dBorderlessForm(BaseForm, wx.Frame):
def __init__(self, parent=None, properties=None, attProperties=None,
*args, **kwargs):
self._baseClass = dBorderlessForm
@@ -1012,9 +1015,11 @@
preClass = wx.PreFrame
BaseForm.__init__(self, preClass, parent, properties,
attProperties, *args, **kwargs)
- def Show(self, show=True, *args, **kwargs):
+ def Show(self, show=True):
self._gtk_show_fix(show)
- wx.Frame.Show(self, show, *args, **kwargs)
+ ret = super(dBorderlessForm, self).Show(show)
+ #wx.Frame.Show(self, show)
+ return ret
class _dForm_test(dForm):
Modified: trunk/dabo/ui/uiwx/dFormMain.py
===================================================================
--- trunk/dabo/ui/uiwx/dFormMain.py 2010-10-02 17:26:01 UTC (rev 6049)
+++ trunk/dabo/ui/uiwx/dFormMain.py 2010-10-02 18:08:29 UTC (rev 6050)
@@ -51,13 +51,13 @@
dFormMainBase.__init__(self, preClass, parent, properties,
*args, **kwargs)
- def Show(self, show=True, *args, **kwargs):
+ def Show(self, show=True):
self._gtk_show_fix(show)
- dFormMain.__bases__[-1].Show(self, show, *args, **kwargs)
+ #dFormMain.__bases__[-1].Show(self, show)
+ return super(dFormMain, self).Show(show)
-
if __name__ == "__main__":
import test
test.Test().runTest(dFormMain)
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py 2010-10-02 17:26:01 UTC (rev 6049)
+++ trunk/dabo/ui/uiwx/dPemMixin.py 2010-10-02 18:08:29 UTC (rev 6050)
@@ -793,6 +793,15 @@
callback(keyEvent)
+ def Show(self, show=True):
+ ret = super(dPemMixin, self).Show(show)
+ if show and ret:
+ # updates were potentially suppressed while the object
+ # wasn't visible, so update now.
+ self.update()
+ return ret
+
+
def unbindKey(self, keyCombo):
"""Unbind a previously bound key combination.
@@ -1270,7 +1279,8 @@
def __onUpdate(self, evt):
"""Update any dynamic properties, and then call the update()
hook."""
- if isinstance(self, dabo.ui.deadObject) or not
self._constructed():
+ if isinstance(self, dabo.ui.deadObject) or not
self._constructed() \
+ or not self.Visible:
return
self.update()
_______________________________________________
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]