commit-gnue
[Top][All Lists]
Advanced

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

gnue/gnuef/src GFForm.py GFParser.py GFObjects/...


From: Jason Cater
Subject: gnue/gnuef/src GFForm.py GFParser.py GFObjects/...
Date: Thu, 12 Jul 2001 11:38:19 -0700

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/07/12 11:38:19

Modified files:
        gnuef/src      : GFForm.py GFParser.py 
        gnuef/src/GFObjects: GFEntry.py 

Log message:
        Converted entry: uppercase & lowercase to case=<upper|lower|mixed>; 
converted numeric="" to typecast=<text|number|date>; added hacks to make old 
forms work... Note that if you open an old form in Designer and save, it will 
convert to new format.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFForm.py.diff?cvsroot=OldCVS&tr1=1.110&tr2=1.111&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFParser.py.diff?cvsroot=OldCVS&tr1=1.46&tr2=1.47&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFEntry.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: gnue/gnuef/src/GFForm.py
diff -u gnue/gnuef/src/GFForm.py:1.110 gnue/gnuef/src/GFForm.py:1.111
--- gnue/gnuef/src/GFForm.py:1.110      Wed Jul 11 16:06:46 2001
+++ gnue/gnuef/src/GFForm.py    Thu Jul 12 11:38:19 2001
@@ -510,15 +510,15 @@
           modified = 1
           return modified
           
-        if self._currentEntry.lowercase:
+        if self._currentEntry._lowercase:
           value = string.lower(value)
-        if self._currentEntry.uppercase:
+        if self._currentEntry._uppercase:
           value = string.upper(value)
         if hasattr(self._currentEntry,'max_length'):
           if len(currentvalue) >= int(self._currentEntry.max_length):
             return modified
           
-        if self._currentEntry.numeric and self._currentBlock.mode == 'normal':
+        if self._currentEntry._numeric and self._currentBlock.mode == 'normal':
           if not (value in string.digits or value in '.'):
             return modified
   
Index: gnue/gnuef/src/GFObjects/GFEntry.py
diff -u gnue/gnuef/src/GFObjects/GFEntry.py:1.3 
gnue/gnuef/src/GFObjects/GFEntry.py:1.4
--- gnue/gnuef/src/GFObjects/GFEntry.py:1.3     Wed Jul 11 21:58:49 2001
+++ gnue/gnuef/src/GFObjects/GFEntry.py Thu Jul 12 11:38:19 2001
@@ -58,8 +58,35 @@
     self.height = float(GConfig.get('widgetHeight'))
     self.width = float(GConfig.get('widgetWidth'))
     self._value=""
+    self._uppercase = 0
+    self._lowercase = 0
+    self._numeric = 0
+    self.typecast="text"
+    self.case="mixed"
 
+
+  def buildObject(self): 
+    # Convert deprecated attributes
+    if hasattr(self,'numeric') and self.numeric: 
+      del self.numeric
+      self.typecast = 'number'
+    if hasattr(self,'uppercase') and self.uppercase: 
+      del self.uppercase
+      self.case = 'upper' 
+    elif hasattr(self,'lowercase') and self.lowercase: 
+      del self.lowercase
+      self.case = 'lower' 
+
+
   def initialize(self):
+
+    if self.typecast == 'number': 
+      self._numeric = 1
+    if self.case == 'upper': 
+      self._uppercase = 1
+    elif self.case == 'lower': 
+      self._lowercase = 1
+
     self._cursorPosition = len(self._value)
     self._block = self.findParentOfType('GFBlock')
     if not hasattr(self,'field'):
Index: gnue/gnuef/src/GFParser.py
diff -u gnue/gnuef/src/GFParser.py:1.46 gnue/gnuef/src/GFParser.py:1.47
--- gnue/gnuef/src/GFParser.py:1.46     Wed Jul  4 17:23:55 2001
+++ gnue/gnuef/src/GFParser.py  Thu Jul 12 11:38:19 2001
@@ -145,7 +145,7 @@
             'host': {
                'Required': 1, 
                'Typecast': GTypecast.text } }, 
-         'Deprecated': 1, 
+         'Deprecated': 'Use the external connections file format.', 
          'ParentTags': ('form',) },
 
       'datasource': { 
@@ -234,18 +234,26 @@
                'Typecast': GTypecast.whole }, 
             'visibleCount':{
                'Typecast': GTypecast.whole, 
-               'Deprecated': 1, 
+               'Deprecated': 'Use the block "row" attribute instead.', 
                'Default': 1 }, 
             'readonly': {
                'Typecast': GTypecast.boolean, 
                'Default': 0   }, 
+            'required': {
+               'Description': 'This object cannot have an empty value prior '
+                              'to a commit.',
+               'Typecast': GTypecast.boolean, 
+               'Default': 0   }, 
             'uppercase': {
+               'Deprecated': 'Use case="upper" instead.', 
                'Typecast': GTypecast.boolean, 
                'Default': 0   }, 
             'lowercase': {
+               'Deprecated': 'Use case="lower" instead.', 
                'Typecast': GTypecast.boolean, 
                'Default': 0   }, 
             'numeric': {
+               'Deprecated': 'Use typecast="number" instead', 
                'Typecast': GTypecast.boolean, 
                'Default': 0   }, 
             'hidden': {
@@ -258,6 +266,20 @@
                   'dropdown': {}, 
                   'checkbox': {} }, 
                'Default': 'default'}, 
+            'case': {
+               'Typecast': GTypecast.name, 
+               'ValueSet': { 
+                  'mixed': {}, 
+                  'upper': {}, 
+                  'lower': {} }, 
+               'Default': 'mixed'}, 
+            'typecast': {
+               'Typecast': GTypecast.name, 
+               'ValueSet': { 
+                  'text': {}, 
+                  'number': {}, 
+                  'date': {} }, 
+               'Default': 'text'}, 
             'value': {
                'Typecast': GTypecast.text }, 
             'foreign_key': {
@@ -270,6 +292,24 @@
                'Typecast': GTypecast.text }, 
             'sloppyQuery': {
                'Typecast': GTypecast.text }, 
+            'ignoreCaseOnQuery': {
+               'Typecast': GTypecast.boolean, 
+               'Default': 0 }, 
+            'editOnNull': {
+               'Description': 'Only allow this object to be edited if it ' 
+                              'is currently empty.',
+               'Typecast': GTypecast.boolean, 
+               'Default': 0 }, 
+            'no_ltrim': {
+               'Description': 'Suppress trimming of extraneous space at '
+                              'beginning of user input.',
+               'Typecast': GTypecast.boolean, 
+               'Default': 0 }, 
+            'no_rtrim': {
+               'Description': 'Suppress trimming of extraneous space at end '
+                              'of user input.',
+               'Typecast': GTypecast.boolean, 
+               'Default': 0 }, 
             'x': {
                'Required': 1, 
                'Typecast': GTypecast.whole }, 
@@ -348,7 +388,7 @@
                'Unique': 1, 
                'Typecast': GTypecast.name }, 
             'id': {
-               'Deprecated': 1,   # DEPRECATED: Use name instead
+               'Deprecated': 'Use name instead.',   # DEPRECATED: Use name 
instead
                'Typecast': GTypecast.name },
             'type': {
                'Typecast': GTypecast.name }, 
@@ -394,7 +434,7 @@
                'Typecast': GTypecast.text } }, 
          'MixedContent': 1, 
          'SingleInstance': 1, 
-         'Deprecated': 1, 
+         'Deprecated': 'Use the <form> attribute "title" instead.', 
          'ParentTags': ('options',) },
 
       'name': { 
@@ -423,7 +463,7 @@
                'Typecast': GTypecast.text } },
          'MixedContent': 1, 
          'SingleInstance': 1, 
-         'Deprecated': 1, 
+         'Deprecated': 'Use the <form> attribute "height" instead.', 
          'ParentTags': None },
 
       'width': { 
@@ -438,7 +478,7 @@
                'Typecast': GTypecast.text } },
          'MixedContent': 1, 
          'SingleInstance': 1, 
-         'Deprecated': 1, 
+         'Deprecated': 'Use the <form> attribute "width" instead.', 
          'ParentTags': ('options',) },
 
       'author': { 



reply via email to

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