[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue common/src/GTrigger.py forms/samples/hello...
From: |
James Thompson |
Subject: |
gnue common/src/GTrigger.py forms/samples/hello... |
Date: |
Fri, 01 Feb 2002 00:38:01 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: James Thompson <address@hidden> 02/02/01 00:38:01
Modified files:
common/src : GTrigger.py
forms/samples : helloworld2.gfd
forms/src : GFForm.py
Log message:
helloworld demo working again
forgot to uncomment __len__ in last commit
a little playing arround with a global setFocus trigger function (not
working)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GTrigger.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/samples/helloworld2.gfd.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFForm.py.diff?tr1=1.144&tr2=1.145&r1=text&r2=text
Patches:
Index: gnue/common/src/GTrigger.py
diff -c gnue/common/src/GTrigger.py:1.8 gnue/common/src/GTrigger.py:1.9
*** gnue/common/src/GTrigger.py:1.8 Fri Feb 1 00:07:14 2002
--- gnue/common/src/GTrigger.py Fri Feb 1 00:38:01 2002
***************
*** 41,46 ****
--- 41,55 ----
def __init__(self, msg):
self.msg = msg
+
+ class TriggerAbort:
+ pass
+ class TriggerStop:
+ pass
+ class TriggerSuccess:
+ pass
+
+
#######################################################################
***************
*** 233,247 ****
return 1
def __nonzero__(self):
return 1
! #
! # Needed but causing issues (local namespace setup bad?)
! #
! # def __len__(self):
! # string = "%s" % self
! # return len(string)
#
# __getitem__
--- 242,263 ----
return 1
+ #
+ # __nonzero__
+ #
+ # Needed to make __len__ function below play nice
+ #
def __nonzero__(self):
return 1
! #
! # __len__
! #
! # Implements len() support
! #
! def __len__(self):
! string = "%s" % self
! return len(string)
#
# __getitem__
***************
*** 315,321 ****
# Classes in here are used to represent the triggers defined in
# <trigger> tags in an xml file
#
!
#
# A list of all valid triggers, and their "pretty" names
--- 331,340 ----
# Classes in here are used to represent the triggers defined in
# <trigger> tags in an xml file
#
! #
! # Note: this is a partial graft of the old GFTrigger system
! # only here so that the new namespace code could be
! # put to use right away
#
# A list of all valid triggers, and their "pretty" names
***************
*** 532,551 ****
else:
xmlString += "/>\n"
return xmlString
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- 551,556 ----
Index: gnue/forms/samples/helloworld2.gfd
diff -c gnue/forms/samples/helloworld2.gfd:1.9
gnue/forms/samples/helloworld2.gfd:1.10
*** gnue/forms/samples/helloworld2.gfd:1.9 Thu Jan 31 21:25:51 2002
--- gnue/forms/samples/helloworld2.gfd Fri Feb 1 00:38:01 2002
***************
*** 39,59 ****
<trigger type="PRE-FOCUSOUT" name="Trigger_2">
from string import lower
! print lower
! print login.user[:1]
! print lower("FOOOOO")
!
!
! foo = login.user
! bar = address.name
!
! print type(foo)
! print type(bar)
!
! if foo != bar:
print "ERROR! First 3 letters of user name MUST"
print " match first three letters of full name."
! login.user="Foo"
print "User name updated to \"%s\"" % login.user</trigger>
</entry>
<entry x="1" y="9" value="Type Here" field="pass" name="password"
--- 39,48 ----
<trigger type="PRE-FOCUSOUT" name="Trigger_2">
from string import lower
! if lower(login.user[:3]) != lower(address.name[:3]):
print "ERROR! First 3 letters of user name MUST"
print " match first three letters of full name."
! login.user=""
print "User name updated to \"%s\"" % login.user</trigger>
</entry>
<entry x="1" y="9" value="Type Here" field="pass" name="password"
Index: gnue/forms/src/GFForm.py
diff -c gnue/forms/src/GFForm.py:1.144 gnue/forms/src/GFForm.py:1.145
*** gnue/forms/src/GFForm.py:1.144 Fri Feb 1 00:07:14 2002
--- gnue/forms/src/GFForm.py Fri Feb 1 00:38:01 2002
***************
*** 422,434 ****
# changes to the requested entry object requested by
# an event source
#
! def changeFocus(self, widget):
message = None
try:
! self._currentEntry.processTrigger('Pre-FocusOut')
! self._currentEntry.processTrigger('Post-FocusOut')
! widget.processTrigger('Pre-FocusIn')
oldEntry = self._currentEntry
self._currentEntry = widget
--- 422,435 ----
# changes to the requested entry object requested by
# an event source
#
! def changeFocus(self, widget, fireFocusTriggers=1):
message = None
try:
! if fireFocusTriggers:
! self._currentEntry.processTrigger('Pre-FocusOut')
! self._currentEntry.processTrigger('Post-FocusOut')
! widget.processTrigger('Pre-FocusIn')
oldEntry = self._currentEntry
self._currentEntry = widget
***************
*** 436,442 ****
self._app.dispatchEvent(GFEvent('updateENTRY', oldEntry))
! widget.processTrigger('Post-FocusIn')
except TriggerError, t:
message = self.TriggerErrorFunc(t)
return message
--- 437,444 ----
self._app.dispatchEvent(GFEvent('updateENTRY', oldEntry))
! if fireFocusTriggers:
! widget.processTrigger('Post-FocusIn')
except TriggerError, t:
message = self.TriggerErrorFunc(t)
return message
***************
*** 866,869 ****
def triggerSetFocus(self,object):
print "If i was working then %s would now have focus" % object._object
! # self.changeFocus(object._object)
--- 868,871 ----
def triggerSetFocus(self,object):
print "If i was working then %s would now have focus" % object._object
! self.changeFocus(object._object,0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue common/src/GTrigger.py forms/samples/hello...,
James Thompson <=