Page 1 of 1

Variable row height on a WBrowse - Otto

Posted: Mon Oct 15, 2007 6:05 am
by Antonio Linares
Otto,

Here you have a simple working sample for making font zoom in/out on a wbrowse:

Code: Select all

#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   

Posted: Mon Oct 15, 2007 10:19 am
by Otto
Thank you, Antonio.