commit-gnue
[Top][All Lists]
Advanced

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

gnue/forms doc/techref.lyx src/GFInstance.py sr...


From: James Thompson
Subject: gnue/forms doc/techref.lyx src/GFInstance.py sr...
Date: Sun, 10 Feb 2002 20:13:18 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     James Thompson <address@hidden> 02/02/10 20:13:18

Modified files:
        forms/doc      : techref.lyx 
        forms/src      : GFInstance.py GFParser.py 
        forms/src/GFObjects: GFBlock.py 

Log message:
        Added restrictInsert, restrictDelete attributes to <block>
        Implemented logic for <entry>'s editOnNull

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/doc/techref.lyx.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFInstance.py.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFParser.py.diff?tr1=1.60&tr2=1.61&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFObjects/GFBlock.py.diff?tr1=1.33&tr2=1.34&r1=text&r2=text

Patches:
Index: gnue/forms/doc/techref.lyx
diff -c gnue/forms/doc/techref.lyx:1.12 gnue/forms/doc/techref.lyx:1.13
*** gnue/forms/doc/techref.lyx:1.12     Sat Jan 19 00:34:26 2002
--- gnue/forms/doc/techref.lyx  Sun Feb 10 20:13:18 2002
***************
*** 1425,1431 ****
  
  
  \begin_inset  Tabular
! <lyxtabular version="2" rows="7" columns="4">
  <features rotate="false" islongtable="false" endhead="0" endfirsthead="0" 
endfoot="0" endlastfoot="0">
  <column alignment="center" valignment="top" leftline="true" rightline="false" 
width="" special="">
  <column alignment="center" valignment="top" leftline="true" rightline="false" 
width="" special="">
--- 1425,1431 ----
  
  
  \begin_inset  Tabular
! <lyxtabular version="2" rows="8" columns="4">
  <features rotate="false" islongtable="false" endhead="0" endfirsthead="0" 
endfoot="0" endlastfoot="0">
  <column alignment="center" valignment="top" leftline="true" rightline="false" 
width="" special="">
  <column alignment="center" valignment="top" leftline="true" rightline="false" 
width="" special="">
***************
*** 1568,1574 ****
  
  
  \lang english
! readonly
  \end_inset 
  </cell>
  <cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" 
usebox="none" width="" special="">
--- 1568,1574 ----
  
  
  \lang english
! restrictDelete
  \end_inset 
  </cell>
  <cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" 
usebox="none" width="" special="">
***************
*** 1598,1605 ****
  
  
  \lang english
! If set then none of the entry widgets inside this block can be modified
   via the user interface.
  \end_inset 
  </cell>
  </row>
--- 1598,1640 ----
  
  
  \lang english
! If set then the user will be unable to request that a record be deleted
   via the user interface.
+ \end_inset 
+ </cell>
+ </row>
+ <row topline="true" bottomline="false" newpage="false">
+ <cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" 
usebox="none" width="" special="">
+ \begin_inset Text
+ 
+ \layout Standard
+ 
+ restrictInsert
+ \end_inset 
+ </cell>
+ <cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" 
usebox="none" width="" special="">
+ \begin_inset Text
+ 
+ \layout Standard
+ 
+ boolean
+ \end_inset 
+ </cell>
+ <cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" 
usebox="none" width="" special="">
+ \begin_inset Text
+ 
+ \layout Standard
+ 
+ none
+ \end_inset 
+ </cell>
+ <cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="true" rotate="false" 
usebox="none" width="" special="">
+ \begin_inset Text
+ 
+ \layout Standard
+ 
+ If set then the user will be unable to request that new records be inserted
+  into the block
  \end_inset 
  </cell>
  </row>
Index: gnue/forms/src/GFInstance.py
diff -c gnue/forms/src/GFInstance.py:1.26 gnue/forms/src/GFInstance.py:1.27
*** gnue/forms/src/GFInstance.py:1.26   Thu Jan 31 00:41:31 2002
--- gnue/forms/src/GFInstance.py        Sun Feb 10 20:13:18 2002
***************
*** 246,256 ****
    # Tells the form to mark a record for delete
    #
    def deleteRecord(self, event):
!     if not self._form.readonly:
!         self._form.deleteRecord()
!         self.updateRecordStatus()
!     else:
        self.dispatchEvent(GFEvent('formALERT','Form is readonly'))
  
                            
    #
--- 246,258 ----
    # Tells the form to mark a record for delete
    #
    def deleteRecord(self, event):
!     if self._form.readonly:
        self.dispatchEvent(GFEvent('formALERT','Form is readonly'))
+     elif self._form._currentBlock.restrictDelete:
+       self.dispatchEvent(GFEvent('formALERT','Block does not allow delete'));
+     else:
+       self._form.deleteRecord()
+       self.updateRecordStatus()
  
                            
    #
***************
*** 259,271 ****
    # Tells the form to create a new record
    #
    def newRecord(self, event):
!     if not self._form.readonly:
        self._form.newRecord()
        
self.dispatchEvent(GFEvent('gotoENTRY',{'object':self._form._currentEntry}))
        self.updateRecordCounter()
        self.updateRecordStatus()
-     else:
-       self.dispatchEvent(GFEvent('formALERT','Form is readonly'))
  
  
    #
--- 261,275 ----
    # Tells the form to create a new record
    #
    def newRecord(self, event):
!     if self._form.readonly:
!       self.dispatchEvent(GFEvent('formALERT','Form is readonly'))
!     elif self._form._currentBlock.restrictInsert:
!       self.dispatchEvent(GFEvent('formALERT','Block does not allow insert')); 
     
!     else:
        self._form.newRecord()
        
self.dispatchEvent(GFEvent('gotoENTRY',{'object':self._form._currentEntry}))
        self.updateRecordCounter()
        self.updateRecordStatus()
  
  
    #
***************
*** 389,400 ****
    def keyPress(self, event):
      GDebug.printMesg(10, "Keypress event %s"%event.data)
      if (self._form._currentEntry != None):
!       if not self._form._currentEntry.readonly or 
self._form._currentBlock.mode=='query':
          if self._form.keyPress(event.data):
            self.dispatchEvent(GFEvent('updateENTRY',self._form._currentEntry));
            self.updateRecordStatus()
-       else:
-         self.dispatchEvent(GFEvent('formALERT','Field is readonly'))
  
    #
    # removeCharacter
--- 393,408 ----
    def keyPress(self, event):
      GDebug.printMesg(10, "Keypress event %s"%event.data)
      if (self._form._currentEntry != None):
!       if (self._form._currentEntry.readonly and not 
self._form._currentBlock.mode=='query'):
!         self.dispatchEvent(GFEvent('formALERT','Field is readonly'))
!       elif self._form._currentEntry.editOnNull and \
!            len(self._form._currentEntry.getValue()) > 0 and \
!            not self._form._currentBlock._resultSet.current.isPending():
!         self.dispatchEvent(GFEvent('formALERT','Field cannot be modified 
after entry'));
!       else:
          if self._form.keyPress(event.data):
            self.dispatchEvent(GFEvent('updateENTRY',self._form._currentEntry));
            self.updateRecordStatus()
  
    #
    # removeCharacter
Index: gnue/forms/src/GFObjects/GFBlock.py
diff -c gnue/forms/src/GFObjects/GFBlock.py:1.33 
gnue/forms/src/GFObjects/GFBlock.py:1.34
*** gnue/forms/src/GFObjects/GFBlock.py:1.33    Sun Feb 10 18:39:43 2002
--- gnue/forms/src/GFObjects/GFBlock.py Sun Feb 10 20:13:18 2002
***************
*** 230,236 ****
        #self._recordCount = self._resultSet.getCacheCount()
        self._recordCount = self._resultSet.getRecordCount()
        self.switchRecord(1)
!     elif int(GConfig.get('autocreate')) and not self.isEmpty():
        self.newRecord()
  
    def prevRecord(self):
--- 230,236 ----
        #self._recordCount = self._resultSet.getCacheCount()
        self._recordCount = self._resultSet.getRecordCount()
        self.switchRecord(1)
!     elif int(GConfig.get('autocreate')) and not self.isEmpty() and not 
self.restrictInsert:
        self.newRecord()
  
    def prevRecord(self):
Index: gnue/forms/src/GFParser.py
diff -c gnue/forms/src/GFParser.py:1.60 gnue/forms/src/GFParser.py:1.61
*** gnue/forms/src/GFParser.py:1.60     Tue Feb  5 00:45:53 2002
--- gnue/forms/src/GFParser.py  Sun Feb 10 20:13:18 2002
***************
*** 165,170 ****
--- 165,176 ----
              'transparentBlock':{
                 'Typecast': GTypecast.boolean,
                 'Default': 0 },
+             'restrictDelete':{
+                'Typecast': GTypecast.boolean,
+                'Default': 0 },
+             'restrictInsert':{
+                'Typecast': GTypecast.boolean,
+                'Default': 0 },
              'datasource': {
                 'References': (('datasource','name'),),
                 'Typecast': GTypecast.name } },



reply via email to

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