[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnuef/src GFForm.py UIwxpython.py GFObject...
From: |
Jason Cater |
Subject: |
gnue/gnuef/src GFForm.py UIwxpython.py GFObject... |
Date: |
Tue, 20 Nov 2001 21:42:26 -0500 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/11/20 21:42:26
Modified files:
gnuef/src : GFForm.py UIwxpython.py
gnuef/src/GFObjects: GFButton.py
Log message:
fixed for button navigation
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFForm.py.diff?cvsroot=OldCVS&tr1=1.131&tr2=1.132&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/UIwxpython.py.diff?cvsroot=OldCVS&tr1=1.121&tr2=1.122&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFButton.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: gnue/gnuef/src/GFForm.py
diff -u gnue/gnuef/src/GFForm.py:1.131 gnue/gnuef/src/GFForm.py:1.132
--- gnue/gnuef/src/GFForm.py:1.131 Fri Nov 9 00:45:22 2001
+++ gnue/gnuef/src/GFForm.py Tue Nov 20 21:42:25 2001
@@ -42,6 +42,10 @@
import GFParser
import GFTrigger
+# Defines which objects are "Tab Stops"
+TabStops = ('GFEntry','GFButton')
+#TabStops = ('GFEntry',)
+
class GFForm(GFObj, GFEventAware):
def __init__(self, parent=None, app=None):
GFObj.__init__(self, parent)
@@ -152,7 +156,7 @@
if self._currentPage == None:
self._currentPage = object
- elif object.getObjectType() == 'GFEntry' and self._currentEntry == None
and not object.hidden:
+ elif object.getObjectType() in TabStops and self._currentEntry == None and
not object.hidden:
self._currentEntry = object
elif object.getObjectType() =='GFDataSource':
@@ -170,7 +174,7 @@
elif object.getObjectType() == 'GFPage' and self._currentPage == None:
self._currentPage = object
- elif object.getObjectType() == 'GFEntry' and \
+ elif object.getObjectType() in TabStops and \
self._currentEntry == None and \
not object.readonly and \
not object.hidden:
@@ -223,7 +227,7 @@
form = GFParser.loadForm(handle, self._app, initialize=0)
handle.close()
id = 'id'
- if hasattr(object,'name'):
+ if hasattr(object,'name'):
id = 'name'
rv = self.__findImportItem(object, form, id)
@@ -240,7 +244,7 @@
def __findImportItem(self, find, object, id):
if isinstance(object, find._importclass) and \
hasattr(object, id) and \
- object.__dict__[id] == find.__dict__[id]:
+ object.__dict__[id] == find.__dict__[id]:
return object
elif hasattr(object,'_children'):
rv = None
@@ -335,7 +339,7 @@
for block in self._blockList:
GDebug.printMesg(1, "Saving %s"%block.name)
try:
-
+
# This gets lost in the Pre-Commit code
block._precommitRecord = block._currentRecord
@@ -461,7 +465,7 @@
currentvalue = self._currentEntry.getValue()
if ord(value) == 13:
if self._currentEntry.height > 1: value = '\n';
- else:
+ else:
self._app.nextEntry(None)
#self._app.dispatchEvent(GFEvent('requestNEXTENTRY'))
return modified
@@ -547,6 +551,7 @@
# Updated methods for the new gfclient code
#
+
#
# nextEntry
#
@@ -556,22 +561,22 @@
def nextEntry(self):
nextEntry = None
keepNext = 0
- if not self._currentEntry.verifyValue():
+ if not self._currentEntry.verifyValue():
return "Invalid field value"
for object in self._currentEntry._parent._children:
# Put the first field as the next to rollover
- if (object.getObjectType()=='GFEntry' and
+ if (object.getObjectType() in TabStops and
(not object.hidden) and ((not object.readonly) or
self._currentBlock.mode=='query')):
if nextEntry == None:
nextEntry = object
firstEntry = object
-
+
if object == self._currentEntry:
keepNext = 1
continue
-
+
if keepNext == 1:
nextEntry = object
break
@@ -579,18 +584,19 @@
try:
self._currentEntry.processTrigger('Pre-FocusOut')
nextEntry.processTrigger('Pre-FocusIn')
+ prevEntry = self._currentEntry
if self._currentBlock.transparentBlock and nextEntry == firstEntry: #
Jump to the next block if block is tagged as transparent
self.nextBlock()
else:
self._currentEntry = nextEntry
- self._currentEntry.processTrigger('Post-FocusOut')
+ prevEntry.processTrigger('Post-FocusOut')
nextEntry.processTrigger('Post-FocusIn')
except TriggerError, t:
message = self.TriggerErrorFunc(t)
return message
+
-
#
# previousEntry
#
@@ -602,14 +608,16 @@
nextEntry = None
if not self._currentEntry.verifyValue(): return
for object in self._currentEntry._parent._children:
- if object.getObjectType()=='GFEntry' and not object.hidden and (not
object.readonly or self._currentBlock.mode=='query'):
+ if object.getObjectType() in TabStops and \
+ not object.hidden and (not object.readonly or \
+ self._currentBlock.mode=='query'):
nextEntry = object
lastEntry = object
keepNext = 0
for object in self._currentEntry._parent._children:
# Put the first field as the next to rollover
- if object.getObjectType()=='GFEntry' and not object.hidden and not
object.readonly:
+ if object.getObjectType() in TabStops and not object.hidden and not
object.readonly:
if object == self._currentEntry:
break
@@ -621,17 +629,18 @@
self.previousBlock()
# Move to the new last record of the new current block
for object in self._currentEntry._parent._children:
- if object.getObjectType()=='GFEntry' and not object.hidden and (not
object.readonly or self._currentBlock.mode=='query'):
+ if object.getObjectType() in TabStops and \
+ not object.hidden and (not object.readonly or
self._currentBlock.mode=='query'):
nextEntry = object
-
- self._currentEntry = nextEntry
+
self._currentEntry.processTrigger('Post-FocusOut')
- nextEntry.processTrigger('Post-FocusIn')
+ self._currentEntry = nextEntry
+ self._currentEntry.processTrigger('Post-FocusIn')
except TriggerError, t:
print "Got to the exception handler!"
self.TriggerErrorFunc(t)
-
+
#
# nextBlock
@@ -639,14 +648,14 @@
# Called whenever an event source has requested that the
# focus change to the next data entry block
#
- def nextBlock(self):
+ def nextBlock(self):
nextBlock = self._blockList[0]
keepNext = 0
for object in self._blockList:
if object == self._currentBlock:
keepNext = 1
continue
-
+
if keepNext == 1:
nextBlock = object
break
@@ -659,10 +668,10 @@
except TriggerError, t:
print "Got to the exception handler!"
self.TriggerErrorFunc(t)
-
- # reset current entry
+
+ # reset current entry
self._currentEntry = None
- self._currentBlock.walk(self.setFocus)
+ self._currentBlock.walk(self.setFocus)
# set current page
pageWidget = self._currentBlock
@@ -692,10 +701,10 @@
except TriggerError, t:
print "Got to the exception handler!"
self.TriggerErrorFunc(t)
-
- # reset current entry
+
+ # reset current entry
self._currentEntry = None
- self._currentBlock.walk(self.setFocus)
+ self._currentBlock.walk(self.setFocus)
# set current page
pageWidget = self._currentBlock
@@ -717,23 +726,23 @@
# reset current entry
self._currentEntry = None
self._currentBlock.walk(self.setFocus)
-
+
def prevRecord(self):
- if self._currentBlock.mode == 'query':
+ if self._currentBlock.mode == 'query':
GDebug.printMesg(5,'Cannot go to previous record: in query mode!')
- return
+ return
self._currentBlock.prevRecord()
def nextRecord(self):
- if self._currentBlock.mode == 'query':
+ if self._currentBlock.mode == 'query':
GDebug.printMesg(5,'Cannot go to next record: in query mode!')
- return
+ return
self._currentBlock.nextRecord()
def jumpRecord(self,count):
- if self._currentBlock.mode == 'query':
+ if self._currentBlock.mode == 'query':
GDebug.printMesg(5,'Cannot jump to record: in query mode!')
- return
+ return
self._currentBlock.jumpRecord(count)
def toggleInsertMode(self):
Index: gnue/gnuef/src/GFObjects/GFButton.py
diff -u gnue/gnuef/src/GFObjects/GFButton.py:1.3
gnue/gnuef/src/GFObjects/GFButton.py:1.4
--- gnue/gnuef/src/GFObjects/GFButton.py:1.3 Mon Oct 8 08:38:14 2001
+++ gnue/gnuef/src/GFObjects/GFButton.py Tue Nov 20 21:42:25 2001
@@ -41,6 +41,8 @@
self._type = "GFButton"
self.label = ""
+ def verifyValue(self):
+ return 1
Index: gnue/gnuef/src/UIwxpython.py
diff -u gnue/gnuef/src/UIwxpython.py:1.121 gnue/gnuef/src/UIwxpython.py:1.122
--- gnue/gnuef/src/UIwxpython.py:1.121 Sat Nov 17 18:15:25 2001
+++ gnue/gnuef/src/UIwxpython.py Tue Nov 20 21:42:25 2001
@@ -58,10 +58,10 @@
__wxApp = None
-def getWxApp():
+def getWxApp():
global __wxApp
- if __wxApp == None:
+ if __wxApp == None:
__wxApp = GFwxApp(0)
# __wxApp.MainLoop()
GDebug.printMesg(7,"WxApp initializing3")
@@ -78,8 +78,8 @@
widget.SetFont(wxFont(int(GConfig.get('pointSize')),wxMODERN,wxNORMAL,wxNORMAL))
# Helps out with layout
-def getLargest(val1, val2):
- if val1 > val2:
+def getLargest(val1, val2):
+ if val1 > val2:
return val1
else:
return val2
@@ -87,19 +87,19 @@
# Used by the login handler
# enables the user to press return and have it jump to the next box
-class LoginFieldHandler:
- def __init__(self, app, seq):
- self.app = app
+class LoginFieldHandler:
+ def __init__(self, app, seq):
+ self.app = app
self.seq = seq
def loginFieldEventTrap(self, event):
if event.KeyCode() in (WXK_RETURN, WXK_TAB):
if self.seq < len(self.app.textctrlList) - 1:
self.app.textctrlList[self.seq+1].SetFocus()
- else:
- if event.KeyCode() == WXK_TAB:
+ else:
+ if event.KeyCode() == WXK_TAB:
self.app.loginButton.SetFocus()
- else:
+ else:
self.app.loginCompleted(1)
else:
event.Skip()
@@ -192,16 +192,16 @@
twidth,theight = self.splash.GetTextExtent(text)
wxStaticText(parent=self.splash, id=-1, label=str(text),
size=wxSize(swidth,theight),
pos=wxPoint(1,25),style=wxALIGN_CENTRE)
-
- text = "(c)2000 Free Software Foundation"
+
+ text = "(c)2000-2001 Free Software Foundation"
twidth,theight = self.splash.GetTextExtent(text)
wxStaticText(self.splash, -1, str(text),
wxPoint(1,50),wxSize(swidth,theight),wxALIGN_CENTRE)
- text = "Protected by GNU General Public Licence 2.0 or greater"
+ text = "Protected by GNU General Public Licence 2.0"
wxStaticText(self.splash, -1, str(text),
wxPoint(1,sheight-(theight+10)),wxSize(swidth-5,theight),wxALIGN_RIGHT)
-
+
self.splash.CenterOnScreen()
self.splash.Show(true)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnuef/src GFForm.py UIwxpython.py GFObject...,
Jason Cater <=