Changeset 2932

Show
Ignore:
Timestamp:
03/18/07 14:56:49 (2 years ago)
Author:
paul
Message:

Added fontZoom{In|Out|Normal}() methods to uiApp and dApp, that do the
operation on the active form. Refactored the keyhandler in uiApp to call
these functions instead of the main form directly. Added "Increase Font Size",
"Decrease Font Size", and "Reset Font Size to Normal" menu options to the
View menu of dBaseMenuBar.

Added property dApp.ShowSizerLinesMenu?, to toggle whether that option is
shown in the base menu bar.


Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/dApp.py

    r2930 r2932  
    582582        """ 
    583583        self.uiApp.showCommandWindow(context) 
     584 
     585 
     586    def fontZoomIn(self, evt=None): 
     587        """Increase the font size on the active form.""" 
     588        self.uiApp.fontZoomIn() 
     589 
     590    def fontZoomOut(self, evt=None): 
     591        """Decrease the font size on the active form.""" 
     592        self.uiApp.fontZoomOut() 
     593 
     594    def fontZoomNormal(self, evt=None): 
     595        """Reset the font size to normal on the active form.""" 
     596        self.uiApp.fontZoomNormal() 
    584597 
    585598 
     
    855868        self._showCommandWindowMenu = bool(val) 
    856869             
     870 
     871    def _getShowSizerLinesMenu(self): 
     872        try: 
     873            v = self._showSizerLinesMenu 
     874        except AttributeError: 
     875            v = self._showSizerLinesMenu = True 
     876        return v 
     877             
     878    def _setShowSizerLinesMenu(self, val): 
     879        self._showSizerLinesMenu = bool(val) 
     880 
    857881             
    858882    def _getUI(self): 
     
    9981022            command window by calling app.showCommandWindow() directly.""") ) 
    9991023 
     1024    ShowSizerLinesMenu = property(_getShowSizerLinesMenu, 
     1025            _setShowSizerLinesMenu, None,  
     1026            _("""Specifies whether the "Show Sizer Lines" option is shown in the menu. 
     1027 
     1028            If True (the default), there will be a View|Show Sizer Lines option 
     1029            available in the base menu.""") ) 
     1030 
    10001031    UI = property(_getUI, _setUI, None,  
    10011032            _("""Specifies the user interface to load, or None. (str) 
  • trunk/dabo/ui/uiwx/dBaseMenuBar.py

    r2633 r2932  
    101101        app = self.Application 
    102102        self.Caption = _("&View") 
    103          
    104         itm = self.append(_("Show/Hide Sizer &Lines")+"\tCtrl+L",    
    105                 OnHit=app.onShowSizerLines, menutype="check", 
    106                 help=_("Cool sizer visualizing feature; check it out!")) 
     103     
     104        self.append(_("Increase Font Size") + "\tCtrl++", OnHit=app.fontZoomIn) 
     105        self.append(_("Decrease Font Size") + "\tCtrl+-", OnHit=app.fontZoomOut) 
     106        self.append(_("Normal Font Size") + "\tCtrl+/", OnHit=app.fontZoomNormal) 
     107     
     108        if app.ShowSizerLinesMenu: 
     109            self.appendSeparator() 
     110            self.append(_("Show/Hide Sizer &Lines")+"\tCtrl+L",  
     111                    OnHit=app.onShowSizerLines, menutype="check", 
     112                    help=_("Cool sizer visualizing feature; check it out!")) 
    107113 
    108114 
  • trunk/dabo/ui/uiwx/uiApp.py

    r2916 r2932  
    185185        slash = (char == "/") or (kcd == wx.WXK_NUMPAD_DIVIDE) 
    186186        if plus: 
    187             self.ActiveForm.iterateCall("fontZoomIn"
     187            self.fontZoomIn(
    188188        elif minus: 
    189             self.ActiveForm.iterateCall("fontZoomOut"
     189            self.fontZoomOut(
    190190        elif slash: 
    191             self.ActiveForm.iterateCall("fontZoomNormal"
     191            self.fontZoomNormal(
    192192        else: 
    193193            evt.Skip() 
    194194 
     195 
     196    def fontZoomIn(self): 
     197        self.ActiveForm.iterateCall("fontZoomIn") 
     198    def fontZoomOut(self): 
     199        self.ActiveForm.iterateCall("fontZoomOut") 
     200    def fontZoomNormal(self): 
     201        self.ActiveForm.iterateCall("fontZoomNormal") 
    195202 
    196203    def setup(self):