Author: reinhard Date: 2010-09-23 09:49:44 -0500 (Thu, 23 Sep 2010) New Revision: 10195
Modified: trunk/gnue-forms/ trunk/gnue-forms/src/GFObjects/GFBlock.py Log: Introduced On-RecordActivated trigger for blocks, which is called whenever the current record of the block changes. Property changes on: trunk/gnue-forms ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2010-09-09 15:40:08.762000084 +0200 committer: Reinhard Müller <reinhard.muel...@bytewise.at> properties: branch-nick: forms + timestamp: 2010-09-23 16:47:53.023999929 +0200 committer: Reinhard Müller <reinhard.muel...@bytewise.at> properties: branch-nick: forms Name: bzr:file-ids - src/uidrivers/wx/widgets/entry.py 10...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2Fuidrivers%2Fwx%2Fwidgets%2Fentry.py + src/GFObjects/GFBlock.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2FGFBlock.py Name: bzr:revision-id:v4 - 3116 reinhard.muel...@bytewise.at-20100426083500-vtmq0qvd7htz02zx 3117 reinhard.muel...@bytewise.at-20100512151744-2jx8tmtop30kl5n0 3118 reinhard.muel...@bytewise.at-20100705094014-ks9yv7b8gs6ychrb 3119 reinhard.muel...@bytewise.at-20100706085143-hyxadj30ayg28jpx 3120 reinhard.muel...@bytewise.at-20100706140804-sn3npws1ykm81ubx 3121 reinhard.muel...@bytewise.at-20100909134008-5p7jq048nkutldse + 3116 reinhard.muel...@bytewise.at-20100426083500-vtmq0qvd7htz02zx 3117 reinhard.muel...@bytewise.at-20100512151744-2jx8tmtop30kl5n0 3118 reinhard.muel...@bytewise.at-20100705094014-ks9yv7b8gs6ychrb 3119 reinhard.muel...@bytewise.at-20100706085143-hyxadj30ayg28jpx 3120 reinhard.muel...@bytewise.at-20100706140804-sn3npws1ykm81ubx 3121 reinhard.muel...@bytewise.at-20100909134008-5p7jq048nkutldse 3122 reinhard.muel...@bytewise.at-20100923144753-e8hthxho7n5mwg9z Name: bzr:text-parents - src/uidrivers/wx/widgets/entry.py svn-v3-single1-dHJ1bmsvZ251ZS1mb3Jtcw..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:10116 + src/GFObjects/GFBlock.py reinhard.muel...@bytewise.at-20100706085143-hyxadj30ayg28jpx Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py =================================================================== --- trunk/gnue-forms/src/GFObjects/GFBlock.py 2010-09-09 13:41:41 UTC (rev 10194) +++ trunk/gnue-forms/src/GFObjects/GFBlock.py 2010-09-23 14:49:44 UTC (rev 10195) @@ -151,22 +151,23 @@ # Trigger exposure self._validTriggers = { - 'ON-NEWRECORD': 'On-NewRecord', - 'ON-RECORDLOADED':'On-RecordLoaded', - 'PRE-COMMIT': 'Pre-Commit', - 'POST-COMMIT': 'Post-Commit', - 'PRE-QUERY': 'Pre-Query', - 'POST-QUERY': 'Post-Query', - 'PRE-MODIFY': 'Pre-Modify', - 'PRE-INSERT': 'Pre-Insert', - 'PRE-DELETE': 'Pre-Delete', - 'PRE-UPDATE': 'Pre-Update', - 'PRE-FOCUSIN': 'Pre-FocusIn', - 'POST-FOCUSIN': 'Post-FocusIn', - 'PRE-FOCUSOUT': 'Pre-FocusOut', - 'POST-FOCUSOUT': 'Post-FocusOut', - 'PRE-CHANGE': 'Pre-Change', - 'POST-CHANGE': 'Post-Change'} + 'ON-NEWRECORD': 'On-NewRecord', + 'ON-RECORDLOADED': 'On-RecordLoaded', + 'ON-RECORDACTIVATED':'On-RecordActivated', + 'PRE-COMMIT': 'Pre-Commit', + 'POST-COMMIT': 'Post-Commit', + 'PRE-QUERY': 'Pre-Query', + 'POST-QUERY': 'Post-Query', + 'PRE-MODIFY': 'Pre-Modify', + 'PRE-INSERT': 'Pre-Insert', + 'PRE-DELETE': 'Pre-Delete', + 'PRE-UPDATE': 'Pre-Update', + 'PRE-FOCUSIN': 'Pre-FocusIn', + 'POST-FOCUSIN': 'Post-FocusIn', + 'PRE-FOCUSOUT': 'Pre-FocusOut', + 'POST-FOCUSOUT': 'Post-FocusOut', + 'PRE-CHANGE': 'Pre-Change', + 'POST-CHANGE': 'Post-Change'} self._triggerGlobal = True self._triggerFunctions = { @@ -507,9 +508,9 @@ self.__scrolling_blocked = False # And now scroll the entries - self.__switch_record(position, False) if jumped: self.__new_current_record() + self.__switch_record(position, False) # ------------------------------------------------------------------------- @@ -1472,8 +1473,10 @@ def __current_record_changed(self, refresh_all): + # Call __new_current_record() first so an ON-RECORDACTIVATED trigger + # can update calculated fields before the UI is updated. + self.__new_current_record() self.__switch_record(None, refresh_all) - self.__new_current_record() # ------------------------------------------------------------------------- @@ -1543,6 +1546,9 @@ def __new_current_record(self): + if self.__resultset and self.__resultset.current: + self.processTrigger('ON-RECORDACTIVATED') + for field in self._fieldMap.itervalues(): field._event_new_current_record() _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org http://lists.gnu.org/mailman/listinfo/commit-gnue