157 |
'GUI:STATUSBAR:SUPPRESS': 0, |
'GUI:STATUSBAR:SUPPRESS': 0, |
158 |
} |
} |
159 |
|
|
160 |
|
self._in_trigger_lock = 0 |
161 |
|
|
162 |
# |
# |
163 |
# primaryInit |
# primaryInit |
164 |
# |
# |
847 |
# to a specfic entry widget |
# to a specfic entry widget |
848 |
# |
# |
849 |
def triggerSetFocus(self,object): |
def triggerSetFocus(self,object): |
850 |
self.changeFocus(object._object,1) |
# add global focus locking |
851 |
|
if self._in_trigger_lock: |
852 |
|
print "Already called by a trigger" |
853 |
|
return |
854 |
|
|
855 |
|
self._in_trigger_lock = 1 |
856 |
|
|
857 |
|
focus = object._object |
858 |
|
if focus._type=='GFField': |
859 |
|
try: |
860 |
|
focus = focus._entryList[0] |
861 |
|
except KeyError: |
862 |
|
raise "setFocus failed: GFField is not bound to an GFEntry object." |
863 |
|
|
864 |
|
if focus._type != 'GFEntry': |
865 |
|
raise "setFocus failed: Can just switch to GFEntry objects. " +\ |
866 |
|
"You passed a '%s' object." % focus._type |
867 |
|
self.changeFocus(focus,1) |
868 |
self.dispatchEvent('gotoENTRY',object=self._currentEntry,_form=self) |
self.dispatchEvent('gotoENTRY',object=self._currentEntry,_form=self) |
869 |
|
|
870 |
|
self._in_trigger_lock = 0 |
871 |
|
|
872 |
# |
# |
873 |
# allow the trigger to get a handle to |
# allow the trigger to get a handle to |
874 |
# an actual GFEntry object |
# an actual GFEntry object |