dabo Commit
Revision 7058
Date: 2012-01-20 13:00:56 -0800 (Fri, 20 Jan 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7058
Changed:
U trunk/dabo/lib/datanav/Grid.py
Log:
Fixed datanav.Grid to edit the record when the numpad_enter key is pressed.
Previously, that key would result in the next row being selected in the
grid instead.
Diff:
Modified: trunk/dabo/lib/datanav/Grid.py
===================================================================
--- trunk/dabo/lib/datanav/Grid.py 2012-01-20 17:11:02 UTC (rev 7057)
+++ trunk/dabo/lib/datanav/Grid.py 2012-01-20 21:00:56 UTC (rev 7058)
@@ -5,7 +5,9 @@
dabo.ui.loadUI("wx")
from dabo.dLocalize import _
import dabo.dEvents as dEvents
+from dabo.ui import dKeys
+
class Grid(dabo.ui.dGrid):
def _beforeInit(self, pre):
self.customSort = True
@@ -78,10 +80,10 @@
def _onGridKeyDown(self, evt):
keyCode = evt.EventData["keyCode"]
hasModifiers = evt.EventData["hasModifiers"]
- if keyCode == 13 and not hasModifiers:
+ if keyCode in (dKeys.key_Enter, dKeys.key_Numpad_enter) and not
hasModifiers:
self.processEditRecord()
evt.stop()
- elif keyCode == 27 and not hasModifiers:
+ elif keyCode == dKeys.key_Escape and not hasModifiers:
self.processEsc()
def processEsc(self):
_______________________________________________
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]