[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnuef client/gfclient samples/zipcode/zipc...
From: |
James Thompson |
Subject: |
gnue/gnuef client/gfclient samples/zipcode/zipc... |
Date: |
Tue, 20 Mar 2001 15:25:51 -0800 |
CVSROOT: /cvs
Module name: gnue
Changes by: James Thompson <address@hidden> 01/03/20 15:25:50
Modified files:
gnuef/client : gfclient
gnuef/samples/zipcode: zipcode.gfd
gnuef/src : GFForm.py GFObjects.py UIbase.py UIwxpython.py
Log message:
Fixed prequery not displaying properly bug
Fixed error message boxes in gfclient
CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/client/gfclient.diff?r1=1.25&r2=1.26
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/samples/zipcode/zipcode.gfd.diff?r1=1.9&r2=1.10
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/GFForm.py.diff?r1=1.79&r2=1.80
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/GFObjects.py.diff?r1=1.71&r2=1.72
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/UIbase.py.diff?r1=1.25&r2=1.26
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/UIwxpython.py.diff?r1=1.75&r2=1.76
Patches:
Index: gnue/gnuef/client/gfclient
diff -u gnue/gnuef/client/gfclient:1.25 gnue/gnuef/client/gfclient:1.26
--- gnue/gnuef/client/gfclient:1.25 Tue Mar 20 12:23:12 2001
+++ gnue/gnuef/client/gfclient Tue Mar 20 15:25:50 2001
@@ -16,7 +16,7 @@
#
# Copyright (c) 2000 Free Software Foundation
#
-# $Revision: 1.25 $ $Date: 2001/03/20 20:23:12 $ $Author: jamest $
+# $Revision: 1.26 $ $Date: 2001/03/20 23:25:50 $ $Author: jamest $
#
import pstats
@@ -184,8 +184,6 @@
def executeExit(self, event):
if not self.form.isSaved():
- #self.dispatchEvent( GFEvent( 'msgBoxUI', GFOptions._msgDETAILNOTSAVED) )
-
message = GFMsgBox(self, GFOptions._msgNOTSAVED)
message.show()
else:
@@ -370,11 +368,12 @@
def requestQuery(self, event):
if hasattr(self.form.currentBlock,"master"):
- self.dispatchEvent( GFEvent( 'msgBoxUI', "Query from detail blocks
currently not supported"))
+ messageBox = GFMsgBox(self, "Query from detail blocks currently not
supported")
+ messageBox.show()
return
message = self.form.prepQuery()
if message:
- messageBox = GFMsgBox('HI')
+ messageBox = GFMsgBox(self,message)
messageBox.show()
return
self.dispatchEvent(GFEvent('gotoENTRY',{'object':self.form.currentEntry}))
@@ -386,7 +385,7 @@
def executeCommit(self, event):
message = self.form.commit()
if message:
- messageBox = GFMsgBox(message)
+ messageBox = GFMsgBox(self,message)
messageBox.show()
return
self.dispatchEvent(GFEvent('gotoENTRY',{'object':self.form.currentEntry}))
@@ -396,7 +395,7 @@
def executeQuery(self, event):
message = self.form.executeQuery()
if message:
- messageBox = GFMsgBox(message)
+ messageBox = GFMsgBox(self,message)
messageBox.show()
def replaceValue(self,event):
@@ -521,9 +520,6 @@
else:
break
self.form.initializeDatasources()
-
-
-
# pass control to UI
ui.buildForm(self.form)
Index: gnue/gnuef/samples/zipcode/zipcode.gfd
diff -u gnue/gnuef/samples/zipcode/zipcode.gfd:1.9
gnue/gnuef/samples/zipcode/zipcode.gfd:1.10
--- gnue/gnuef/samples/zipcode/zipcode.gfd:1.9 Mon Feb 19 18:47:24 2001
+++ gnue/gnuef/samples/zipcode/zipcode.gfd Tue Mar 20 15:25:50 2001
@@ -11,7 +11,7 @@
<!-- <database name="gnue" provider="mysql" dbname="gnue" host="localhost"/>
-->
<database name="gnue" provider="postgresql" dbname="gnue" host="gnue"/>
- <datasource name="zips" database="gnue" table="zipcode" cache="5"
order_by="state_code,city"/>
+ <datasource name="zips" database="gnue" table="zipcode" cache="5"
order_by="state_code,city" prequery=""/>
<datasource name="validator" database="gnue" table="state" prequery=""
order_by="description"/>
<page>
Index: gnue/gnuef/src/GFForm.py
diff -u gnue/gnuef/src/GFForm.py:1.79 gnue/gnuef/src/GFForm.py:1.80
--- gnue/gnuef/src/GFForm.py:1.79 Tue Mar 20 12:23:12 2001
+++ gnue/gnuef/src/GFForm.py Tue Mar 20 15:25:50 2001
@@ -67,9 +67,7 @@
self.walk(self.setInitialFocus)
# Connect to the defined databases
- #print "Am i here and shoud init the database stuff"
self.walk(self.initDatabaseObjects)
- #print "yes i Am i here"
# build the block list
self.walk(self.initBlocks)
@@ -99,10 +97,6 @@
self.triggerns['GFMsgBox'] = GFMsgBox
self.walk(self.initTriggers)
-
-
-
-
#
# begin routines made for walking
@@ -139,31 +133,9 @@
def initDatabaseObjects(self, object):
if object.getObjectType() =='GFDataSource':
self.datasourceDictionary[object.name]=object
-# object.initialize()
if object.getObjectType() =='GFDatabase':
self.databaseDictionary[object.name]=object
-# while 1:
-# try:
-# #Login
-# authcode = ["", "", object]
-# self.dispatchEvent( GFEvent('getLogin', authcode) )
-# user = authcode[0]
-# passwd = authcode[1]
-#
-# object.initialize(user,passwd)
-#
-# except DBError:
-# message = GFMsgBox(self,"Database initialization error:\n%s\n%s " %
(sys.exc_info()[0], sys.exc_info()[1]))
-# message.show()
-
-# except:
-# if sys.platform != 'win32':
-# os.system("stty sane")
-# print "Unexpected error:", sys.exc_info()[0], sys.exc_info()[1]
-# sys.exit()
-# else:
-# break
def initTriggers(self, object):
if object.getObjectType() == "GFTrigger":
@@ -342,8 +314,8 @@
self.currentEntry.cursorPosition = len(self.currentEntry.value)
elif position == 'home':
self.currentEntry.cursorPosition = 0
- elif position == 'left':
- self.currentEntry.cursorPosition = self.currentEntry.cursorPosition - 1
+ elif position == 'left' and self.currentEntry.cursorPosition > 0:
+ self.currentEntry.cursorPosition = self.currentEntry.cursorPosition - 1
elif position == 'right':
if self.currentEntry.cursorPosition < len(self.currentEntry.value):
self.currentEntry.cursorPosition= self.currentEntry.cursorPosition + 1
Index: gnue/gnuef/src/GFObjects.py
diff -u gnue/gnuef/src/GFObjects.py:1.71 gnue/gnuef/src/GFObjects.py:1.72
--- gnue/gnuef/src/GFObjects.py:1.71 Tue Mar 20 12:23:12 2001
+++ gnue/gnuef/src/GFObjects.py Tue Mar 20 15:25:50 2001
@@ -317,19 +317,25 @@
# Moves the proper record into editing position
#
def switchRecord(self, adjustment):
+ self.recordCount = self.dataSourceLink.getLastRecordNumber()
for entry in self.entryList:
entry.switchRecord(self.currentRecord)
+ GFDebug.printMesg(2, "switching record adj: %s current: %s count: %s" %
+ (adjustment, self.currentRecord,
self.recordCount)
+ )
entry.recalculateVisible( adjustment, self.currentRecord,
self.recordCount)
self.form.updateUIEntry(entry)
self.form.updateDetailBlocks(self)
def nextRecord(self):
+ self.recordCount = self.dataSourceLink.getLastRecordNumber()
self.currentRecord = self.currentRecord + 1
if self.currentRecord > self.recordCount : self.currentRecord = 0
self.switchRecord(1)
def prevRecord(self):
+ self.recordCount = self.dataSourceLink.getLastRecordNumber()
self.currentRecord = self.currentRecord - 1
if self.currentRecord < 0 : self.currentRecord = self.recordCount
self.switchRecord(-1)
Index: gnue/gnuef/src/UIbase.py
diff -u gnue/gnuef/src/UIbase.py:1.25 gnue/gnuef/src/UIbase.py:1.26
--- gnue/gnuef/src/UIbase.py:1.25 Sat Mar 17 06:11:25 2001
+++ gnue/gnuef/src/UIbase.py Tue Mar 20 15:25:50 2001
@@ -242,55 +242,7 @@
# this will adjust the entries to ensure the proper one is visible
#
def adjustMultiView(self, event):
- print "Whoops"
- pass
-
-## adjustment = event.data['adjustment']
-## currentRecord = event.data['currentRecord']
-## recordCount = event.data['recordCount']
-## entryList = event.data['entryList']
-
-## # Need to figure out what the currentRecord is
-## # about to switch to. It hasn't yet.
-## currentRecord = currentRecord + adjustment
-
-## if currentRecord < 0 : currentRecord = recordCount
-## if currentRecord > recordCount : currentRecord = 0
-
-## for entry in entryList:
-## if not hasattr(entry, 'hidden'):
-## index = self.formToUI[entry][1]
-## index = index + adjustment
-
-## if index < 0 : index = 0
-
-## # Don't let index pass the number of widgets on screen
-## if index >= int(entry.visibleCount):
-## index = int(entry.visibleCount)-1
-
-## # Don't let the index past the number of records in the
-## # system
-## lowestVisible = currentRecord - index
-## if lowestVisible < 0 : lowestVisible = 0
-## if lowestVisible + index > 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 == recordCount:
-## if recordCount > int(entry.visibleCount)-1:
-## index = int(entry.visibleCount)-1
-## else:
-## index = recordCount
-
-## self.formToUI[entry][1] = index
+ print "Whoops - you should not be calling adjustMultiView"
#
# updateEntry
Index: gnue/gnuef/src/UIwxpython.py
diff -u gnue/gnuef/src/UIwxpython.py:1.75 gnue/gnuef/src/UIwxpython.py:1.76
--- gnue/gnuef/src/UIwxpython.py:1.75 Sat Mar 17 06:11:25 2001
+++ gnue/gnuef/src/UIwxpython.py Tue Mar 20 15:25:50 2001
@@ -128,7 +128,9 @@
maxWidth, maxHeight, maxDescent, maxLeading = [0,0,0,0]
- for letter in "WOyg-\|":
+ # need to add string.punctionation if we dump python 1.5.2
+ checkchars = string.letters+string.digits+"-\|"
+ for letter in checkchars:
width,height,descent,leading = self.mainWindow.GetFullTextExtent(letter)
maxWidth = maxWidth > width and maxWidth or width
maxHeight = maxHeight > height and maxHeight or height
@@ -241,6 +243,8 @@
self.mainWindow.panel.SetSize(wxSize(int(self.form.width)*int(self.widgetWidth),
int(int(self.form.height)+self.menu_sb_space)*int(self.widgetHeight)))
self.pageList[0].Show(TRUE)
+ self.dispatchEvent(GFEvent('requestPREVRECORD'))
+ self.dispatchEvent(GFEvent('requestNEXTRECORD'))
# Only one page at a time can be visible
self.visiblePage = self.pageList[0]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnuef client/gfclient samples/zipcode/zipc...,
James Thompson <=