Adding support for using ESC key for closing custom grid cell editors
authorlaurent
Sun, 08 Jan 2012 18:23:55 +0100
changeset 615 8baeb9dff775
parent 614 8c4b57808f9c
child 616 8a60ffcfd70b
Adding support for using ESC key for closing custom grid cell editors
controls/DurationCellEditor.py
controls/LocationCellEditor.py
--- a/controls/DurationCellEditor.py	Sun Jan 08 18:22:43 2012 +0100
+++ b/controls/DurationCellEditor.py	Sun Jan 08 18:23:55 2012 +0100
@@ -94,7 +94,7 @@
 
     def OnDurationChar(self, event):
         keycode = event.GetKeyCode()
-        if keycode == wx.WXK_RETURN or keycode == wx.WXK_TAB:
+        if keycode in [wx.WXK_RETURN, wx.WXK_TAB, wx.WXK_ESCAPE]:
             self.Parent.Parent.ProcessEvent(event)
             self.Parent.Parent.SetFocus()
         else:
--- a/controls/LocationCellEditor.py	Sun Jan 08 18:22:43 2012 +0100
+++ b/controls/LocationCellEditor.py	Sun Jan 08 18:23:55 2012 +0100
@@ -100,7 +100,7 @@
 
     def OnLocationChar(self, event):
         keycode = event.GetKeyCode()
-        if keycode == wx.WXK_RETURN or keycode == wx.WXK_TAB:
+        if keycode in [wx.WXK_RETURN, wx.WXK_TAB, wx.WXK_ESCAPE]:
             self.Parent.Parent.ProcessEvent(event)
             self.Parent.Parent.SetFocus()
         else: