[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: |
Tue, 08 Jan 2002 12:05:56 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/01/08 12:05:56
Modified files:
common/src/FormatMasks: BaseMask.py DateMask.py
forms/src : UIbase.py
Log message:
first somewhat functional date mask
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/FormatMasks/BaseMask.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/FormatMasks/DateMask.py.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/UIbase.py.diff?tr1=1.49&tr2=1.50&r1=text&r2=text
Patches:
Index: gnue/common/src/FormatMasks/BaseMask.py
diff -c gnue/common/src/FormatMasks/BaseMask.py:1.12
gnue/common/src/FormatMasks/BaseMask.py:1.13
*** gnue/common/src/FormatMasks/BaseMask.py:1.12 Mon Jan 7 18:55:24 2002
--- gnue/common/src/FormatMasks/BaseMask.py Tue Jan 8 12:05:56 2002
***************
*** 83,88 ****
--- 83,90 ----
# Holds the length of each formatted element section...
self.inputDisplayLen = [0] * self.inputCount
+ # .. including padding
+ self.inputFormattedLen = [0] * self.inputCount
self.index = 0
***************
*** 148,153 ****
--- 150,157 ----
for size in self.inputDisplayLen:
shift -= size
+ print "Starting cursor: %s; shift: %s" % (cursor, shift)
+
value = self.processEdit(value, text, pos, replaces)
formatted = self.getFormattedInput(value,padding=padding)
***************
*** 156,161 ****
--- 160,168 ----
shift += size
self.cursor = cursor + shift
+ self.moveCursorRelative(0)
+
+ print "Ending cursor: %s; shift: %s" % (self.cursor, shift)
return (value, formatted, self.cursor)
***************
*** 215,220 ****
--- 222,229 ----
#
def moveCursorRelative(self, relative):
+ print "*** moveCursorRelative(%s)"%relative
+
# Direction = -1 (left) or 1 (right).
direction = relative == 0 or int(relative/abs(relative))
***************
*** 237,256 ****
pos = 0
section = 0
while section < self.inputCount and \
! (pos + self.inputDisplayLen[section]) <= self.cursor:
section += 1
! if section < self.inputCount:
! pos += self.inputDisplayLen[section]
print "pos=%s" % pos
! if pos > self.cursor:
section += direction
if section == self.inputCount:
# self.cursor = pos + self.inputDisplayLen[-1]
print "cursor #3: %s" % self.cursor
section -= 1
print "section=%s" % section
if isinstance(self.inputHandlers[section], Literal):
--- 246,273 ----
pos = 0
section = 0
while section < self.inputCount and \
! ((pos + self.inputDisplayLen[section]) < self.cursor):
!
! pos += self.inputDisplayLen[section]
! print "%s; %s" %(section, pos)
section += 1
!
print "pos=%s" % pos
+ print "section=%s" % pos
! if pos + self.inputFormattedLen[section] == self.cursor:
! print "cursor #2b: %s" % self.cursor
section += direction
+ print "section=%s" % section
+
if section == self.inputCount:
# self.cursor = pos + self.inputDisplayLen[-1]
print "cursor #3: %s" % self.cursor
section -= 1
+
+
print "section=%s" % section
if isinstance(self.inputHandlers[section], Literal):
Index: gnue/common/src/FormatMasks/DateMask.py
diff -c gnue/common/src/FormatMasks/DateMask.py:1.18
gnue/common/src/FormatMasks/DateMask.py:1.19
*** gnue/common/src/FormatMasks/DateMask.py:1.18 Mon Jan 7 18:55:24 2002
--- gnue/common/src/FormatMasks/DateMask.py Tue Jan 8 12:05:56 2002
***************
*** 178,186 ****
pad = padding * self.inputHandlers[i].maxLength
self.inputDisplayLen[i] = len(piece)
self.display += piece + pad
-
- print "inputDisplayLen=%s" % self.inputDisplayLen
return self.display
--- 178,185 ----
pad = padding * self.inputHandlers[i].maxLength
self.inputDisplayLen[i] = len(piece)
+ self.inputFormattedLen[i] = len(piece+pad)
self.display += piece + pad
return self.display
Index: gnue/forms/src/UIbase.py
diff -c gnue/forms/src/UIbase.py:1.49 gnue/forms/src/UIbase.py:1.50
*** gnue/forms/src/UIbase.py:1.49 Mon Jan 7 18:55:24 2002
--- gnue/forms/src/UIbase.py Tue Jan 8 12:05:56 2002
***************
*** 270,276 ****
# updateEntry
#
def updateEntry(self,event):
- print "updateEntry()"
if event.data.hidden:
return
--- 270,275 ----