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
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 ) } )Thanks,
I want to change the font of the says no redefined from a dialog, I think your solution is for says explicitly defined
Thanks and regards
Marcelo
#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)I think he want to change the fonts of the text controls with an ID of -1 in the resource.
LTEXT "Vendor Id", 112, 8, 39, 60, 12, SS_NOPREFIX | WS_GROUPREDEFINE 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 )
ENDDOThanks to all for the responses
Carlos thanks your suggestion, this work very well, now
are there the possibility to change the color too?
best regards
Marcelo
Marcelo,
You can get the fish, or learn how to fish ![]()
The matter is: using a control's (windows) handle, change it's color (like ::SetColor() does). One of the blessings of using FW is that you have 99% of the source code, so we have the very basic resource for research. Take a look into TWindows source and find out by yourself, i'm pretty sure you can! Show me that i'm not wrong ![]()
Best regards
Carlos,
good philosophy, if I find the solution, I will publish it here
Thanks
Marcelo
from .rc
LTEXT "Vendor Id", 112, 8, 39, 60, 12, SS_NOPREFIX | WS_GROUPREDEFINE SAY oSay27 Id 112 OF oDlg UPDATE
oSay27:SetFont( oFontB )
oSay27:SetColor( nRgb( 7,7,224 ))