[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8656 - trunk/gnue-forms/src
From: |
reinhard |
Subject: |
[gnue] r8656 - trunk/gnue-forms/src |
Date: |
Wed, 6 Sep 2006 04:13:28 -0500 (CDT) |
Author: reinhard
Date: 2006-09-06 04:13:27 -0500 (Wed, 06 Sep 2006)
New Revision: 8656
Modified:
trunk/gnue-forms/src/GFForm.py
Log:
Make record navigation methods available in the form's trigger namespace. This
will be needed for migrating the menu bar and the toolbar to the action system.
Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py 2006-09-06 08:40:25 UTC (rev 8655)
+++ trunk/gnue-forms/src/GFForm.py 2006-09-06 09:13:27 UTC (rev 8656)
@@ -150,6 +150,14 @@
'messageBox': {
'function': self.__trigger_message_box,
'global': True},
+
+ # Record navigation
+ 'first_record': {'function': self.first_record},
+ 'prev_record': {'function': self.prev_record},
+ 'next_record': {'function': self.next_record},
+ 'last_record': {'function': self.last_record},
+ 'ask_record': {'function': self.ask_record},
+
'commit': {
'function': self.__trigger_commit,
'global': True},
@@ -990,7 +998,92 @@
self.refreshDisplay(self)
+ # =========================================================================
+ # Data navigation and manipulation
+ # =========================================================================
+
# -------------------------------------------------------------------------
+ # Record navigation
+ # -------------------------------------------------------------------------
+
+ def first_record(self):
+ """
+ Jumps to the first record in the current block.
+ """
+ if self._currentBlock is not None:
+ self._currentBlock.first_record()
+
+ # -------------------------------------------------------------------------
+
+ def prev_record(self):
+ """
+ Steps to the previous record in the current block.
+ """
+ if self._currentBlock is not None:
+ self._currentBlock.prev_record()
+
+ # -------------------------------------------------------------------------
+
+ def next_record(self):
+ """
+ Steps to the next record in the current block.
+ """
+ if self._currentBlock is not None:
+ self._currentBlock.next_record()
+
+ # -------------------------------------------------------------------------
+
+ def last_record(self):
+ """
+ Jumps to the last record in the current block.
+ """
+ if self._currentBlock is not None:
+ self._currentBlock.last_record()
+
+ # -------------------------------------------------------------------------
+
+ def ask_record(self):
+ """
+ Ask the user for a record number to jump to in the current block.
+ """
+
+ if self._currentBlock is None:
+ return
+
+ fields = [(u_("Recordnumber"), 'record', 'string',
+ str(self._currentBlock._currentRecord + 1), None, [])]
+
+ while True:
+ result = self._instance._uiinstance.getInput(u_("Jump to record"),
+ fields)
+ if result is None:
+ return
+ try:
+ count = int(result['record'])
+ # Positive start to count by zero
+ if count > 0: count -= 1
+ break
+ except ValueError:
+ fields = [
+ (u_("Invalid numeric value entered."), None, 'warning',
+ None, None, []),
+ (u_("Recordnumber"), 'record', 'string',
+ result['record'], None, [])]
+
+ self._currentBlock.goto_record(count)
+
+ # -------------------------------------------------------------------------
+
+ def jump_records(self, count):
+ """
+ Jumps to a given record in the current block.
+ @param count: number of records to move
+ """
+ if self._currentBlock is not None:
+ self._currentBlock.jump_records(count)
+
+
+ # -------------------------------------------------------------------------
# Create a new, empty record
# -------------------------------------------------------------------------
@@ -1646,87 +1739,6 @@
# -------------------------------------------------------------------------
- # Record navigation
- # -------------------------------------------------------------------------
-
- def first_record(self):
- """
- Jumps to the first record in the current block.
- """
- if self._currentBlock is not None:
- self._currentBlock.first_record()
-
- # -------------------------------------------------------------------------
-
- def prev_record(self):
- """
- Steps to the previous record in the current block.
- """
- if self._currentBlock is not None:
- self._currentBlock.prev_record()
-
- # -------------------------------------------------------------------------
-
- def next_record(self):
- """
- Steps to the next record in the current block.
- """
- if self._currentBlock is not None:
- self._currentBlock.next_record()
-
- # -------------------------------------------------------------------------
-
- def last_record(self):
- """
- Jumps to the last record in the current block.
- """
- if self._currentBlock is not None:
- self._currentBlock.last_record()
-
- # -------------------------------------------------------------------------
-
- def ask_record(self):
- """
- Ask the user for a record number to jump to in the current block.
- """
-
- if self._currentBlock is None:
- return
-
- fields = [(u_("Recordnumber"), 'record', 'string',
- str(self._currentBlock._currentRecord + 1), None, [])]
-
- while True:
- result = self._instance._uiinstance.getInput(u_("Jump to record"),
- fields)
- if result is None:
- return
- try:
- count = int(result['record'])
- # Positive start to count by zero
- if count > 0: count -= 1
- break
- except ValueError:
- fields = [
- (u_("Invalid numeric value entered."), None, 'warning',
- None, None, []),
- (u_("Recordnumber"), 'record', 'string',
- result['record'], None, [])]
-
- self._currentBlock.goto_record(count)
-
- # -------------------------------------------------------------------------
-
- def jump_records(self, count):
- """
- Jumps to a given record in the current block.
- @param count: number of records to move
- """
- if self._currentBlock is not None:
- self._currentBlock.jump_records(count)
-
-
- # -------------------------------------------------------------------------
# Toggles insert mode
# -------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8656 - trunk/gnue-forms/src,
reinhard <=