Author: bugman Date: Sat Aug 6 11:19:40 2011 New Revision: 14193 URL: http://svn.gna.org/viewcvs/relax?rev=14193&view=rev Log: Zooming can now be changed with Ctrl-+, Ctrl-- and Ctrl-0 in the relax controller. This enables zoom in, zoom out, and the original zoom to be accessed by the keyboard. Modified: branches/gui_testing/gui/controller.py Modified: branches/gui_testing/gui/controller.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/controller.py?rev=14193&r1=14192&r2=14193&view=diff ============================================================================== --- branches/gui_testing/gui/controller.py (original) +++ branches/gui_testing/gui/controller.py Sat Aug 6 11:19:40 2011 @@ -538,6 +538,9 @@ # Make the control read only. self.SetReadOnly(True) + # The original zoom level. + self.orig_zoom = self.GetZoom() + # Bind events. self.Bind(wx.EVT_FIND, self.find) self.Bind(wx.EVT_FIND_NEXT, self.find) @@ -580,6 +583,14 @@ if event.GetKeyCode() in [366, 367]: event.Skip() + # Zooming. + if event.ControlDown() and event.GetKeyCode() == 48: + self.on_zoom_orig(event) + if event.ControlDown() and event.GetKeyCode() == 45: + self.on_zoom_out(event) + if event.ControlDown() and event.GetKeyCode() == 61: + self.on_zoom_in(event) + def find(self, event): """Find the text in the log control. @@ -793,6 +804,17 @@ # Zoom. self.ZoomIn() + + + def on_zoom_orig(self, event): + """Zoom to the original zoom level. + + @param event: The wx event. + @type event: wx event + """ + + # Zoom. + self.SetZoom(self.orig_zoom) def on_zoom_out(self, event):