commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r8881 - in trunk/gnue-forms/src: . GFObjects uidrivers/wx26/widge


From: reinhard
Subject: [gnue] r8881 - in trunk/gnue-forms/src: . GFObjects uidrivers/wx26/widgets
Date: Fri, 20 Oct 2006 02:46:54 -0500 (CDT)

Author: reinhard
Date: 2006-10-20 02:46:53 -0500 (Fri, 20 Oct 2006)
New Revision: 8881

Modified:
   trunk/gnue-forms/src/GFForm.py
   trunk/gnue-forms/src/GFObjects/GFTabStop.py
   trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
Log:
Fixed exception handling when switching between grid cells.


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2006-10-20 07:30:29 UTC (rev 8880)
+++ trunk/gnue-forms/src/GFForm.py      2006-10-20 07:46:53 UTC (rev 8881)
@@ -853,13 +853,13 @@
           # If we should navigate to the next record, do it...
           if currentBlock is not None \
                   and reverse and not currentBlock.is_first_record():
-            self.changeFocus(nextEntry, -1)
+            self.change_focus(nextEntry, -1)
           elif currentBlock is not None and not reverse and \
              currentBlock.autoNextRecord and \
              not currentBlock.is_empty() and \
              not (not currentBlock.autoCreate and \
                   currentBlock.is_last_record()):
-               self.changeFocus(nextEntry, +1)
+               self.change_focus(nextEntry, +1)
 
           # Otherwise, are we transparent? If so, go to next block/page
           elif (currentBlock is None or currentBlock.transparent) and \
@@ -883,10 +883,10 @@
                 dest = self._layout._pageList[0]
               self.findAndChangeFocus(dest)
           else:
-            self.changeFocus(nextEntry, 0)
+            self.change_focus(nextEntry, 0)
 
         else:
-          self.changeFocus(nextEntry, 0)
+          self.change_focus(nextEntry, 0)
 
     # -------------------------------------------------------------------------
 
@@ -983,7 +983,7 @@
 
         entry = self.findFocus(object)
         if entry:
-            self.changeFocus(entry, 0)
+            self.change_focus(entry, 0)
 
 
     # -------------------------------------------------------------------------
@@ -1053,7 +1053,7 @@
     # Changes to the requested entry object requested by an event source
     # -------------------------------------------------------------------------
 
-    def changeFocus(self, widget, row_offset):
+    def change_focus(self, widget, row_offset):
         """
         Changes focus to the requested entry object on GF and UI layer.
 

Modified: trunk/gnue-forms/src/GFObjects/GFTabStop.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFTabStop.py 2006-10-20 07:30:29 UTC (rev 
8880)
+++ trunk/gnue-forms/src/GFObjects/GFTabStop.py 2006-10-20 07:46:53 UTC (rev 
8881)
@@ -257,6 +257,18 @@
 
 
     # -------------------------------------------------------------------------
+    # Change the focus to this object
+    # -------------------------------------------------------------------------
+
+    def set_focus(self, index):
+        """
+        Move the UI and GF focus to this object.
+        """
+
+        self._form.change_focus(self, index - self._visibleIndex)
+
+
+    # -------------------------------------------------------------------------
     # Focus handling
     # -------------------------------------------------------------------------
 

Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-10-20 
07:30:29 UTC (rev 8880)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-10-20 
07:46:53 UTC (rev 8881)
@@ -230,13 +230,12 @@
 
             if other == label:
                 if item.IsEnabled():
-                    # This replaces the label with the actual entry and sets
-                    # the focus on the entry
-                    self._ui_focus_in_(self.widgets.index(item))
-                    self._ui_set_focus_(self.widgets.index(item))
+                    # the UI focus is not on the entry yet (actually it's not
+                    # even visible yet), so we have to move the focus on both
+                    # the UI and GF level.
+                    self._gfObject.set_focus(self.widgets.index(item))
+                return
 
-                break
-
         event.Skip()
 
     # -------------------------------------------------------------------------





reply via email to

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