Hi,
I have a dialog from a rc with 1 get with a numeric var and 1 multiline get .
I want to change the background color of the multiline field depending of the value entered in the firts numeric .
Any samples ?
Thanks
Philippe
#include "fivewin.ch"
function Main()
local aColors := { CLR_WHITE, CLR_YELLOW, CLR_HGREEN }
local oDlg, oFont, oGet, oMemo, n
local nColor := 1
local CText := "This is some" + CRLF + "text"
SetGetColorFocus()
DEFINE DIALOG oDlg SIZE 300,350 PIXEL TRUEPIXEL
@ 20,20 SAY "Color Code : " GET nColor SIZE 200,24 PIXEL PICTURE "9" ;
OF oDlg VALID ( ;
n := aColors[ ( ( nColor - 1 ) % 3 ) + 1 ], ;
oMemo:SetColor( CLR_BLACK, n ), ;
.t. )
@ 60,20 GET oMemo VAR cText MEMO SIZE 260,270 PIXEL OF oDlg ;
COLORS CLR_BLACK, aColors[ nColor ]
ACTIVATE DIALOG oDlg CENTERED ON INIT oMemo:SetFocus()
return nil
// C:\FWH..\SAMPLES\CORGET2.PRG
#include "fivewin.ch"
#Define CLR_SOFTYELLOW nRGB( 255, 251, 225 ) //-> Amerelo Soft.
FUNCTION Main()
LOCAL aColors := { CLR_WHITE, CLR_YELLOW, CLR_HGREEN }
LOCAL oDlg, oFont, oGet, oMemo, n, oBtnCal, oBtnCan
LOCAL nColor := 1
LOCAL CText := "This is some" + CRLF + "text"
SetGetColorFocus()
tGet():lDisColors := .F.
tGet():nClrTextDis := CLR_HBLUE
tGet():nClrPaneDis := CLR_WHITE
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -18 BOLD
DEFINE DIALOG oDlg SIZE 300,350 PIXEL TRUEPIXEL FONT oFont ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT
oDlg:lHelpIcon := .F.
/*
@ 20,20 SAY "Color Code : " GET nColor SIZE 200,24 PIXEL PICTURE "9" ;
OF oDlg VALID ( ;
n := aColors[ ( ( nColor - 1 ) % 3 ) + 1 ], ;
oMemo:SetColor( CLR_BLACK, n ), ;
.t. )
*/
@ 20, 20 SAY "Cambiar Color: " SIZE 200,24 PIXEL OF oDlg UPDATE TRANSPARENT
@ 60, 20 GET oMemo VAR cText MEMO SIZE 260,220 PIXEL OF oDlg /* ;
COLORS CLR_BLACK, aColors[ nColor ] */
@ 300, 100 BTNBMP oBtnCal FILENAME "..\bitmaps\16x16\floppy.bmp" ;
FLAT SIZE 20, 14 PIXEL OF oDlg NOBORDER ;
ACTION SET_COLOR( oMemo, nColor )
@ 300, 150 BTNBMP oBtnCan FILENAME "..\bitmaps\16x16\Exit.bmp" ;
FLAT SIZE 20, 14 PIXEL OF oDlg NOBORDER ;
ACTION( oDlg:End() )
oBtnCan:lCancel := .T.
ACTIVATE DIALOG oDlg CENTERED ON INIT oMemo:SetFocus()
oFont:End()
RETURN NIL
FUNCTION SET_COLOR( oMemo, nColor )
LOCAL oIni, oBrush, oBmp
LOCAL nTipo, cStyle, cFile, cLogo, nRow, nCol, lSelect
nColor := ChooseColor()
oMemo:SetColor( nColor, CLR_WHITE )
oMemo:Refresh()
RETURN( nColor )
// FIN / END
Silvio.Falconi wrote:With the new BtnClr class from Next fwh package
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 78 guests