dabo Commit
Revision 6032
Date: 2010-09-22 18:59:11 -0700 (Wed, 22 Sep 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6032

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

Log:
Updated the cyclePages() method to use more efficient code.


Diff:
Modified: trunk/dabo/ui/uiwx/dPageFrameMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPageFrameMixin.py       2010-09-23 01:53:04 UTC (rev 
6031)
+++ trunk/dabo/ui/uiwx/dPageFrameMixin.py       2010-09-23 01:59:11 UTC (rev 
6032)
@@ -250,13 +250,7 @@
                around the ends. Negative values move to previous pages; 
positive
                move through the next pages.
                """
-               fwd = num > 0
-               self.lockDisplay()
-               numToMove = abs(num)
-               while numToMove:
-                       self.AdvanceSelection(fwd)
-                       numToMove -= 1
-               self.unlockDisplay()
+               self.SelectedPageNumber = (self.SelectedPageNumber + num) % 
self.PageCount
 
 
        def layout(self):
@@ -327,7 +321,7 @@
                        self._properties["PageCount"] = val
 
 
-       def _getPgs(self):
+       def _getPages(self):
                ## pkm: It is possible for pages to not be instances of dPage
                ##      (such as in the AppWizard), resulting in self.PageCount 
> len(self.Pages)
                ##      if using the commented code below.
@@ -418,7 +412,7 @@
                        When using this to increase the number of pages, 
PageClass
                        will be queried as the object to use as the page 
object.""") )
 
-       Pages = property(_getPgs, None, None,
+       Pages = property(_getPages, None, None,
                        _("Returns a list of the contained pages.  (list)") )
 
        PageSizerClass = property(_getPageSizerClass, _setPageSizerClass, None,



_______________________________________________
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