commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue forms/src/uidrivers/wx/UIdriver.py common/...


From: Derek Neighbors
Subject: gnue forms/src/uidrivers/wx/UIdriver.py common/...
Date: Thu, 28 Mar 2002 02:56:52 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Derek Neighbors <address@hidden>        02/03/28 02:56:52

Modified files:
        forms/src/uidrivers/wx: UIdriver.py 
        common/etc     : sample.gnue.conf 
        forms/src      : GFInstance.py GFForm.py 
        forms/src/GFObjects: GFBlock.py 

Log message:
        ** Added first and last to menu choices and corresponding 
functionality.  Seems to work, was late so couldnt test really well.  Also, 
still needs the 'key bindings done'.  Note: this had a change to gnue.conf so 
you will need to update form the sample.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/uidrivers/wx/UIdriver.py.diff?cvsroot=OldCVS&tr1=1.158&tr2=1.159&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/etc/sample.gnue.conf.diff?cvsroot=OldCVS&tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFInstance.py.diff?cvsroot=OldCVS&tr1=1.38&tr2=1.39&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFForm.py.diff?cvsroot=OldCVS&tr1=1.158&tr2=1.159&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFObjects/GFBlock.py.diff?cvsroot=OldCVS&tr1=1.40&tr2=1.41&r1=text&r2=text

Patches:
Index: gnue/common/etc/sample.gnue.conf
diff -c gnue/common/etc/sample.gnue.conf:1.19 
gnue/common/etc/sample.gnue.conf:1.20
*** gnue/common/etc/sample.gnue.conf:1.19       Fri Mar  1 14:05:48 2002
--- gnue/common/etc/sample.gnue.conf    Thu Mar 28 02:56:51 2002
***************
*** 82,88 ****
  msg_commit=Save all changes to database.
  msg_rollback=Discard all changes.
  msg_exit=Leave the application.
! msg_next=Navigate to next record in memory.
  msg_previous=Navigate to previous record in memory.
  msg_insert=Create a new record for data input.
  msg_delete=Mark record for removal at next commit.
--- 82,89 ----
  msg_commit=Save all changes to database.
  msg_rollback=Discard all changes.
  msg_exit=Leave the application.
! msg_first=Navigate to first record in memory.
! msg_last=Navigate to last record in memory.
  msg_previous=Navigate to previous record in memory.
  msg_insert=Create a new record for data input.
  msg_delete=Mark record for removal at next commit.
Index: gnue/forms/src/GFForm.py
diff -c gnue/forms/src/GFForm.py:1.158 gnue/forms/src/GFForm.py:1.159
*** gnue/forms/src/GFForm.py:1.158      Fri Mar  1 00:43:15 2002
--- gnue/forms/src/GFForm.py    Thu Mar 28 02:56:51 2002
***************
*** 875,880 ****
--- 875,892 ----
        return
      self._currentBlock.prevRecord()
  
+   def firstRecord(self):
+     if self._currentBlock.mode == 'query':
+       GDebug.printMesg(5,'Cannot go to first record: in query mode!')
+       return
+     self._currentBlock.firstRecord()
+ 
+   def lastRecord(self):
+     if self._currentBlock.mode == 'query':
+       GDebug.printMesg(5,'Cannot go to last record: in query mode!')
+       return
+     self._currentBlock.lastRecord()
+ 
    def nextRecord(self):
      if self._currentBlock.mode == 'query':
        GDebug.printMesg(5,'Cannot go to next record: in query mode!')
Index: gnue/forms/src/GFInstance.py
diff -c gnue/forms/src/GFInstance.py:1.38 gnue/forms/src/GFInstance.py:1.39
*** gnue/forms/src/GFInstance.py:1.38   Tue Feb 26 22:29:56 2002
--- gnue/forms/src/GFInstance.py        Thu Mar 28 02:56:51 2002
***************
*** 66,71 ****
--- 66,73 ----
                             'requestPREVENTRY'    : self.previousEntry,
                             'requestNEXTBLOCK'    : self.nextBlock,
                             'requestPREVBLOCK'    : self.previousBlock,
+                            'requestFIRSTRECORD'  : self.firstRecord,
+                            'requestLASTRECORD'   : self.lastRecord,
                             'requestPREVRECORD'   : self.prevRecord,
                             'requestNEXTRECORD'   : self.nextRecord,
                             'requestRECORDNUMBER' : self.jumpToRecord,
***************
*** 273,278 ****
--- 275,319 ----
      
self.dispatchEvent(GFEvent('gotoENTRY',{'object':self._form._currentEntry}))
      self.updateRecordCounter()
      self.updateRecordStatus()
+ 
+ 
+   #
+   # firstRecord
+   #
+   # Called enever an event source has requested that the
+   # form advance to the first record in memory
+   #
+   def firstRecord(self, event):
+     if not self._form.endEditing():
+       return
+     message = self._form.firstRecord()
+     if message:
+       messageBox = GFMsgBox(self,message)
+       messageBox.show()
+       return
+     
self.dispatchEvent(GFEvent('gotoENTRY',{'object':self._form._currentEntry}))
+     self.updateRecordCounter()
+     self.updateRecordStatus()
+ 
+ 
+   #
+   # lastRecord
+   #
+   # Called enever an event source has requested that the
+   # form advance to the last record in memory
+   #
+   def lastRecord(self, event):
+     if not self._form.endEditing():
+       return
+     message = self._form.lastRecord()
+     if message:
+       messageBox = GFMsgBox(self,message)
+       messageBox.show()
+       return
+     
self.dispatchEvent(GFEvent('gotoENTRY',{'object':self._form._currentEntry}))
+     self.updateRecordCounter()
+     self.updateRecordStatus()
+ 
  
    #
    # jumpToRecord
Index: gnue/forms/src/GFObjects/GFBlock.py
diff -c gnue/forms/src/GFObjects/GFBlock.py:1.40 
gnue/forms/src/GFObjects/GFBlock.py:1.41
*** gnue/forms/src/GFObjects/GFBlock.py:1.40    Fri Mar  1 14:05:48 2002
--- gnue/forms/src/GFObjects/GFBlock.py Thu Mar 28 02:56:52 2002
***************
*** 237,242 ****
--- 237,254 ----
      elif int(GConfig.get('autocreate')) and not self.isEmpty() and not 
self.restrictInsert:
        self.newRecord()
  
+   def lastRecord(self):
+     self._resultSet.lastRecord()
+     self.switchRecord(0)
+ #    end = self._resultSet.lastRecord() - self._resultSet.getRecordNumber() 
+ #    self._currentRecord = self._resultSet.getRecordNumber()
+ #    self.switchRecord(end)
+ 
+ 
+   def firstRecord(self):
+     self._resultSet.firstRecord()
+     self.switchRecord(0)
+ 
    def prevRecord(self):
      if self._resultSet.prevRecord():
        self.switchRecord(-1)
Index: gnue/forms/src/uidrivers/wx/UIdriver.py
diff -c gnue/forms/src/uidrivers/wx/UIdriver.py:1.158 
gnue/forms/src/uidrivers/wx/UIdriver.py:1.159
*** gnue/forms/src/uidrivers/wx/UIdriver.py:1.158       Fri Mar  1 23:10:24 2002
--- gnue/forms/src/uidrivers/wx/UIdriver.py     Thu Mar 28 02:56:51 2002
***************
*** 224,248 ****
      EVT_MENU(self._wxapp, 403, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestPASTE')))
  
      dataMenu = wxMenu()
!     dataMenu.Append( 201, "Next Record             
(Up)",GConfig.get('msg_next'))
!     EVT_MENU(self._wxapp, 201, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestNEXTRECORD')))
!     dataMenu.Append( 202, "Previous Record   
(Down)",GConfig.get('msg_previous'))
      EVT_MENU(self._wxapp, 202, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestPREVRECORD')))
!     dataMenu.Append( 209, "Jump to Record...     
(F2)",GConfig.get('msg_jump'))
      EVT_MENU(self._wxapp, 209, _PROMPTFORRECORD)
!     dataMenu.Append( 203, "New Record           
(F12)",GConfig.get('msg_insert'))
      EVT_MENU(self._wxapp, 203, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestNEWRECORD')))
!     dataMenu.Append( 204, "Delete Record          
(F5)",GConfig.get('msg_delete'))
      EVT_MENU(self._wxapp, 204, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestMARKFORDELETE')))
      dataMenu.AppendSeparator()
!     dataMenu.Append( 205, "Next Block           
(PgDn)",GConfig.get('msg_next_block'))
      EVT_MENU(self._wxapp, 205, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestNEXTBLOCK')))
!     dataMenu.Append( 206, "Previous Block     
(PgUp)",GConfig.get('msg_previous_block'))
      EVT_MENU(self._wxapp, 206, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestPREVBLOCK')))
      dataMenu.AppendSeparator()
!     dataMenu.Append( 207, "Enter Query            
(F8)",GConfig.get('msg_query_prep'))
      EVT_MENU(self._wxapp, 207, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestENTERQUERY')))
!     dataMenu.Append( 208, "Execute Query        (F9)", 
GConfig.get('msg_query'))
      EVT_MENU(self._wxapp, 208, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestEXECQUERY')))
  
      helpMenu = wxMenu()
--- 224,252 ----
      EVT_MENU(self._wxapp, 403, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestPASTE')))
  
      dataMenu = wxMenu()
!     dataMenu.Append( 211, "First Record        
(Shft+Up)",GConfig.get('msg_first'))
!     EVT_MENU(self._wxapp, 211, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestFIRSTRECORD')))
!     dataMenu.Append( 202, "Previous Record         
(Up)",GConfig.get('msg_previous'))
      EVT_MENU(self._wxapp, 202, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestPREVRECORD')))
!     dataMenu.Append( 201, "Next Record           
(Down)",GConfig.get('msg_next'))
!     EVT_MENU(self._wxapp, 201, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestNEXTRECORD')))
!     dataMenu.Append( 210, "Last Record    
(Shft+Down)",GConfig.get('msg_last'))
!     EVT_MENU(self._wxapp, 210, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestLASTRECORD')))
!     dataMenu.Append( 209, "Jump to Record...        
(F2)",GConfig.get('msg_jump'))
      EVT_MENU(self._wxapp, 209, _PROMPTFORRECORD)
!     dataMenu.Append( 203, "New Record              
(F12)",GConfig.get('msg_insert'))
      EVT_MENU(self._wxapp, 203, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestNEWRECORD')))
!     dataMenu.Append( 204, "Delete Record             
(F5)",GConfig.get('msg_delete'))
      EVT_MENU(self._wxapp, 204, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestMARKFORDELETE')))
      dataMenu.AppendSeparator()
!     dataMenu.Append( 205, "Next Block              
(PgDn)",GConfig.get('msg_next_block'))
      EVT_MENU(self._wxapp, 205, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestNEXTBLOCK')))
!     dataMenu.Append( 206, "Previous Block       
(PgUp)",GConfig.get('msg_previous_block'))
      EVT_MENU(self._wxapp, 206, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestPREVBLOCK')))
      dataMenu.AppendSeparator()
!     dataMenu.Append( 207, "Enter Query             
(F8)",GConfig.get('msg_query_prep'))
      EVT_MENU(self._wxapp, 207, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestENTERQUERY')))
!     dataMenu.Append( 208, "Execute Query           (F9)", 
GConfig.get('msg_query'))
      EVT_MENU(self._wxapp, 208, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestEXECQUERY')))
  
      helpMenu = wxMenu()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]