Here you have a simple working sample for making font zoom in/out on a wbrowse:
- Code: Select all Expand view
#include "FiveWin.ch"
static oBrw, oFont, nSize := -10
function Main()
local oWnd
USE customer
DEFINE FONT oFont NAME "Verdana" SIZE 0, nSize
DEFINE WINDOW oWnd TITLE "Browses - zoom" ;
MENU BuildMenu()
@ 0, 0 LISTBOX oBrw FIELDS FONT oFont
oWnd:oClient = oBrw
ACTIVATE WINDOW oWnd
return nil
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "Zoom"
MENU
MENUITEM "Larger" ACTION Larger()
MENUITEM "Smaller" ACTION Smaller()
ENDMENU
ENDMENU
return oMenu
function Larger()
nSize -= 2
DEFINE FONT oFont NAME "Verdana" SIZE 0, nSize
oBrw:SetFont( oFont )
oBrw:Refresh()
return nil
function Smaller()
nSize += 2
DEFINE FONT oFont NAME "Verdana" SIZE 0, nSize
oBrw:SetFont( oFont )
oBrw:Refresh()
return nil