commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r8776 - in trunk/gnue-forms/src: . GFObjects


From: reinhard
Subject: [gnue] r8776 - in trunk/gnue-forms/src: . GFObjects
Date: Thu, 12 Oct 2006 16:25:38 -0500 (CDT)

Author: reinhard
Date: 2006-10-12 16:25:37 -0500 (Thu, 12 Oct 2006)
New Revision: 8776

Modified:
   trunk/gnue-forms/src/GFForm.py
   trunk/gnue-forms/src/GFObjects/GFBlock.py
   trunk/gnue-forms/src/GFObjects/GFTabStop.py
Log:
Be smarter about when the UI focus has to be adjusted.


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2006-10-12 21:11:24 UTC (rev 8775)
+++ trunk/gnue-forms/src/GFForm.py      2006-10-12 21:25:37 UTC (rev 8776)
@@ -890,12 +890,6 @@
         widget or to a different row within the same widget.
         """
 
-        # FIXME: Find out where this comes from and remove the calls!
-        if self._currentEntry == self.__last_focus_object \
-                and self._currentEntry._visibleIndex == 
self.__last_focus_index:
-            print "adjust_ui_focus wouldn't be needed"
-            return
-
         if self.__last_focus_object:
             self.__last_focus_object.uiWidget._ui_lose_focus_(
                     self.__last_focus_index)
@@ -918,7 +912,15 @@
         """
         return self._currentBlock
 
+    # -------------------------------------------------------------------------
 
+    def get_focus_object(self):
+        """
+        Return the block that currently has the focus.
+        """
+        return self._currentEntry
+
+
     # =========================================================================
     # Events
     #
@@ -1121,7 +1123,6 @@
 
         self.status_message(u_('Enter your query criteria.'))
 
-        self.adjust_ui_focus()
         self.beginEditing()
         self.update_status()
 
@@ -1151,7 +1152,6 @@
 
         self.status_message(u_('Enter your query criteria.'))
 
-        self.adjust_ui_focus()
         self.beginEditing()
         self.update_status()
 
@@ -1171,7 +1171,6 @@
 
         self.status_message(u_('Query canceled.'))
 
-        self.adjust_ui_focus()
         self.beginEditing()
         self.update_status()
 
@@ -1207,7 +1206,6 @@
             else:
                 self.status_message (u_('Query successful.'))
 
-            self.adjust_ui_focus()
             self.beginEditing()
             self.update_record_counter()
             self.update_record_status()
@@ -1230,7 +1228,6 @@
         finally:
             self.update_record_counter()
             self.update_record_status()
-            self.adjust_ui_focus()
             self.beginEditing()
 
     # -------------------------------------------------------------------------
@@ -1307,7 +1304,6 @@
 
         self.update_record_counter()
         self.update_record_status()
-        self.adjust_ui_focus()
         self.beginEditing()
 
     # -------------------------------------------------------------------------

Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFBlock.py   2006-10-12 21:11:24 UTC (rev 
8775)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py   2006-10-12 21:25:37 UTC (rev 
8776)
@@ -368,10 +368,6 @@
 
         if self.__visibleStart + self._rows < self._currentRecord + 1:
             self.__switch_record(None, False)
-            # Now we must jump to the new current widget in the UI
-            entry = self._form._currentEntry
-            if getattr(entry, '_block', None) == self:
-                self._form.adjust_ui_focus()
         else:
             self.__adjust_scrollbars()
 
@@ -423,10 +419,7 @@
         if jumped:
             self.__new_current_record()
 
-        if getattr(self._form._currentEntry, '_block', None) == self:
-            self._form.adjust_ui_focus()
 
-
   # ---------------------------------------------------------------------------
   # Field access
   # ---------------------------------------------------------------------------
@@ -1068,7 +1061,6 @@
 
         if self._form.get_focus_block() is self:
             self.focus_in()
-            self._form.adjust_ui_focus()
 
         self._form.beginEditing()
 

Modified: trunk/gnue-forms/src/GFObjects/GFTabStop.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFTabStop.py 2006-10-12 21:11:24 UTC (rev 
8775)
+++ trunk/gnue-forms/src/GFObjects/GFTabStop.py 2006-10-12 21:25:37 UTC (rev 
8776)
@@ -209,7 +209,12 @@
             if isinstance(self, GFFieldBound) and refresh_start is not None:
                 self.refresh_ui(refresh_start, self._rows - 1)
 
+            # If this was the currently focused widget, move the focus along
+            if self._visibleIndex != old_visible_index \
+                    and self._form.get_focus_object() is self:
+                self._form.adjust_ui_focus()
 
+
 # =============================================================================
 # Base class for all widgets bound to a field
 # =============================================================================





reply via email to

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