[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8678 - trunk/gnue-forms/src/GFObjects
From: |
reinhard |
Subject: |
[gnue] r8678 - trunk/gnue-forms/src/GFObjects |
Date: |
Wed, 13 Sep 2006 08:54:17 -0500 (CDT) |
Author: reinhard
Date: 2006-09-13 08:54:16 -0500 (Wed, 13 Sep 2006)
New Revision: 8678
Modified:
trunk/gnue-forms/src/GFObjects/GFBlock.py
Log:
No focusout/focusin for delete/undelete, as the focus remains on the same field
*and* the same record.
Created new functions pre/post-focus-in/out in preparation of focus handling
cleanup.
Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFBlock.py 2006-09-12 14:26:36 UTC (rev
8677)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py 2006-09-13 13:54:16 UTC (rev
8678)
@@ -798,21 +798,9 @@
if self.mode == 'query':
return
- if not self._form.endEditing():
- return
-
- self.__focus_out(do_auto_commit=False)
-
self._resultSet.current.delete()
- self._recordCount = self._resultSet.getRecordCount()
+ self._form.update_record_status()
- self.__focus_in()
-
- self._form.dispatchEvent('gotoENTRY', object=self._form._currentEntry,
- _form=self._form)
-
- self._form.beginEditing()
-
# ---------------------------------------------------------------------------
def undelete_record(self):
@@ -823,22 +811,10 @@
if self.mode == 'query':
return
- if not self._form.endEditing():
- return
-
- self.__focus_out(do_auto_commit=False)
-
self._resultSet.current.undelete()
- self._recordCount = self._resultSet.getRecordCount()
+ self._form.update_record_status()
- self.__focus_in()
- self._form.dispatchEvent('gotoENTRY', object=self._form._currentEntry,
- _form=self._form)
-
- self._form.beginEditing()
-
-
# ---------------------------------------------------------------------------
# Queries
# ---------------------------------------------------------------------------
@@ -986,32 +962,6 @@
# ---------------------------------------------------------------------------
- # Shared code called whenever focus enters or leaves a record
- # ---------------------------------------------------------------------------
-
- def __focus_in(self):
-
- if self._form.get_focus_block() is self:
- self.processTrigger('PRE-FOCUSIN')
-
- self._form.update_record_counter()
- self._form.update_record_status()
-
- self.processTrigger('POST-FOCUSIN')
-
- # ---------------------------------------------------------------------------
-
- def __focus_out(self, do_auto_commit=True):
-
- if self._form.get_focus_block() is self:
- self.processTrigger('PRE-FOCUSOUT')
-
- if do_auto_commit and self.autoCommit and self._resultSet.current:
- self._form.execute_commit()
-
- self.processTrigger('POST-FOCUSOUT')
-
- # ---------------------------------------------------------------------------
# Function and Update
# ---------------------------------------------------------------------------
@@ -1087,7 +1037,70 @@
result.append(add)
return result
+
+
# ---------------------------------------------------------------------------
+ # Shared code called whenever focus enters or leaves a record
+ # ---------------------------------------------------------------------------
+
+ def __focus_in(self):
+
+ if self._form.get_focus_block() is self:
+ self.pre_focus_in()
+ self.post_focus_in()
+
+ # ---------------------------------------------------------------------------
+
+ def __focus_out(self):
+
+ if self._form.get_focus_block() is self:
+ self.pre_focus_out()
+ self.post_focus_out()
+
+ # ---------------------------------------------------------------------------
+
+ def pre_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('POST-FOCUSIN')
+
+ self._form.update_record_counter()
+ self._form.update_record_status()
+
+ # ---------------------------------------------------------------------------
+
+ def pre_focus_out(self):
+ """
+ Notify the block that it is going to lose the focus.
+ """
+
+ self.processTrigger('PRE-FOCUSOUT')
+
+ if self.autoCommit and self._resultSet.current:
+ self._form.execute_commit()
+
+ # ---------------------------------------------------------------------------
+
+ def post_focus_out(self):
+ """
+ Notify the block that it has lost the focus.
+ """
+
+ self.processTrigger('POST-FOCUSOUT')
+
+
+ # ---------------------------------------------------------------------------
# Helper Functions
# ---------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8678 - trunk/gnue-forms/src/GFObjects,
reinhard <=