commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r9142 - trunk/gnue-forms/src/input/displayHandlers


From: reinhard
Subject: [gnue] r9142 - trunk/gnue-forms/src/input/displayHandlers
Date: Tue, 12 Dec 2006 09:05:41 -0600 (CST)

Author: reinhard
Date: 2006-12-12 09:05:41 -0600 (Tue, 12 Dec 2006)
New Revision: 9142

Modified:
   trunk/gnue-forms/src/input/displayHandlers/Cursor.py
Log:
More cleanup.


Modified: trunk/gnue-forms/src/input/displayHandlers/Cursor.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-12-12 
14:58:01 UTC (rev 9141)
+++ trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-12-12 
15:05:41 UTC (rev 9142)
@@ -65,7 +65,6 @@
     self.modified = False         # Have we been modified??
     self.work = ""                # Our working value
     self.display = ""             # The latest display-formatted value
-    self._loadedAllowedValues = False # Have allowed values been loaded
     self.subEventHandler = subEventHandler
 
     # Cursor based vars
@@ -179,10 +178,6 @@
     # should not be True at that moment.
     self.editing = False
 
-    if not self._loadedAllowedValues:
-      self.field.allowedValues()
-      self._loadedAllowedValues = True
-
     self._selection1 = None
 
     if self.modified:
@@ -580,55 +575,10 @@
     self._moveCursorToEnd(event, True)
     self._selection2 = self._cursor
 
-  # --------------------------------------------------------------------------
-  # Internal methods
-  # --------------------------------------------------------------------------
+  # -------------------------------------------------------------------------
+  # Parse the display string
+  # -------------------------------------------------------------------------
 
-  def _buildDisplayHelper(self, value, editing):
-    """
-    Builds a string that represents what should be 
-    displayed for the field.
-    
-    An entry can have two different displayable values.  The value
-    to be displayed when the entry isn't the one currently being 
-    edited.  And the value that is displayed while the entry is being 
-    edited.  An example of this would be entries displaying date
-    information
-    
-    @param value: The raw value to be displayed
-    @param editing: If true the format the display string as if it
-                    were to be edited.
-    """
-    if self.field._allowedValues:
-      # TODO: Verify this comment
-      # The field associated with this field is most likely
-      # a dropdown and so only valid dropdown values should be displayed
-      if editing:
-        val = value.lower ()
-        
-        for disp in self.field._allowedValuesDescr:
-          if disp [:len (val)].lower () == val:
-            revVal = self.field._allowedValuesReverse [disp]
-            return self.field._allowedValues [revVal]
-
-        return value
-
-      if self.field._allowedValues.has_key ("%s" % value):
-        return self.field._allowedValues ["%s" % value]
-      else:
-        return ""
-
-    else:
-      if value == None:
-        return ""
-      else:
-        return "%s" % value
-
-
-    # -------------------------------------------------------------------------
-    # Parse the display string
-    # -------------------------------------------------------------------------
-
   def parse_display(self, display):
 
     if display == '':
@@ -637,9 +587,9 @@
         return display
 
 
-    # -------------------------------------------------------------------------
-    # Build the display string
-    # -------------------------------------------------------------------------
+  # -------------------------------------------------------------------------
+  # Build the display string
+  # -------------------------------------------------------------------------
 
   def build_display(self, value, editing):
         """





reply via email to

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