dabo Commit
Revision 7245
Date: 2012-09-11 15:09:36 -0700 (Tue, 11 Sep 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7245
Changed:
U trunk/dabo/ui/uiwx/uiApp.py
Log:
We were binding wx.EVT_KEY_DOWN twice; consolidated. Also, calling
evt.Skip() after the dabo event handler could cause the event to
be skipped even after it had been explicitly stopped. In general,
I think we have such code to clean up elsewhere too but I'm limiting
the change to uiApp for now just in case there's something I'm not
remembering.
Diff:
Modified: trunk/dabo/ui/uiwx/uiApp.py
===================================================================
--- trunk/dabo/ui/uiwx/uiApp.py 2012-09-07 20:53:38 UTC (rev 7244)
+++ trunk/dabo/ui/uiwx/uiApp.py 2012-09-11 22:09:36 UTC (rev 7245)
@@ -202,7 +202,6 @@
if self.callback is not None:
wx.CallAfter(self.callback)
del self.callback
- self.Bind(wx.EVT_KEY_DOWN, self._onKeyPress)
return True
@@ -375,7 +374,7 @@
return ret
- def _onKeyPress(self, evt):
+ def _handleZoomKeyPress(self, evt):
## Zoom In / Out / Normal:
alt = evt.AltDown()
ctl = evt.ControlDown()
@@ -400,7 +399,8 @@
elif slash:
self.fontZoomNormal()
else:
- evt.Skip()
+ return False
+ return True
# The following three functions handle font zooming
@@ -500,17 +500,16 @@
def _onWxKeyChar(self, evt):
self.dApp.raiseEvent(dEvents.KeyChar, evt)
- evt.Skip()
def _onWxKeyDown(self, evt):
+ if self._handleZoomKeyPress(evt):
+ return
self.dApp.raiseEvent(dEvents.KeyDown, evt)
- evt.Skip()
def _onWxKeyUp(self, evt):
self.dApp.raiseEvent(dEvents.KeyUp, evt)
- evt.Skip()
def onCmdWin(self, evt):
_______________________________________________
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]