How it is possible ?
the small test
- Code: Select all Expand view RUN
- #include "FiveWin.ch"
function Main()
local oWnd, oFont, oBtn, oGet, nColor := 0
local cFontName :="Arial" ,;
nFontSize := 8 ,;
lUnderline:= .f. ,;
lStrikeOut:= .f. ,;
lBold := .f. ,;
lItalic := .f. ,;
nColorFont := 0
aFont:= {,,,,nFontSize,lItalic,lUnderLine,lStrikeOut,,,,,,cFontName}
local aGet:= array(3)
DEFINE DIALOG oWnd TITLE "Call font" size 400,300
@ 10, 5 GET aGet[1] VAR cFontName SIZE 100,12 PIXEL OF oWnd
@ 30, 5 GET aGet[2] VAR nFontSize SIZE 20,12 PIXEL OF oWnd PICTURE "999"
@ 60, 5 GET aGet[3] VAR nColorFont SIZE 20,12 PIXEL OF oWnd
@ 90,10 BUTTON oBtn PROMPT "Call Font" ;
ACTION (aFont := Select_Font(@aFont,@nColorFont),;
cFontName:=aFont[LF_FACENAME],;
nFontSize:=IF( aFont[LF_HEIGHT ]!=NIL,FontHeightInPoints( aFont[LF_HEIGHT ]),0) ,;
lBold:= IIF(aFont[LF_WEIGHT]=700,.t.,.f.) ,;
lItalic:= aFont[LF_ITALIC],;
lUnderline:=aFont[LF_UNDERLINE],;
lStrikeout:=aFont[ LF_STRIKEOUT ], ;
aGet[1]:refresh(),;
aGet[2]:refresh(),;
aGet[3]:refresh());
OF oWnd SIZE 30,10 PIXEL
ACTIVATE DIALOG oWnd center
return nil
//----------------------------------------------------------------------------//
function Select_Font(aFont,nColor)
aFont := ChooseFont(aFont,@nColor)
return aFont
//----------------------------------------------------------------------------//
function FontHeightInPoints( nHeight )
local nPoints, hDC
nPoints := Round( Abs( nHeight ) * 72 / GetDeviceCaps( hDC := GetDC( 0 ), 90 ), 0 )
ReleaseDC( 0, hDC )
return nPoints
//----------------------------------------------------------------------------/