commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8798 - trunk/gnue-forms/src


From: reinhard
Subject: [gnue] r8798 - trunk/gnue-forms/src
Date: Mon, 16 Oct 2006 09:13:00 -0500 (CDT)

Author: reinhard
Date: 2006-10-16 09:12:59 -0500 (Mon, 16 Oct 2006)
New Revision: 8798

Modified:
   trunk/gnue-forms/src/GFForm.py
   trunk/gnue-forms/src/GFInstance.py
Log:
Started Cleanup of focus functions.


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2006-10-16 13:26:43 UTC (rev 8797)
+++ trunk/gnue-forms/src/GFForm.py      2006-10-16 14:12:59 UTC (rev 8798)
@@ -746,20 +746,17 @@
     # Move the focus to the next entry
     # -------------------------------------------------------------------------
 
-    def nextEntry(self, reverse=False, first=False, onlyInBlock=False):
+    def next_entry(self, reverse=False):
         """
         Called whenever an event source has requested that the focus change
         to the next data entry object.
         @param reverse: boolean, step focus in reverse direction?
-        @param first: boolean, change focus to the first entry in the block?
-        @param onlyInBlock: boolean, can jump out of block to next block?
         """
         currentBlock = self._currentBlock
         mode = self.getCurrentMode()
 
         if currentBlock is None or ( \
             currentBlock.transparent and not ( \
-              onlyInBlock or \
               currentBlock.autoNextRecord and not ( \
                   currentBlock.is_empty() or \
                   (not reverse and currentBlock.is_last_record() and \
@@ -787,10 +784,6 @@
             if stayInBlock and \
                (currentBlock.name != object.block):
               continue
-            # If we only wanted the first navigable field in the block, then 
return
-            if first:
-              nextEntry = object
-              break
 
             # Put the first field as the next to rollover
             if nextEntry == None:
@@ -862,12 +855,12 @@
     # Move the focus to the previous entry
     # -------------------------------------------------------------------------
 
-    def previousEntry(self):
+    def previous_entry(self):
         """
         Called whenever an event source has requested that the focus change
         to the previous data entry object.
         """
-        self.nextEntry(reverse=True)
+        self.next_entry(reverse=True)
 
 
     # ------------------------------------------------------------------------
@@ -932,13 +925,7 @@
 
         entry = self.findFocus(object)
         if entry:
-            old_page = self._currentPage
-            if self._currentEntry is not None:
-                self._currentEntry.ui_focus_out()
             self.changeFocus(entry)
-            if self._currentPage != old_page:
-                self.dispatchEvent('gotoPAGE', self._currentPage, _form=self);
-            self._currentEntry.ui_focus_in()
 
 
     # -------------------------------------------------------------------------
@@ -1003,17 +990,34 @@
         else:
             return 'new'
 
+
     # -------------------------------------------------------------------------
     # Changes to the requested entry object requested by an event source
     # -------------------------------------------------------------------------
 
     def changeFocus(self, widget):
         """
-        Changes focus to the requested entry object.
+        Changes focus to the requested entry object on GF and UI layer.
 
-        This function only handles the GF layer and does no changes on the UI
-        layer.
+        @param widget: entry to put focus on
+        """
+        old_page = self._currentPage
+        if self._currentEntry is not None:
+            self._currentEntry.ui_focus_out()
+        self.move_focus(widget)
+        if self._currentPage != old_page:
+            self.dispatchEvent('gotoPAGE', self._currentPage, _form=self);
+        self._currentEntry.ui_focus_in()
 
+
+    # -------------------------------------------------------------------------
+    # Changes to the requested entry object requested by an event source
+    # -------------------------------------------------------------------------
+
+    def move_focus(self, widget):
+        """
+        Changes focus to the requested entry object on GF layer.
+
         @param widget: entry to put focus on
         """
 

Modified: trunk/gnue-forms/src/GFInstance.py
===================================================================
--- trunk/gnue-forms/src/GFInstance.py  2006-10-16 13:26:43 UTC (rev 8797)
+++ trunk/gnue-forms/src/GFInstance.py  2006-10-16 14:12:59 UTC (rev 8798)
@@ -448,12 +448,8 @@
       if not event.data.is_navigable (event._form.getCurrentMode ()):
         return False
 
-      event._form._currentEntry.ui_focus_out()
+      event._form.move_focus(event.data)
 
-      event._form.changeFocus(event.data)
-
-      event._form._currentEntry.ui_focus_in()
-
       event._form.beginEditing()
 
       event._form.update_record_status()
@@ -483,7 +479,7 @@
     # If the trigger changed focus, no need in us doing it too...
     if origEntry == event._form._currentEntry:
       event._form._currentEntry.ui_focus_out()
-      event._form.nextEntry()
+      event._form.next_entry()
       event._form._currentEntry.ui_focus_in()
       event._form.beginEditing()
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]