Variable row height on a WBrowse - Otto

Post Reply
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Variable row height on a WBrowse - Otto

Post 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   
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Thank you, Antonio.
Post Reply