dabo Commit
Revision 5548
Date: 2009-12-02 14:00:31 -0800 (Wed, 02 Dec 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5548

Changed:
U   trunk/dabo/ui/uiwx/dGrid.py

Log:
When any other control in a modal dialog has the focus, and the user presses 
esc,
the dlg.runCancel() code will run. This commit makes dGrid behave in the same
way, instead of just eating the esc key.



Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2009-12-02 19:55:30 UTC (rev 5547)
+++ trunk/dabo/ui/uiwx/dGrid.py 2009-12-02 22:00:31 UTC (rev 5548)
@@ -3459,7 +3459,14 @@
 
 
        def _onKeyDown(self, evt):
-               if evt.EventData["keyCode"] == 9 and self.TabNavigates:
+               keycode = evt.EventData["keyCode"]
+
+               if keycode == 27:
+                       # esc pressed. Grid will eat it by default. But if we 
are in a dialog with
+                       # a cancel button, let's runCancel() since that's what 
the user likely wants:
+                       if hasattr(self.Form, "runCancel"):                     
+                               self.Form.runCancel()
+               if keycode == 9 and self.TabNavigates:
                        evt.stop()
                        self.Navigate(not evt.EventData["shiftDown"])
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to