dabo Commit
Revision 2647
Date: 2007-01-10 17:33:02 -0800 (Wed, 10 Jan 2007)
Author: Ed

Changed:
U   trunk/dabo/ui/uiwx/dPemMixin.py
U   trunk/dabo/ui/uiwx/uiApp.py

Log:
Added a shortcut key of Ctrl-0 to go along with Ctrl-+ and Ctrl-- for zooming 
the font on a form. Ctrl-0 returns the form to the original, non-zoomed font 
size.


Diff:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py     2007-01-11 00:19:57 UTC (rev 2646)
+++ trunk/dabo/ui/uiwx/dPemMixin.py     2007-01-11 01:33:02 UTC (rev 2647)
@@ -1072,6 +1072,8 @@
        def decreaseFontSize(self, val=None):
                if val is None:
                        val = -1
+               else:
+                       val = -1 * val
                self._changeFontSize(val)
        def _changeFontSize(self, val):
                try:

Modified: trunk/dabo/ui/uiwx/uiApp.py
===================================================================
--- trunk/dabo/ui/uiwx/uiApp.py 2007-01-11 00:19:57 UTC (rev 2646)
+++ trunk/dabo/ui/uiwx/uiApp.py 2007-01-11 01:33:02 UTC (rev 2647)
@@ -175,21 +175,17 @@
                uk = evt.GetUnicodeKey()
                met = evt.MetaDown()
                sh = evt.ShiftDown()
-#              if alt or met or not ctl:
                if alt or not ctl:
                        evt.Skip()
                        return
                try:
                        char = chr(evt.GetKeyCode())
-#-                     if wx.Platform == "__WXMAC__":
-#-                             char = chr(evt.GetKeyCode())
-#-                     else:   
-#-                             char = chr(evt.GetRawKeyCode())
                except (ValueError, OverflowError):
                        char = None
                plus = (char == "=") or (char == "+") or (kcd == 
wx.WXK_NUMPAD_ADD)
                minus = (char == "-") or (kcd == wx.WXK_NUMPAD_SUBTRACT)
-               if not (plus or minus):
+               zero = (char == "0") or (kcd == wx.WXK_NUMPAD0)
+               if not (plus or minus or zero):
                        evt.Skip()
                        return
                settingName = "%s.zoomlevel" % self.ActiveForm.Name
@@ -197,12 +193,16 @@
                if plus:
                        self.ActiveForm.iterateCall("increaseFontSize")
                        currZoom += 1
-               else:
+               elif minus:
                        self.ActiveForm.iterateCall("decreaseFontSize")
                        currZoom -= 1
+               else:
+                       # Set back to zero zoom
+                       self.ActiveForm.iterateCall("decreaseFontSize", 
currZoom)
+                       currZoom = 0
                self.dApp.setUserSetting(settingName, currZoom)
-               
 
+
        def setup(self):
                frm = self.dApp.MainForm
                if frm is None:




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to