James Bott wrote:However, I think Ollie wants to save a user defined font and restore it. I'm not sure we can do this.
Antonio, Enrico, any comments?
James
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oWnd
LOCAL cVar := "This is a test"
DEFINE WINDOW oWnd
@ 1, 1 SAY "This is a test";
COLOR CLR_BLACK
@ 3, 1 GET cVar;
SIZE 100, 20
@ 5, 1 BUTTON "Change font";
SIZE 100, 20;
ACTION CHANGEFONT( oWnd )
ACTIVATE WINDOW oWnd
RETURN NIL
STATIC FUNCTION CHANGEFONT( oWnd )
LOCAL oFont := oWnd:GetFont():Choose()
LOCAL i
? oFont:nSize()
oWnd:SetFont( oFont )
FOR i = 1 TO LEN( oWnd:aControls )
oWnd:aControls[ i ]:SetFont( oFont )
oWnd:aControls[ i ]:Refresh()
NEXT
RETURN NIL
#include "fivewin.ch"
function main()
local oFont,aFont,oWnd, cFacename
define window oWnd
aFont:= chooseFont() // select Arial, 8pt
cFaceName:= aFont[LF_FACENAME]
nWidth:= aFont[LF_WIDTH]
nHeight:= aFont[LF_HEIGHT]
// msgInfo( aFont[LF_FACENAME])
msgInfo( nWidth ) // returns 0
msgInfo( nHeight ) // returns -11
DEFINE font oFont name cFaceName size nWidth, nHeight
activate window oWnd on init msgInfo( oFont:nSize )
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 73 guests