commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r9068 - in trunk/gnue-forms/src: input/displayHandlers uidrivers/


From: reinhard
Subject: [gnue] r9068 - in trunk/gnue-forms/src: input/displayHandlers uidrivers/wx26/widgets
Date: Mon, 27 Nov 2006 05:54:11 -0600 (CST)

Author: reinhard
Date: 2006-11-27 05:54:10 -0600 (Mon, 27 Nov 2006)
New Revision: 9068

Modified:
   trunk/gnue-forms/src/input/displayHandlers/Cursor.py
   trunk/gnue-forms/src/input/displayHandlers/Dropdown.py
   trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
Log:
Let the dropdown also honor the position parameter in the replaceVALUE event.


Modified: trunk/gnue-forms/src/input/displayHandlers/Cursor.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-11-27 
10:29:10 UTC (rev 9067)
+++ trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-11-27 
11:54:10 UTC (rev 9068)
@@ -331,7 +331,8 @@
 
   def _replace_text(self, event):
 
-      self.work = ''
+      self._selection1 = 0
+      self._selection2 = len(self.display)
       self._addText(event)
       if hasattr(event, 'position'):
           self._cursor = event.position

Modified: trunk/gnue-forms/src/input/displayHandlers/Dropdown.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Dropdown.py      2006-11-27 
10:29:10 UTC (rev 9067)
+++ trunk/gnue-forms/src/input/displayHandlers/Dropdown.py      2006-11-27 
11:54:10 UTC (rev 9068)
@@ -105,24 +105,3 @@
         self.work = self.display
     else:
       self.display = self._buildDisplayHelper(self.value, False)
-
-
-  def _replace_text(self, event):
-    if not self.editing:
-      return
-
-    self._selection1 = 0
-    self._selection2 = len (self.display)
-    self._addText (event)
-
-# TODO: Kills dropdown handling with keyboard on win32
-# TODO: needs more work :(
-#    self.endEdit(event) # Hack: allows dropdowns to change field
-                        # value immediately (causes post-change
-                        # on the field to fire).
-                        # I don't think it'll hurt anything.
-                        # if it does then we'll need to pull
-                        # the logic from FieldDisplayHandler.endEdit
-                        # and add here.  - jamest
-
-

Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-11-27 
10:29:10 UTC (rev 9067)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-11-27 
11:54:10 UTC (rev 9068)
@@ -308,8 +308,10 @@
         # FIXME: workaround for issue-144.  Setting a selection within an
         # EVT_TEXT event does not work on wx.GTK, so we defer the replace-event
         # to the next idle loop.
-        wx.CallAfter(self._request, 'REPLACEVALUE', text=event.GetString(),
-                position=event.GetEventObject().GetInsertionPoint())
+        # We do not pass the position here because it's not correct - the
+        # cursor position is not yet updated at the time this is called. So we
+        # let the GF* logic figure out the new cursor position.
+        wx.CallAfter(self._request, 'REPLACEVALUE', text=event.GetString())
 
         event.Skip()
 





reply via email to

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