commit-gnue
[Top][All Lists]
Advanced

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

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


From: reinhard
Subject: [gnue] r9115 - trunk/gnue-forms/src/input/displayHandlers
Date: Mon, 4 Dec 2006 12:26:38 -0600 (CST)

Author: reinhard
Date: 2006-12-04 12:26:37 -0600 (Mon, 04 Dec 2006)
New Revision: 9115

Modified:
   trunk/gnue-forms/src/input/displayHandlers/Cursor.py
   trunk/gnue-forms/src/input/displayHandlers/Dropdown.py
   trunk/gnue-forms/src/input/displayHandlers/Listbox.py
   trunk/gnue-forms/src/input/displayHandlers/Text.py
Log:
No need to update the display on endEdit - the field will do that. Now
_buildDisplay is only called in edit mode any more, so we do not need to check
for edit mode there.


Modified: trunk/gnue-forms/src/input/displayHandlers/Cursor.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-12-04 
18:10:47 UTC (rev 9114)
+++ trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-12-04 
18:26:37 UTC (rev 9115)
@@ -215,7 +215,6 @@
     if self.modified:
       try:
         self.__updateFieldValue()
-        self._buildDisplay()
       except:
         self.editing = True
         raise
@@ -656,15 +655,8 @@
   def _buildDisplay(self):
     """
     Private function that rebuilds the display string.
-    
-    A wrapper function that calls the private _buildDisplayHelper 
-    with the appropriate arguments for the mode the display handler is 
-    currently in.  (Edit mode or not edit mode :)
     """
-    if self.editing:
-      self.display = self._buildDisplayHelper(self.work, True)
-    else:
-      self.display = self._buildDisplayHelper(self.value, False)
+    self.display = self._buildDisplayHelper(self.work, True)
 
 
     # -------------------------------------------------------------------------
@@ -673,6 +665,10 @@
 
   def parse_display(self, display):
 
+        if self.field._allowedValues:
+            for disp in self.field._allowedValuesDescr:
+                if disp.startswith(display):
+                    return disp
         return display
 
 

Modified: trunk/gnue-forms/src/input/displayHandlers/Dropdown.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Dropdown.py      2006-12-04 
18:10:47 UTC (rev 9114)
+++ trunk/gnue-forms/src/input/displayHandlers/Dropdown.py      2006-12-04 
18:26:37 UTC (rev 9115)
@@ -101,9 +101,6 @@
       return ""
 
   def _buildDisplay(self):
-    if self.editing:
-      self.display = self._buildDisplayHelper(self.work, True)
-      if self._cursor > len(self.work):
-        self.work = self.display
-    else:
-      self.display = self._buildDisplayHelper(self.value, False)
+    self.display = self._buildDisplayHelper(self.work, True)
+    if self._cursor > len(self.work):
+      self.work = self.display

Modified: trunk/gnue-forms/src/input/displayHandlers/Listbox.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Listbox.py       2006-12-04 
18:10:47 UTC (rev 9114)
+++ trunk/gnue-forms/src/input/displayHandlers/Listbox.py       2006-12-04 
18:26:37 UTC (rev 9115)
@@ -93,12 +93,9 @@
       return ""
 
   def _buildDisplay(self):
-    if self.editing:
-      self.display = self._buildDisplayHelper(self.work, True)
-      if self._cursor > len(self.work):
-        self.work = self.display
-    else:
-      self.display = self._buildDisplayHelper(self.value, False)
+    self.display = self._buildDisplayHelper(self.work, True)
+    if self._cursor > len(self.work):
+      self.work = self.display
 
 
   def _replaceText(self, event):

Modified: trunk/gnue-forms/src/input/displayHandlers/Text.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Text.py  2006-12-04 18:10:47 UTC 
(rev 9114)
+++ trunk/gnue-forms/src/input/displayHandlers/Text.py  2006-12-04 18:26:37 UTC 
(rev 9115)
@@ -37,4 +37,4 @@
   """
   def __init__(self, entry, eventHandler, subEventHandler, displayMask,
                inputMask):
-    BaseCursor.__init__(self, entry, eventHandler, subEventHandler)
\ No newline at end of file
+    BaseCursor.__init__(self, entry, eventHandler, subEventHandler)





reply via email to

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