dabo Commit
Revision 6568
Date: 2011-04-18 11:25:39 -0700 (Mon, 18 Apr 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6568

Changed:
U   trunk/dabo/ui/uiwx/dPageFrameMixin.py
U   trunk/dabo/ui/uiwx/dPemMixin.py

Log:
The paged controls gained the UpdateInactivePages property
allowing to limit propagation of update event to active pages only.

Diff:
Modified: trunk/dabo/ui/uiwx/dPageFrameMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPageFrameMixin.py       2011-04-18 16:22:37 UTC (rev 
6567)
+++ trunk/dabo/ui/uiwx/dPageFrameMixin.py       2011-04-18 18:25:39 UTC (rev 
6568)
@@ -410,7 +410,14 @@
                        raise ValueError(_("The only possible values are 'Top', 
'Left', 'Right', and 'Bottom'"))
 
 
-       # Property definitions:
+       def _getUpdateInactivePages(self):
+               return getattr(self, "_updateInactivePages", True)
+
+       def _setUpdateInactivePages(self, val):
+               self._updateInactivePages = val
+
+
+               # Property definitions:
        PageClass = property(_getPageClass, _setPageClass, None,
                        _("""Specifies the class of control to use for pages by 
default. (classRef)
                        This really only applies when using the PageCount 
property to set the
@@ -444,9 +451,15 @@
                                Right
                                Bottom""") )
 
+       UpdateInactivePages = property(_getUpdateInactivePages, 
_setUpdateInactivePages, None,
+                       _("""Determines if the inactive pages are updated too. 
(bool)
+                       Setting it to False can significantly improve update 
performance
+                       of multipage forms. Default=True."""))
 
+
        DynamicPageClass = makeDynamicProperty(PageClass)
        DynamicPageCount = makeDynamicProperty(PageCount)
        DynamicSelectedPage = makeDynamicProperty(SelectedPage)
        DynamicSelectedPageNumber = makeDynamicProperty(SelectedPageNumber)
        DynamicTabPosition = makeDynamicProperty(TabPosition)
+       DynamicUpdateInactivePages = makeDynamicProperty(UpdateInactivePages)

Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py     2011-04-18 16:22:37 UTC (rev 6567)
+++ trunk/dabo/ui/uiwx/dPemMixin.py     2011-04-18 18:25:39 UTC (rev 6568)
@@ -1307,7 +1307,12 @@
                """Update any dynamic properties, and then call the update() 
hook."""
                if isinstance(self, dabo.ui.deadObject) or not 
self._constructed():
                        return
-               if not self.Visible and not isinstance(self.Parent, 
dabo.ui.dPageFrameMixin):
+               # Check paged controls event propagation to inactive pages.
+               try:
+                       updateInactive = self.Parent.UpdateInactivePages
+               except AttributeError:
+                       updateInactive = False
+               if not self.Visible and not updateInactive:
                        ## (on Windows and Mac, inactive pages will return 
Visible==False, but
                        ##  we need those pages updated too).
                        return



_______________________________________________
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