commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r8682 - trunk/gnue-forms/src/GFObjects


From: reinhard
Subject: [gnue] r8682 - trunk/gnue-forms/src/GFObjects
Date: Wed, 13 Sep 2006 16:42:08 -0500 (CDT)

Author: reinhard
Date: 2006-09-13 16:42:07 -0500 (Wed, 13 Sep 2006)
New Revision: 8682

Modified:
   trunk/gnue-forms/src/GFObjects/GFBlock.py
Log:
More logical function names and docstrings to reflect a better understanding of
the role of the focus triggers.


Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFBlock.py   2006-09-13 20:24:24 UTC (rev 
8681)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py   2006-09-13 21:42:07 UTC (rev 
8682)
@@ -1106,33 +1106,24 @@
   def __focus_in(self):
 
         if self._form.get_focus_block() is self:
-            self.pre_focus_in()
-            self.post_focus_in()
+            self.focus_in()
 
   # ---------------------------------------------------------------------------
 
   def __focus_out(self):
 
         if self._form.get_focus_block() is self:
-            self.pre_focus_out()
-            self.post_focus_out()
+            self.validate()
+            self.focus_out()
 
   # ---------------------------------------------------------------------------
 
-  def pre_focus_in(self):
+  def focus_in(self):
         """
-        Notify the block that it is going to receive the focus.
-        """
-
-        self.processTrigger('PRE-FOCUSIN')
-
-  # ---------------------------------------------------------------------------
-
-  def post_focus_in(self):
-        """
         Notify the block that it has received the focus.
         """
 
+        self.processTrigger('PRE-FOCUSIN')
         self.processTrigger('POST-FOCUSIN')
 
         self._form.update_record_counter()
@@ -1140,9 +1131,13 @@
 
   # ---------------------------------------------------------------------------
 
-  def pre_focus_out(self):
+  def validate(self):
         """
-        Notify the block that it is going to lose the focus.
+        Validate the block to decide whether the focus can be moved away from
+        it.
+
+        This function can raise an exception, in which case the focus change
+        will be prevented.
         """
 
         self.processTrigger('PRE-FOCUSOUT')
@@ -1152,9 +1147,12 @@
 
   # ---------------------------------------------------------------------------
 
-  def post_focus_out(self):
+  def focus_out(self):
         """
-        Notify the block that it has lost the focus.
+        Notify the block that it is going to lose the focus.
+
+        The focus change is already decided at this moment, there is no way to
+        stop the focus from changing now.
         """
 
         self.processTrigger('POST-FOCUSOUT')





reply via email to

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