Zooming the font size in FoxPro IDE code windows

In this post, I’ll show you how to use the AutoHotKey system utility to make a simple script file to quickly automate zooming the font size up and down in the FoxPro IDE using keyboard shortcuts or the mouse wheel.  This is a common feature in most modern code editors, but it is not a native feature of our much older FoxPro IDE.  (Jim Nelson gave me this idea when he explained you can Enlarge and Reduce the code window font size through the Format menu when you are working in a code window). So, I used AutoHotKey, which is a tool that can be used to create macros and scripts keyboard shortcuts and mouse gesture for any app running on your Windows machine. It allows for very complex hotkey and mouse combinations that FoxPro macros do not support. This quick-zoom feature is something that most modern IDE’s have and I’ve badly wanted this feature in FoxPro for a long time.

Video demo:

FoxPro IDE does font-zooming : http://www.youtube.com/watch?v=oRjMC-IDmKQ

With these hotkeys (Ctrl+NumPadPlus , Ctrl+NumPadMinus)  or mouse (Ctrl+MouseWheelUp, Crtl+MouseWheelDown) you can quickly increase or decrease the font size in the code window, multiple times, if desired, to create a zoom-in or zoom-out effect.

Keyboard:

  • ControlKey + the [PLUS] key on the number pad of your keyboard to zoom the font larger.
  • ControlKey + the [MINUS] key on the number pad of your keyboard to zoom the font smaller.

Mouse:

  • ControlKey + [Mouse Wheel] to zoom the font larger or smaller.  Try it in both directions to see which way it goes. If you want to reverse the direction of wheel behavior,  just edit the script to reverse the  WheelUp/WheelDown assignments, or use the X-Mouse Button Control utility to reverse the mouse wheel direction for your whole system.

Here are the scripts:

(Save to your .ahk file, then double-click the file in Windows File Explorer to activate the macros.)

Note that AutoKey allows you to restrict these assignments based on the Window handle, so they will only affect the FoxPro App, as these macros would likely not work in the menu system of any other app.

Go from this:

SNAGHTML3ac1bd98

To this:

SNAGHTML3ac1e1bb

 

by pressing the hotkeys or Ctrl+MouseWheel to zoom in or out as much as you want.

2 thoughts on “Zooming the font size in FoxPro IDE code windows”

  1. Here’s my conference editor setup utility:

    *—————————————————————–
    * Get a handle to the edit window
    *—————————————————————–
    Local lnWHandle
    If not “FOXTOOLS” $ Upper( Set(“Library”) )
    Set Library to (Home()+”\FoxTools.Fll”) Additive
    Endif
    lnWHandle = _WOnTop()
    If m.lnWHandle <= 0
    Return
    Endif

    *—————————————————————–
    * Get current settings
    *—————————————————————–
    Local laEnv[25]
    If _EdGetEnv( m.lnWHandle, @laEnv ) == 0
    Return
    Endif

    *—————————————————————–
    * Settings. Look up ToolHelp.Zip for possible values.
    *—————————————————————–
    laEnv[22] = "Courier New"
    laEnv[23] = 18
    laEnv[24] = 1

    *————- —————————————————-
    * Update settings
    *—————————————————————–
    _EdSetEnv( m.lnWHandle, @laEnv )
    _wputchr( m.lnWHandle, 65 )

Leave a Reply

Your email address will not be published. Required fields are marked *