commit-gnue
[Top][All Lists]
Advanced

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

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


From: johannes
Subject: [gnue] r8590 - trunk/gnue-forms/src/uidrivers/wx26/widgets
Date: Tue, 22 Aug 2006 07:56:37 -0500 (CDT)

Author: johannes
Date: 2006-08-22 07:56:36 -0500 (Tue, 22 Aug 2006)
New Revision: 8590

Modified:
   trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
Log:
Proper handling of the tab-keys on MSW's dropdowns (it's handled via 
menue here)


Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-08-22 
12:18:36 UTC (rev 8589)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-08-22 
12:56:36 UTC (rev 8590)
@@ -149,7 +149,8 @@
     def __build_dropdown(self, parent):
 
         csize = self.get_default_size()
-        result = wx.ComboBox(parent, -1, size=csize, style=wx.CB_DROPDOWN)
+        result = wx.ComboBox(parent, -1, size=csize, style=wx.CB_DROPDOWN |
+                wx.TE_PROCESS_TAB | wx.TE_PROCESS_ENTER)
 
         self.update_choices(result)
 
@@ -174,12 +175,6 @@
         if not 'wxMac' in wx.PlatformInfo:
             item.Bind(wx.EVT_LEFT_UP, self.__on_left_mouseup)
 
-        # On MSW a ComboBox widget does not get an EVT_CHAR event for the left-
-        # and right-keys.  That's why we need to add a EVT_KEY_DOWN-handler
-        # here
-        if 'wxMSW' in wx.PlatformInfo:
-            result.Bind(wx.EVT_KEY_DOWN, self.__on_msw_keydown)
-
         return [self.__add_entry_label(parent), result]
 
     # -------------------------------------------------------------------------
@@ -258,6 +253,7 @@
     def __on_set_focus(self, event):
 
         do_focus = (self._gfObject._form._currentEntry != self._gfObject)
+        print "on_set_focus", self._gfObject.name, "NOTE:", do_focus
 
         # adjust the record number if necessary
         lookup = event.GetEventObject()
@@ -324,6 +320,7 @@
 
     def __on_keypress(self, event):
 
+        print "on-keypress", event.GetKeyCode()
         if 'wxMac' in wx.PlatformInfo or \
             ('wxMSW' in wx.PlatformInfo and self._gfObject.style == 
'dropdown'):
             self.__update_insertion_point(event.GetEventObject())
@@ -345,6 +342,7 @@
             command = None
 
         if command:
+            print "--> comand:", command
             gDebug(2, "--> COMMAND: %s" % command)
             if command == 'NEWLINE':
                 self._request('KEYPRESS', text='\n')
@@ -365,27 +363,6 @@
 
 
     # -------------------------------------------------------------------------
-    # Key-Down-Eventtrap for wx.MSW's ComboBox widgets
-    # -------------------------------------------------------------------------
-
-    def __on_msw_keydown(self, event):
-
-        keycode = event.GetKeyCode()
-        command = None
-
-        if keycode in [wx.WXK_LEFT, wx.WXK_RIGHT, wx.WXK_UP, wx.WXK_DOWN]:
-            (command, args) = GFKeyMapper.KeyMapper.getEvent(keycode,
-                    event.ShiftDown(),
-                    event.CmdDown(),
-                    event.AltDown())
-
-        if command:
-            self._request(command, triggerName=args)
-        else:
-            event.Skip()
-
-
-    # -------------------------------------------------------------------------
     # Do the dirty work for moving the focus and adjusting the row
     # -------------------------------------------------------------------------
 
@@ -409,9 +386,11 @@
             restore = None
 
         if do_focus:
+            print "requesting FOCUS"
             self._request('FOCUS', data=self._gfObject)
 
         if adjust:
+            print "requesting JUMPRECORD", adjust
             self._request('JUMPRECORD', data=adjust)
 
         # Restore an insertion point (if the widget has something like that)





reply via email to

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