[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnuef TODO samples/zipcode/zip_code.gfd sr...
From: |
James Thompson |
Subject: |
gnue/gnuef TODO samples/zipcode/zip_code.gfd sr... |
Date: |
Sun, 22 Oct 2000 16:26:43 -0700 |
CVSROOT: /cvs
Module name: gnue
Changes by: James Thompson <address@hidden> 00/10/22 16:26:43
Modified files:
gnuef : TODO
gnuef/samples/zipcode: zip_code.gfd
gnuef/src : GFForm.py UIbase.py UIwxpython.py
Log message:
Added entry support for
hidden, readonly, uppercase, lowercase, numeric, and max_length
attributes
CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/TODO.diff?r1=1.11&r2=1.12
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/samples/zipcode/zip_code.gfd.diff?r1=1.8&r2=1.9
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/GFForm.py.diff?r1=1.23&r2=1.24
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/UIbase.py.diff?r1=1.8&r2=1.9
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/UIwxpython.py.diff?r1=1.16&r2=1.17
Patches:
Index: gnue/gnuef/TODO
diff -u gnue/gnuef/TODO:1.11 gnue/gnuef/TODO:1.12
--- gnue/gnuef/TODO:1.11 Fri Oct 20 20:19:28 2000
+++ gnue/gnuef/TODO Sun Oct 22 16:26:43 2000
@@ -60,3 +60,12 @@
rewrite the whole friggen braindead focus system to accomidate
entries with multiple record visible
mouse navigation to different blocks
+
+ taborder support
+
+
+
+
+
+
+
Index: gnue/gnuef/samples/zipcode/zip_code.gfd
diff -u gnue/gnuef/samples/zipcode/zip_code.gfd:1.8
gnue/gnuef/samples/zipcode/zip_code.gfd:1.9
--- gnue/gnuef/samples/zipcode/zip_code.gfd:1.8 Sat Oct 21 09:06:19 2000
+++ gnue/gnuef/samples/zipcode/zip_code.gfd Sun Oct 22 16:26:43 2000
@@ -8,8 +8,7 @@
<width>540</width>
</options>
- <database
-name="gnue" provider="postgresql" dbname="gnue" host="localhost"/>
+ <database name="gnue" provider="postgresql" dbname="gnue" host="gnue"/>
<datasource name="zips" database="gnue" table="zip_code" cache="5"/>
@@ -20,10 +19,10 @@
</entry>
<label text="State" x="65" y="10"/>
- <entry name="state" field="state" x="65" y="20" width="150" height="20"
visibleCount="10"/>
+ <entry name="state" field="state" x="65" y="20" width="150" height="20"
visibleCount="10" uppercase=""/>
<label text="Zip" x="125" y="10"/>
- <entry name="zip" field="zip" x="125" y="20" width="150" height="20"
visibleCount="10"/>
+ <entry name="zip" field="zip" x="125" y="20" width="150" height="20"
visibleCount="10" numeric="" max_length="5"/>
</block>
</page>
Index: gnue/gnuef/src/GFForm.py
diff -u gnue/gnuef/src/GFForm.py:1.23 gnue/gnuef/src/GFForm.py:1.24
--- gnue/gnuef/src/GFForm.py:1.23 Sat Oct 21 09:06:19 2000
+++ gnue/gnuef/src/GFForm.py Sun Oct 22 16:26:43 2000
@@ -14,6 +14,7 @@
import sys
import os # This only exists for the complete crap hack for passwd info
# in initDatabases
+import string
from GFObjects import *
from GFEvent import *
@@ -231,7 +232,7 @@
keepNext = 0
for object in self.currentEntry.parent.children:
# Put the first field as the next to rollover
- if object.getObjectType()=='GFEntry':
+ if object.getObjectType()=='GFEntry'and not
object.__dict__.has_key('hidden'):
if nextEntry == None: nextEntry = object
if object == self.currentEntry:
@@ -400,18 +401,29 @@
def keyPress(self, event):
if GFOptions.DEBUG:
print "Keypress event", event.data
- string = self.currentEntry.getValue()
- if self.insertMode == 1:
- string = string[:self.currentEntry.cursorPosition] + event.data + \
- string[self.currentEntry.cursorPosition:]
- else:
- string = string[:self.currentEntry.cursorPosition] + event.data + \
- string[self.currentEntry.cursorPosition+1:]
+ if not self.currentEntry.__dict__.has_key('readonly'):
+ currentvalue = self.currentEntry.getValue()
+ if self.currentEntry.__dict__.has_key('lowercase'):
+ event.data = string.lower(event.data)
+ if self.currentEntry.__dict__.has_key('uppercase'):
+ event.data = string.upper(event.data)
+ if self.currentEntry.__dict__.has_key('max_length'):
+ if len(currentvalue) >= int(self.currentEntry.max_length):
+ return
+ if self.currentEntry.__dict__.has_key('numeric'):
+ if not event.data in string.digits:
+ return
+
+ if self.insertMode == 1:
+ currentvalue = currentvalue[:self.currentEntry.cursorPosition] +
event.data + \
+ currentvalue[self.currentEntry.cursorPosition:]
+ else:
+ currentvalue = currentvalue[:self.currentEntry.cursorPosition] +
event.data + \
+ currentvalue[self.currentEntry.cursorPosition+1:]
- self.currentEntry.setValue(string)
- self.currentEntry.cursorPosition = self.currentEntry.cursorPosition + 1
- print "Updating entry to %s" %(self.currentEntry.getValue())
- self.dispatchEvent(GFEvent('updateENTRY',self.currentEntry));
+ self.currentEntry.setValue(currentvalue)
+ self.currentEntry.cursorPosition = self.currentEntry.cursorPosition + 1
+ self.dispatchEvent(GFEvent('updateENTRY',self.currentEntry));
#
# removeCharacter
@@ -426,10 +438,10 @@
else:
return
- string = self.currentEntry.getValue()
- string = string[:self.currentEntry.cursorPosition] + \
- string[self.currentEntry.cursorPosition+1:]
- self.currentEntry.setValue(string)
+ currentvalue = self.currentEntry.getValue()
+ currentvalue = currentvalue[:self.currentEntry.cursorPosition] + \
+ currentvalue[self.currentEntry.cursorPosition+1:]
+ self.currentEntry.setValue(currentvalue)
self.dispatchEvent(GFEvent('updateENTRY',self.currentEntry));
Index: gnue/gnuef/src/UIbase.py
diff -u gnue/gnuef/src/UIbase.py:1.8 gnue/gnuef/src/UIbase.py:1.9
--- gnue/gnuef/src/UIbase.py:1.8 Thu Oct 19 22:56:51 2000
+++ gnue/gnuef/src/UIbase.py Sun Oct 22 16:26:43 2000
@@ -91,17 +91,15 @@
else:
widget = newWidget
- # Create a cross reference to the GFObject that created
- # one or more UI widgets
- #print "WWWidget: ", newWidget
- #for singleWidget in widget:
- # self.formToUI[self.currentObject[0]] = singleWidget
- self.formToUI[self.currentObject[0]] = [widget,0]
+ if not widget == []:
+ # Create a cross reference to the GFObject that created
+ # one or more UI widgets
+ self.formToUI[self.currentObject[0]] = [widget,0]
- # If the current object is a container then add the
- # just created first created widget to it's widget list
- if self.currentObject[0].getObjectType() in self.containerWidgets:
- self.currentWidget.insert(0,widget[0])
+ # If the current object is a container then add the
+ # just created first created widget to it's widget list
+ if self.currentObject[0].getObjectType() in self.containerWidgets:
+ self.currentWidget.insert(0,widget[0])
except KeyError:
pass
Index: gnue/gnuef/src/UIwxpython.py
diff -u gnue/gnuef/src/UIwxpython.py:1.16 gnue/gnuef/src/UIwxpython.py:1.17
--- gnue/gnuef/src/UIwxpython.py:1.16 Fri Oct 20 20:19:28 2000
+++ gnue/gnuef/src/UIwxpython.py Sun Oct 22 16:26:43 2000
@@ -248,33 +248,35 @@
container = self.currentWidget[0]
widget = []
- #jamest this is probably wrong way to do but be patient. :)
+ if not object.__dict__.has_key('hidden'):
- if object.getObjectType() == 'GFEntry':
- #set default style
- setattr(object,'style',wxSIMPLE_BORDER)
- try:
- if string.lower(object.password) == 'true':
- #set style to read only
- setattr(object,'style',wxTE_PASSWORD)
- except:
- pass
+ #jamest this is probably wrong way to do but be patient. :)
- if not object.__dict__.has_key('visibleCount'):
- # count = int(object.visibleCount)
- #else:
- object.visibleCount = 1
+ if object.getObjectType() == 'GFEntry':
+ #set default style
+ setattr(object,'style',wxSIMPLE_BORDER)
+ try:
+ if string.lower(object.password) == 'true':
+ #set style to read only
+ setattr(object,'style',wxTE_PASSWORD)
+ except:
+ pass
+
+ if not object.__dict__.has_key('visibleCount'):
+ # count = int(object.visibleCount)
+ #else:
+ object.visibleCount = 1
- count = int(object.visibleCount)
+ count = int(object.visibleCount)
- for spacer in range(count):
- spacer = int(spacer)
- newWidget = eval(self.widgetConstructor[object.getObjectType()])
+ for spacer in range(count):
+ spacer = int(spacer)
+ newWidget = eval(self.widgetConstructor[object.getObjectType()])
- widget.append(newWidget)
- EVT_CHAR(newWidget, self.uiEventTrap)
- EVT_MOUSE_EVENTS(newWidget, self.uiEventTrap)
+ widget.append(newWidget)
+ EVT_CHAR(newWidget, self.uiEventTrap)
+ EVT_MOUSE_EVENTS(newWidget, self.uiEventTrap)
return widget