commit-gnue
[Top][All Lists]
Advanced

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

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


From: reinhard
Subject: [gnue] r9085 - trunk/gnue-forms/src
Date: Tue, 28 Nov 2006 13:34:29 -0600 (CST)

Author: reinhard
Date: 2006-11-28 13:34:29 -0600 (Tue, 28 Nov 2006)
New Revision: 9085

Modified:
   trunk/gnue-forms/src/GFForm.py
Log:
Made it possible to activate pages without a focusable widget.


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2006-11-28 19:13:42 UTC (rev 9084)
+++ trunk/gnue-forms/src/GFForm.py      2006-11-28 19:34:29 UTC (rev 9085)
@@ -1013,6 +1013,9 @@
             new_focus = self.__find_focus(new_list, last)
             if new_focus:
                 return new_focus
+            elif isinstance(object, GFPage):
+                # Allow empty pages to be focused
+                return object
 
         # Nothing found.
         return None
@@ -1046,7 +1049,9 @@
         """
         Changes focus to the requested entry object on GF and UI layer.
 
-        @param widget: entry to put focus on
+        @param widget: entry or page to put focus on. If it is a page, the form
+            changes to that page and does not focus any widget. This is useful
+            to activate a page without a focusable widget on it.
         """
 
         self.endEditing()
@@ -1075,10 +1080,16 @@
 
         assert gDebug(5, "Change focus: %s->%s" % (self._currentEntry, widget))
 
-        if widget is not None:
+        if isinstance(widget, GFTabStop):
+            new_entry = widget
             new_block = widget.get_block()
             new_page = widget._page
+        elif isinstance(widget, GFPage):
+            new_entry = None
+            new_block = None
+            new_page = widget
         else:
+            new_entry = None
             new_block = None
             new_page = self._currentPage
 
@@ -1124,7 +1135,7 @@
             elif row_offset != 0:
                 new_block.jump_records(row_offset)
 
-            self._currentEntry = widget
+            self._currentEntry = new_entry
             self._currentBlock = new_block
             self._currentPage = new_page
 





reply via email to

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