Fix bug when pressing left arrow key in PouInstanceVariablesPanel
authorLaurent Bessard
Mon, 15 Apr 2013 00:27:30 +0200
changeset 1031 5743398071eb
parent 1030 d9e75a5b5f08
child 1032 c4989e53f9c3
Fix bug when pressing left arrow key in PouInstanceVariablesPanel
controls/PouInstanceVariablesPanel.py
--- a/controls/PouInstanceVariablesPanel.py	Mon Apr 15 00:26:23 2013 +0200
+++ b/controls/PouInstanceVariablesPanel.py	Mon Apr 15 00:27:30 2013 +0200
@@ -74,6 +74,7 @@
         self.VariablesList.Bind(CT.EVT_TREE_ITEM_ACTIVATED,
                 self.OnVariablesListItemActivated)
         self.VariablesList.Bind(wx.EVT_LEFT_DOWN, self.OnVariablesListLeftDown)
+        self.VariablesList.Bind(wx.EVT_KEY_DOWN, self.OnVariablesListKeyDown)
         
         buttons_sizer = wx.FlexGridSizer(cols=3, hgap=0, rows=1, vgap=0)
         buttons_sizer.AddWindow(self.ParentButton)
@@ -353,6 +354,11 @@
                     dragSource.SetData(data)
                     dragSource.DoDragDrop()
         event.Skip()
+
+    def OnVariablesListKeyDown(self, event):
+        keycode = event.GetKeyCode()
+        if keycode != wx.WXK_LEFT:
+            event.Skip()
         
     def OnInstanceChoiceLeftDown(self, event):
         event.Skip()