[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue common/src/FormatMasks/BaseMask.py common/...
From: |
Jason Cater |
Subject: |
gnue common/src/FormatMasks/BaseMask.py common/... |
Date: |
Fri, 04 Jan 2002 00:56:46 -0500 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/01/04 00:56:46
Modified files:
common/src/FormatMasks: BaseMask.py DateMask.py
forms/src : GFForm.py UIbase.py
Log message:
more work on input system
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/FormatMasks/BaseMask.py.diff?cvsroot=OldCVS&tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/FormatMasks/DateMask.py.diff?cvsroot=OldCVS&tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFForm.py.diff?cvsroot=OldCVS&tr1=1.136&tr2=1.137&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/UIbase.py.diff?cvsroot=OldCVS&tr1=1.47&tr2=1.48&r1=text&r2=text
Patches:
Index: gnue/common/src/FormatMasks/BaseMask.py
diff -c gnue/common/src/FormatMasks/BaseMask.py:1.10
gnue/common/src/FormatMasks/BaseMask.py:1.11
*** gnue/common/src/FormatMasks/BaseMask.py:1.10 Thu Jan 3 19:35:54 2002
--- gnue/common/src/FormatMasks/BaseMask.py Fri Jan 4 00:56:46 2002
***************
*** 353,357 ****
--- 353,360 ----
def isValidEntry(self, value):
return 0
+ def isCompleteEntry(self, value):
+ return len(value) == self.maxLength
+
Index: gnue/common/src/FormatMasks/DateMask.py
diff -c gnue/common/src/FormatMasks/DateMask.py:1.14
gnue/common/src/FormatMasks/DateMask.py:1.15
*** gnue/common/src/FormatMasks/DateMask.py:1.14 Thu Jan 3 19:35:54 2002
--- gnue/common/src/FormatMasks/DateMask.py Fri Jan 4 00:56:46 2002
***************
*** 229,234 ****
--- 229,242 ----
except ValueError:
return 0
+ def isCompleteEntry(self, value):
+ v = int(value)
+ return v >= self.valueRange[0] \
+ and v <= self.valueRange[1] \
+ and (len(value) == self.maxLength or
+ v * 10 > self.valueRange[1])
+
+
class _aSection(_baseDateSection):
def __init__(self):
Index: gnue/forms/src/GFForm.py
diff -c gnue/forms/src/GFForm.py:1.136 gnue/forms/src/GFForm.py:1.137
*** gnue/forms/src/GFForm.py:1.136 Thu Jan 3 19:35:39 2002
--- gnue/forms/src/GFForm.py Fri Jan 4 00:56:46 2002
***************
*** 231,256 ****
if hasattr(object,'name'):
id = 'name'
! rv = self.__findImportItem(object, form, id)
! if rv != None:
rv._parent = object
rv._IMPORTED = 1
object._children.append(rv)
! for key in object._loadedxmlattrs.keys():
! if key[0] != '_':
rv.__dict__[key] = object._loadedxmlattrs[key]
GDebug.printMesg (5, ">>> Moving %s" % key)
rv._buildObject()
!
! def __findImportItem(self, find, object, id):
if isinstance(object, find._importclass) and \
hasattr(object, id) and \
object.__dict__[id] == find.__dict__[id]:
! return object
elif hasattr(object,'_children'):
rv = None
! for child in object._children:
! rv = self.__findImportItem(find, child, id)
if rv:
break
return rv
--- 231,256 ----
if hasattr(object,'name'):
id = 'name'
! rv = self.__findImportItem(object, form, id)
! if rv != None:
rv._parent = object
rv._IMPORTED = 1
object._children.append(rv)
! for key in object._loadedxmlattrs.keys():
! if key[0] != '_':
rv.__dict__[key] = object._loadedxmlattrs[key]
GDebug.printMesg (5, ">>> Moving %s" % key)
rv._buildObject()
!
! def __findImportItem(self, find, object, id):
if isinstance(object, find._importclass) and \
hasattr(object, id) and \
object.__dict__[id] == find.__dict__[id]:
! return object
elif hasattr(object,'_children'):
rv = None
! for child in object._children:
! rv = self.__findImportItem(find, child, id)
if rv:
break
return rv
***************
*** 412,419 ****
--- 412,424 ----
self._currentEntry.processTrigger('Pre-FocusOut')
self._currentEntry.processTrigger('Post-FocusOut')
widget.processTrigger('Pre-FocusIn')
+
+ oldEntry = self._currentEntry
self._currentEntry = widget
self._currentBlock = self._currentEntry._block
+
+ self.dispatchEvent(GFEvent('updateENTRY', oldEntry))
+
widget.processTrigger('Post-FocusIn')
except TriggerError, t:
message = self.TriggerErrorFunc(t)
***************
*** 667,672 ****
--- 672,678 ----
self._currentEntry = nextEntry
prevEntry.processTrigger('Post-FocusOut')
+ self.dispatchEvent(GFEvent('updateENTRY', prevEntry))
nextEntry.processTrigger('Post-FocusIn')
except TriggerError, t:
message = self.TriggerErrorFunc(t)
***************
*** 712,717 ****
--- 718,724 ----
self._currentEntry.processTrigger('Post-FocusOut')
self._currentEntry = nextEntry
+ self.dispatchEvent(GFEvent('updateENTRY', prevEntry))
self._currentEntry.processTrigger('Post-FocusIn')
except TriggerError, t:
print "Got to the exception handler!"
***************
*** 746,752 ****
--- 753,762 ----
self.TriggerErrorFunc(t)
# reset current entry
+ prevEntry = self._currentEntry
self._currentEntry = None
+ self.dispatchEvent(GFEvent('updateENTRY', prevEntry))
+
self._currentBlock.walk(self.setFocus)
# set current page
***************
*** 779,785 ****
--- 789,798 ----
self.TriggerErrorFunc(t)
# reset current entry
+ prevEntry = self._currentEntry
self._currentEntry = None
+ self.dispatchEvent(GFEvent('updateENTRY', prevEntry))
+
self._currentBlock.walk(self.setFocus)
# set current page
Index: gnue/forms/src/UIbase.py
diff -c gnue/forms/src/UIbase.py:1.47 gnue/forms/src/UIbase.py:1.48
*** gnue/forms/src/UIbase.py:1.47 Sun Nov 4 17:04:48 2001
--- gnue/forms/src/UIbase.py Fri Jan 4 00:56:46 2002
***************
*** 202,208 ****
insertValue = 'OVR'
self._setStatusBar(tip, status, insertValue, currentRecord, maxRecord,
currentPage, maxPage)
!
#
# exitApplication
#
--- 202,208 ----
insertValue = 'OVR'
self._setStatusBar(tip, status, insertValue, currentRecord, maxRecord,
currentPage, maxPage)
!
#
# exitApplication
#
***************
*** 275,280 ****
--- 275,281 ----
index = event.data._visibleIndex
+ form = event.data._block._form
block = event.data._block
currentRecord = block._resultSet.getRecordNumber()
***************
*** 287,292 ****
--- 288,297 ----
if block.mode != 'query':
for count in range(index):
value =
block._resultSet.getRecord(currentRecord-(index-count)).getField(event.data.field)
+
+ if event.data._maskHandler:
+ value = event.data._maskHandler.getFormattedOutput(value)
+
if value == None: value = ""
value = str(value) # Done to remove unicode types which wxpython
doesn't like
if style == 'dropdown':
***************
*** 303,309 ****
if style == 'dropdown':
value = event.data.allowedValues()["%s" % event.data.getValue()]
else:
! value = event.data.getDisplay(hasFocus=1)
value = str(value) # Done to remove unicode types which wxpython doesn't
like
if style == 'checkbox':
--- 308,314 ----
if style == 'dropdown':
value = event.data.allowedValues()["%s" % event.data.getValue()]
else:
! value = event.data.getDisplay( hasFocus= event.data ==
form._currentEntry )
value = str(value) # Done to remove unicode types which wxpython doesn't
like
if style == 'checkbox':
***************
*** 332,338 ****
--- 337,348 ----
else:
value = ""
else:
+
value = rec.getField(event.data.field)
+
+ if event.data._maskHandler:
+ value = event.data._maskHandler.getFormattedOutput(value)
+
if value == None: value = ""
value = str(value) # Done to remove unicode types which wxpython
doesn't like
if style == 'dropdown':
***************
*** 346,354 ****
count = count +1
! # Called whenever forms goes into a "wait" state in which user cannot
# interact with interface (e.g., while waiting for a query or a commit)
! def beginWait (self, event):
pass
--- 356,364 ----
count = count +1
! # Called whenever forms goes into a "wait" state in which user cannot
# interact with interface (e.g., while waiting for a query or a commit)
! def beginWait (self, event):
pass
- gnue common/src/FormatMasks/BaseMask.py common/...,
Jason Cater <=