hello to all,
are there some way to change the say's font of the undefined SAY, I mean if we define says in dialog (resource) is possible to change the font of the SAY without redefine it?
regards
Marcelo
AEVAL( oDlg:aControls, ;
{ | oCtl | IIF( oCtl:ClassName() == "TSAY", ; // only SAY is used
( oCtl:SetFont( oFont1 ), ; // change font
oCtl:Setcolor( 255, ), ; // change to red
oCtl:Refresh() ), NIL ) } )
#Include "FiveWin.Ch"
//---------------------
Func Main()
Local oFontA,oFontB,oSay,cSay,oBtn1
oFontB := TFont():New("Ms Sans Serif",,-6,.F.,.T. ,,,,.F. )
oFontA := TFont():New("New Times Roman",,-10,.F.,.T. ,,,,.F. )
cSay := "Testing Boiler Plate Text"
LightGreyGrad() // creates gradient and the transparent flag for dialog
DEFINE DIALOG oDlg SIZE 300, 300
@ 1, 1 Say oSay PROMPT cSay OF oDlg
oSay:SetFont( oFontB )
oSay:SetColor(nRgb(7,7,224)) // blue
@ 3,1 BUTTON "Change Font" of oDlg SIZE 40,12 ;
ACTION ( oSay:SetFont(oFontA),oSay:SetColor(CLR_HRED),oSay:ReFresh() )
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFontB
RELEASE FONT oFontA
Return(nil)
//------------------
Func LightGreyGrad()
SetDlgGradient( { { .50, nRGB( 216, 216, 216 ), nRGB( 255, 255, 255 ) } } )
Return(nil)
LTEXT "Vendor Id", 112, 8, 39, 60, 12, SS_NOPREFIX | WS_GROUP
REDEFINE SAY oSay27 Id 112 OF oDlg UPDATE
oSay27:SetFont( oFontB )
oSay27:SetColor( nRgb( 7,7,224 ))
// oDlg your Dialog and oFont the font to set to
hCtrl := GetWindow( oDlg:hWnd, GW_CHILD )
WHILE hCtrl != 0
IF GetClassName( hCtrl ) == "Static" .AND. GetWindowLong( hCtrl, GWL_ID ) == -1
SendMessage( hCtrl, WM_SETFONT, oFont:hFont )
ENDIF
hCtrl := GetWindow( hCtrl, GW_HWNDNEXT )
ENDDO
from .rc
LTEXT "Vendor Id", 112, 8, 39, 60, 12, SS_NOPREFIX | WS_GROUP
REDEFINE SAY oSay27 Id 112 OF oDlg UPDATE
oSay27:SetFont( oFontB )
oSay27:SetColor( nRgb( 7,7,224 ))
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 40 guests