[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r5555 - in trunk/gnue-forms/src: . GFObjects
From: |
jamest |
Subject: |
r5555 - in trunk/gnue-forms/src: . GFObjects |
Date: |
Sat, 27 Mar 2004 21:19:49 -0600 (CST) |
Author: jamest
Date: 2004-03-27 21:19:48 -0600 (Sat, 27 Mar 2004)
New Revision: 5555
Modified:
trunk/gnue-forms/src/GFInstance.py
trunk/gnue-forms/src/GFObjects/GFBlock.py
trunk/gnue-forms/src/GFObjects/GFEntry.py
Log:
added block.jumpRecords(#) to trigger namespace
minor api docs
Modified: trunk/gnue-forms/src/GFInstance.py
===================================================================
--- trunk/gnue-forms/src/GFInstance.py 2004-03-27 23:19:48 UTC (rev 5554)
+++ trunk/gnue-forms/src/GFInstance.py 2004-03-28 03:19:48 UTC (rev 5555)
@@ -71,8 +71,8 @@
# Focus-related events
'requestNEXTENTRY' : self.nextEntry,
'requestPREVENTRY' : self.previousEntry,
- 'requestNEXTPAGE' : self.nextPage,
- 'requestPREVPAGE' : self.previousPage,
+ 'requestNEXTPAGE' : self.nextPage,
+ 'requestPREVPAGE' : self.previousPage,
'requestNEXTBLOCK' : self.nextBlock,
'requestPREVBLOCK' : self.previousBlock,
'requestFIRSTRECORD' : self.firstRecord,
@@ -161,21 +161,25 @@
mapping[key[4:]] = options[key]
GFKeyMapper.KeyMapper.loadUserKeyMap(mapping)
- #
- # addDialogs
- #
- # Loads the std dialog forms into memory
- #
+
+
def addDialogs(self):
+ """
+ Loads the base dialogs into memory.
+
+ Base dialogs include items such as the jump to record
+ dialog and error dialogs.
+ """
+
+
#
# Import and register dialogs
#
-
basedir = os.path.dirname(sys.modules[self.__module__].__file__)
basedir +='/dialogs/'
for dialogName in dircache.listdir(basedir):
#try:
- if dialogName[0] != '_' and dialogName != '.svn':
+ if dialogName[0] != '_' and dialogName != '.svn':
if os.path.isfile(basedir+dialogName) and
os.path.splitext(dialogName)[1] == ".py":
dialogName = os.path.splitext(dialogName)[0]
@@ -192,13 +196,13 @@
# GDebug.printMesg(5,' --> %s' % (mesg))
- #
- # addFormFromBuffer
- #
- # Loads a form from a string buffer
- #
-
def addFormFromBuffer(self,buffer):
+ """
+ Loads a GObj based form tree when passed a string containing
+ gfd markup.
+
+ @param fileName: A string containing a URI
+ """
try:
fileHandle=openBuffer(buffer)
self.addFormFromFilehandle(fileHandle)
@@ -206,10 +210,12 @@
except IOError, mesg:
self.manager.handleStartupError(_("Unable to open file\n\n %s")%mesg)
- #
- # addFormFromFile
- #
def addFormFromFile(self,fileName):
+ """
+ Loads a GObj based form tree when passed a file name.
+
+ @param fileName: A string containing a URI
+ """
try:
fileHandle=openResource(fileName)
self.addFormFromFilehandle(fileHandle)
@@ -217,15 +223,17 @@
except IOError, mesg:
self.manager.handleStartupError(_("Unable to open file\n\n %s")%mesg)
- #
- # addFormFromFilehandle
- #
- # Loads a GObj based form tree when passed a valid file name.
- # A copy of the instance is passed into the parser so that
- # it can work with things like the GConnections stored in
- # the base app
- #
def addFormFromFilehandle(self,fileHandle):
+ """
+ Loads a GObj based form tree when passed a valid python file handle.
+
+ A copy of the instance is passed into the parser so that
+ it can work with things like the GConnections stored in
+ the base app
+
+ @param fileHandle: A python file handle.
+ """
+
#
# Load the file bypassing the initialization
# We bypass the initialization because <dialog>s are
@@ -432,15 +440,16 @@
self.updateRecordCounter(form)
self.updateRecordStatus(form)
- #
- # proxyEntryEvent
- #
- # This serves as a proxy for any entry-level events.
- # Since we don't want all entries listening for all
- # events (only the *current* entry), we will capture
- # any relevant events here and pass on to the entry.
- #
+
def proxyEntryEvent(self, event):
+ """
+ This serves as a proxy for any entry-level events.
+ Since we don't want all entries listening for all
+ events (only the *current* entry), we will capture
+ any relevant events here and pass on to the entry.
+
+ @param event: The event currently being processed.
+ """
if event._form._currentEntry and \
event._form._currentEntry._type != 'GFButton':
@@ -448,7 +457,6 @@
# If the display will need to be refreshed,
# then the proxied event should set this to 1
- # TODO: Maybe this needs set to 0 and the handlers adjusted - jst
event.refreshDisplay = 0
# Pass off the event to the current entry's event handler
@@ -458,8 +466,6 @@
if event.refreshDisplay:
handler.generateRefreshEvent()
event._form.refreshUIEvents()
- # TODO: Don't think this is needed - jst 13-mar-2003
- #self.updateRecordStatus(event._form)
# If the entry needs an error message displayed,
# then the proxied event should set this to the
@@ -467,13 +473,13 @@
if event.__errortext__:
self.displayMessageBox(event.__errortext__)
- #
- # nextEntry
- #
- # Called whenever an event source has requested that the
- # focus change to the next data entry object
- #
def nextEntry(self, event):
+ """
+ Called whenever an event source has requested that the
+ focus change to the next data entry object
+
+ @param event: The event currently being processed.
+ """
if not event._form.endEditing():
return
message = event._form.nextEntry()
@@ -484,13 +490,14 @@
self.updateRecordStatus(event._form)
self.updateTip(event._form)
- #
- # prevEntry
- #
- # Called whenever an event source has requested that the
- # focus change to the next data entry object
- #
def previousEntry(self, event):
+ """
+ Called whenever an event source has requested that the
+ focus change to the next data entry object
+
+ param event: The event that requested the previous entry.
+ """
+
if not event._form.endEditing():
return
Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFBlock.py 2004-03-27 23:19:48 UTC (rev
5554)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py 2004-03-28 03:19:48 UTC (rev
5555)
@@ -125,6 +125,8 @@
'description':'Navigates the block
to the next record in sequence.'},
'prevRecord':{'function':self.prevRecord,
'description':'Navigates the block
to the previous record in sequence.'},
+ 'jumpRecords':{'function':self.jumpRecords,
+ 'description':'Navigates the
specified number of records.'},
'rollback':{'function':self.processRollback,
'description':'Clears all records
regardless of state from the block'},
'initQuery':{'function':self.initQuery,
@@ -392,6 +394,18 @@
self.processTrigger('PRE-FOCUSIN')
self.processTrigger('POST-FOCUSIN')
+
+ def jumpRecords(self, adjustment):
+ targetRecord = self._resultSet.getRecordNumber() + adjustment
+
+ if targetRecord < 0:
+ targetRecord = 0
+ elif targetRecord > self._resultSet.getRecordCount():
+ targetRecord = self._resultSet.getRecordCount()
+
+ self.jumpRecord(targetRecord)
+ self._form._instance.updateRecordCounter(self._form)
+
#
# processCommit
#
Modified: trunk/gnue-forms/src/GFObjects/GFEntry.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFEntry.py 2004-03-27 23:19:48 UTC (rev
5554)
+++ trunk/gnue-forms/src/GFObjects/GFEntry.py 2004-03-28 03:19:48 UTC (rev
5555)
@@ -71,6 +71,10 @@
self._triggerSet = self.triggerSetValue
self._triggerGet = self.getValue
+ self._triggerProperties = {
+ 'rows': { 'get': self._getRows,
+ }
+ }
def _buildObject(self):
return GFTabStop._buildObject(self)
@@ -157,3 +161,6 @@
def triggerSetValue(self, *args, **parms):
return self._field.triggerSetValue(*args, **parms)
+ def _getRows(self):
+ return self._rows
+
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r5555 - in trunk/gnue-forms/src: . GFObjects,
jamest <=