dabo Commit
Revision 6939
Date: 2011-10-27 14:44:53 -0700 (Thu, 27 Oct 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6939

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

Log:
Added RowNavigationEvent which gets fired as the user is navigating dForm
with next(), prior(), etc. as when pressing the left/right arrows on the
datanav toolbar. RowNumChanged only fires after the navigation is complete.

Refactored setStatusText() method to allow sending the 'immediate' argument
to avoid the callAfter in _setStatusText.

During RowNavigation, set the status text with the current record text
so the user has some default feedback that navigation is working.
 


Diff:
Modified: trunk/dabo/dEvents.py
===================================================================
--- trunk/dabo/dEvents.py       2011-10-27 18:39:04 UTC (rev 6938)
+++ trunk/dabo/dEvents.py       2011-10-27 21:44:53 UTC (rev 6939)
@@ -585,10 +585,22 @@
 
 
 class RowNumChanged(DataEvent):
-       """Occurs when the cursor's row number has changed."""
+       """Occurs when the RowNumber of the PrimaryBizobj of the dForm has 
changed."""
        pass
 
+class RowNavigation(DataEvent):
+       """Occurs when the PrimaryBizobj of the dForm is being navigated.
 
+       As the user is rapidly calling dForm.next(), .prior(), etc., 
RowNavigation
+       events get raised. Your code should do some quick display updates to 
indicate
+       to the user that the record is changing, but the child bizobj's won't 
be 
+       requeried until after the navigation has ended.
+
+       See also RowNumChanged, which only occurs after the user has settled on 
a
+       record and has stopped navigating.
+       """
+       pass
+
 class SashDoubleClick(SashEvent):
        """Occurs when a user double-clicks on the sash of a splitter window."""
        pass
@@ -1024,4 +1036,4 @@
 
 class ShellCommandRun(dEvent):
        """Occurs when the dShell interpreter executes a command."""
-       pass
\ No newline at end of file
+       pass

Modified: trunk/dabo/ui/uiwx/dForm.py
===================================================================
--- trunk/dabo/ui/uiwx/dForm.py 2011-10-27 18:39:04 UTC (rev 6938)
+++ trunk/dabo/ui/uiwx/dForm.py 2011-10-27 21:44:53 UTC (rev 6939)
@@ -297,13 +297,19 @@
                else:
                        if biz.RowNumber != oldRowNum:
                                
dabo.ui.callAfterInterval(self._afterPointerMoveUpdate, self.DataUpdateDelay, 
biz)
-                               self.afterPointerMove()  ## purposely putting 
it here before the update
+                               self._afterPointerMove()  ## purposely putting 
it here before the update
+                               self.raiseEvent(dEvents.RowNavigation, biz=biz)
                        else:
                                biz.RequeryChildrenOnNavigate = 
self.__oldChildRequery
                                self.__oldChildRequery = None
                return True
 
 
+       def _afterPointerMove(self):
+               self.setStatusText(self.getCurrentRecordText(), immediate=True)
+               self.afterPointerMove()
+
+
        def first(self, dataSource=None):
                """Ask the bizobj to move to the first record."""
                self.dataSourceParameter = dataSource

Modified: trunk/dabo/ui/uiwx/dFormMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dFormMixin.py    2011-10-27 18:39:04 UTC (rev 6938)
+++ trunk/dabo/ui/uiwx/dFormMixin.py    2011-10-27 21:44:53 UTC (rev 6939)
@@ -581,9 +581,9 @@
                                        app.setUserSetting("%s.height" % name, 
height)
 
 
-       def setStatusText(self, *args):
-               """Moved functionality to the StatusText property setter."""
-               self._setStatusText(*args)
+       def setStatusText(self, val, immediate=False):
+               """Set the status text to val."""
+               self._setStatusText(val, not immediate)
 
 
        def layout(self):



_______________________________________________
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