[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: |
Fri, 20 Oct 2000 20:19:28 -0700 |
CVSROOT: /cvs
Module name: gnue
Changes by: James Thompson <address@hidden> 00/10/20 20:19:28
Modified files:
gnuef : TODO
gnuef/samples/zipcode: zip_code.gfd
gnuef/src : GFObjects.py UIwxpython.py
Log message:
Functional visibleCount (88.8% bug free) (maybe)
CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/TODO.diff?r1=1.10&r2=1.11
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/samples/zipcode/zip_code.gfd.diff?r1=1.5&r2=1.6
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/GFObjects.py.diff?r1=1.21&r2=1.22
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/UIwxpython.py.diff?r1=1.15&r2=1.16
Patches:
Index: gnue/gnuef/TODO
diff -u gnue/gnuef/TODO:1.10 gnue/gnuef/TODO:1.11
--- gnue/gnuef/TODO:1.10 Wed Oct 11 18:57:05 2000
+++ gnue/gnuef/TODO Fri Oct 20 20:19:28 2000
@@ -5,6 +5,9 @@
fill in todo list (easy as there is a lot of DOs to TO) [everyone]
+ clean up code [everyone working on the code]
+ ***Clean up code to provide better seperation of Objects in the Data system
+
Convert the form and view to support auto ajustment of grid system
to text based instead of pixel based
@@ -14,12 +17,8 @@
Add layout manager support
- Add GEAS support
-
Add support of mouse focus to the charater
- clean up code [everyone working on the code]
-
need to add default attrib values support
Create GNUE Forms: Designer the screen painter
@@ -29,8 +28,6 @@
Make GFDataSource verify that all records in memory are saved
prior to clearing and new queries
- Clean up code to provide better seperation of Objects in the Data system
-
Make modification of data lock the record in the backend
Transaction support
@@ -55,10 +52,7 @@
call the initializes of their children so we can get rid of
more of the self.walk nonsense
- blocks that have a visible count (so you can say visible=5
- and the UI will display 5 records)
-
- master/detail working
+ debug visibleCount & master/detail
Moving the focus from entry in one block to a different block does
not result in the currentBlock switching to the new block
Index: gnue/gnuef/samples/zipcode/zip_code.gfd
diff -u gnue/gnuef/samples/zipcode/zip_code.gfd:1.5
gnue/gnuef/samples/zipcode/zip_code.gfd:1.6
--- gnue/gnuef/samples/zipcode/zip_code.gfd:1.5 Thu Oct 19 22:56:51 2000
+++ gnue/gnuef/samples/zipcode/zip_code.gfd Fri Oct 20 20:19:28 2000
@@ -10,28 +10,18 @@
<database name="gnue" provider="postgresql" dbname="gnue" host="gnue"/>
<datasource name="zips" database="gnue" table="zip_code" cache="5"/>
- <datasource name="citylist" database="gnue" table="zip_code" cache="5"/>
<page>
<block name="zip" datasource="zips">
- <label text="Zip Code" x="5" y="10"/>
- <entry name="zip_code" field="zip" x="5" y="20" width="150" height="20"/>
- <label text="City" x="5" y="30"/>
- <entry name="city" field="city" x="5" y="40" width="150" height="20"/>
- <label text="State" x="5" y="50"/>
- <entry name="state" field="state" x="5" y="60" width="150" height="20"/>
- </block>
+ <label text="City" x="5" y="10"/>
+ <entry name="city" field="city" x="5" y="20" width="150" height="20"
visibleCount="10"/>
- <block name="cites" datasource="citylist" masterBlock="zip"
masterField="state">
- <label text="City" x="5" y="80"/>
- <entry name="city" field="city" x="5" y="90" width="150" height="20"
visibleCount="5"/>
+ <label text="State" x="65" y="10"/>
+ <entry name="state" field="state" x="65" y="20" width="150" height="20"
visibleCount="10"/>
- <label text="State" x="65" y="80"/>
- <entry name="state" field="state" x="65" y="90" width="150" height="20"
visibleCount="5"/>
-
- <label text="Zip" x="125" y="80"/>
- <entry name="zip" field="zip" x="125" y="90" width="150" height="20"
visibleCount="5"/>
+ <label text="Zip" x="125" y="10"/>
+ <entry name="zip" field="zip" x="125" y="20" width="150" height="20"
visibleCount="10"/>
</block>
</page>
Index: gnue/gnuef/src/GFObjects.py
diff -u gnue/gnuef/src/GFObjects.py:1.21 gnue/gnuef/src/GFObjects.py:1.22
--- gnue/gnuef/src/GFObjects.py:1.21 Thu Oct 19 22:56:51 2000
+++ gnue/gnuef/src/GFObjects.py Fri Oct 20 20:19:28 2000
@@ -222,14 +222,13 @@
if self.__dict__.has_key('masterBlock'):
if self.masterBlock == event.data.name:
fieldValue = self.form.findValue(self.masterBlock, self.masterField)
- if GFOptions.DEBUG:
- if fieldValue:
- print "Master Field value is %s" % (fieldValue)
-
- ## clear the link
self.dataSourceLink.clear()
- self.dataSourceLink.setField(0,self.masterField,fieldValue)
- self.dataSourceLink.query()
+ if len(fieldValue) > 0:
+ if GFOptions.DEBUG:
+ print "Master Field value is %s" % (fieldValue)
+ ## clear the link
+ self.dataSourceLink.setField(0,self.masterField,fieldValue)
+ self.dataSourceLink.query()
self.recordCount =
self.form.datasourceDictionary[self.datasource].getLastRecordNumber()
self.dispatchEvent(GFEvent('switchRECORD',[-1,0]));
@@ -241,9 +240,25 @@
if event.data == self:
self.dataSourceLink.new()
self.recordCount =
self.form.datasourceDictionary[self.datasource].getLastRecordNumber()
+
+# testing code to see if the jump below was screwing up the
+# new record code
+# while self.currentRecord != self.recordCount:
+# self.dispatchEvent(GFEvent('requestNEXTRECORD',None))
+
+# Working code but adding new records doesn't look purdy :)
+# oldRecord = self.currentRecord
+# self.currentRecord = self.recordCount
+#
self.dispatchEvent(GFEvent('switchRECORD',[oldRecord,self.currentRecord]));
+
oldRecord = self.currentRecord
- self.currentRecord = self.recordCount
+ self.currentRecord = 0
self.dispatchEvent(GFEvent('switchRECORD',[oldRecord,self.currentRecord]));
+ self.dispatchEvent(GFEvent('requestPREVRECORD',None))
+
+
+
+
#
# Moves the proper record into editing position
Index: gnue/gnuef/src/UIwxpython.py
diff -u gnue/gnuef/src/UIwxpython.py:1.15 gnue/gnuef/src/UIwxpython.py:1.16
--- gnue/gnuef/src/UIwxpython.py:1.15 Fri Oct 20 17:29:23 2000
+++ gnue/gnuef/src/UIwxpython.py Fri Oct 20 20:19:28 2000
@@ -96,9 +96,6 @@
# Methods called to deal with incomming events
#
def adjustMultiView(self, event):
- if event.data.block == event.data.block.form.currentBlock:
- return
-
block = event.data.block.form.currentBlock
if event.getEvent() == 'uiPREVRECORD':
@@ -119,27 +116,39 @@
if index < 0 : index = 0
- print "index pre ", index
+ # Don't let index pass the number of widgets on screen
if index >= int(entry.visibleCount):
index = int(entry.visibleCount)-1
- print "index post ", index
+ # Don't let the index past the number of records in the
+ # system
lowestVisible = currentRecord - index
if lowestVisible < 0 : lowestVisible = 0
-
if lowestVisible + index > block.recordCount:
index = index -1
-
+
+ # If the current record has rolled around
+ # from the top to the bottom then reset
+ # the counter
if currentRecord == 0:
index = 0
+ # if the current record has rolled from
+ # bottom to top then flip to bottom keeping
+ # in mind the number of records in memory
+ if currentRecord == block.recordCount:
+ if block.recordCount > int(entry.visibleCount)-1:
+ index = int(entry.visibleCount)-1
+ else:
+ index = block.recordCount
+
self.formToUI[entry][1] = index
- print "adjusted entity index ", self.formToUI[entry][1]
+ #print "adjusted entity index ", self.formToUI[entry][1]
def switchFocus(self, event):
index = self.formToUI[event.data][1]
- print self.formToUI[event.data]
+ #print self.formToUI[event.data]
self.formToUI[event.data][0][index].SetFocus()
def updateEntry(self,event):
@@ -153,30 +162,33 @@
# Fill the prior spots
for count in range(index):
+ print "Working on ",count
+ print "filling with record", currentRecord-(index-count)
+ print "total records", block.recordCount
+ print "Value"
,block.dataSourceLink.getField(currentRecord-(index-count),event.data.field)
self.formToUI[event.data][0][count].SetValue(block.dataSourceLink.getField(currentRecord-(index-count),event.data.field))
# fill currently indexed spot
- print "Filling index ", index
+# print "Filling index ", index
+# print "currentRecord ", currentRecord
+# print "recordCount ", block.recordCount
self.formToUI[event.data][0][index].SetValue(event.data.getValue())
self.formToUI[event.data][0][index].SetInsertionPoint(event.data.cursorPosition)
# Fill trailing spots
+ #
+ # You must skip the matching index but
+ # you do not want to just add 1 to count
+ # as the formulas would then be off
count = index
while count < int(event.data.visibleCount):
- if currentRecord+(count-index) > block.recordCount:
- value = ""
- else:
- value =
block.dataSourceLink.getField(currentRecord+(count-index),event.data.field)
- self.formToUI[event.data][0][count].SetValue(value)
+ if count != index:
+ if currentRecord+(count-index) > block.recordCount:
+ value = ""
+ else:
+ value =
block.dataSourceLink.getField(currentRecord+(count-index),event.data.field)
+ self.formToUI[event.data][0][count].SetValue(value)
count = count +1
-
-# for count in range(index+1,int(event.data.visibleCount)-1):
-# print "in %i cr %i " % (count, currentRecord+(count-index))
-# if count > block.recordCount:
-# value = ""
-# else:
-# value =
block.dataSourceLink.getField(currentRecord+(count-index),event.data.field)
-# self.formToUI[event.data][0][count].SetValue(value)
def gotoPage(self, event):
index = self.formToUI[event.data][1]