commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r9014 - trunk/gnue-forms/src/uidrivers/wx26/widgets


From: johannes
Subject: [gnue] r9014 - trunk/gnue-forms/src/uidrivers/wx26/widgets
Date: Thu, 9 Nov 2006 07:11:06 -0600 (CST)

Author: johannes
Date: 2006-11-09 07:11:05 -0600 (Thu, 09 Nov 2006)
New Revision: 9014

Modified:
   trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
Log:
Get the dropdowns on their way on wxMac too


Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-11-09 
12:22:04 UTC (rev 9013)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-11-09 
13:11:05 UTC (rev 9014)
@@ -114,12 +114,6 @@
         ctrl.Bind(wx.EVT_TEXT, self.__on_text_changed)
         ctrl.Bind(wx.EVT_SET_FOCUS, self.__on_set_focus)
 
-        # Currently wxMac does *not* recieve a button release event, so we
-        # don't bind it here. Instead we check the insertion point in the
-        # keypress event.
-        if not 'wxMac' in wx.PlatformInfo:
-            ctrl.Bind (wx.EVT_LEFT_UP, self.__on_left_mouseup)
-
         return [self.__add_entry_label(parent), ctrl]
 
     # -------------------------------------------------------------------------
@@ -166,8 +160,7 @@
         self.update_choices(result)
 
         # On wxMac a Combobox is a container holding a TextCtrl and a Choice.
-        # So we have to bind Char- and Focus-Events to the textCtrl instead of
-        # the container widget.
+        # We have to bind the Focus- and Char-Events to the TextCtrl widget.
         if 'wxMac' in wx.PlatformInfo:
             for child in result.GetChildren():
                 if isinstance(child, wx.TextCtrl):
@@ -176,12 +169,10 @@
         else:
             item = result
 
-
-        result.Bind(wx.EVT_COMBOBOX, self.__on_item_selected)
         if 'wxGTK' in wx.PlatformInfo:
-            item.Bind(wx.EVT_TEXT, self.__on_gtk_text_changed)
+            result.Bind(wx.EVT_TEXT, self.__on_gtk_text_changed)
         else:
-            item.Bind(wx.EVT_TEXT, self.__on_text_changed)
+            result.Bind(wx.EVT_TEXT, self.__on_text_changed)
 
         item.Bind(wx.EVT_CHAR, self.__on_keypress)
         item.Bind(wx.EVT_SET_FOCUS, self.__on_set_focus)
@@ -190,10 +181,6 @@
         if 'wxMSW' in wx.PlatformInfo:
             item.Bind(wx.EVT_MOUSEWHEEL, self.__on_cbx_wheel)
 
-        # The button release event is fired on wxGTK only
-        elif 'wxGTK' in wx.PlatformInfo:
-            item.Bind(wx.EVT_LEFT_UP, self.__on_left_mouseup)
-
         return [self.__add_entry_label(parent), result]
 
     # -------------------------------------------------------------------------
@@ -278,15 +265,6 @@
 
     # -------------------------------------------------------------------------
 
-    def __on_left_mouseup(self, event):
-
-        widget = event.GetEventObject()
-        event.Skip()
-
-        wx.CallAfter(self.__update_insertion_point, widget)
-
-    # -------------------------------------------------------------------------
-
     def __on_toggle_checkbox(self, event):
 
         self._request('TOGGLECHKBOX')
@@ -389,30 +367,6 @@
 
 
     # -------------------------------------------------------------------------
-    # Make sure the insertion point or selection of a widget is in sync with 
GF*
-    # -------------------------------------------------------------------------
-
-    def __update_insertion_point(self, widget):
-
-        if isinstance(widget, wx.TextCtrl):
-            (left, right) = widget.GetSelection()
-
-        elif isinstance(widget, wx.ComboBox):
-            if 'wxMac' in wx.PlatformInfo:
-                (left, right) = widget._entry.GetSelection()
-            else:
-                (left, right) = widget.GetMark()
-        else:
-            return
-
-        if left == right:
-            self._request('CURSORMOVE', position=left)
-
-        else:
-            self._request('SELECTWITHMOUSE', position1=left, position2=right)
-
-
-    # -------------------------------------------------------------------------
     # Enable/disable this entry
     # -------------------------------------------------------------------------
 





reply via email to

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