I made a test but not work
- Code: Select all Expand view
Function test()
local oDlg
local oGet,oSay
local cGet:= space(10)
nColor1:= RGB( 245,245,235)
nColor2:=RGB(250,250,245)
DEFINE DIALOG oDlg SIZE 400,100
@ 12,10 SAY oSay PROMPT "TEST SAY" SIZE 80,12 PIXEL of oDlg
@ 12,90 GET oGet VAR cGEt SIZE 100,12 PIXEL of oDlg
oDlg:bPainted := < |hDC|
TestBrush(hDC,oGet,nColor1,nColor2,oSay:nLeft, oSay:nTop, oSAy:nWidth, oSay:nHeight)
TestBrush(hDC,oSay,nColor1,nColor2,oGEt:nLeft, oGet:nTop, oGet:nWidth, oGet:nHeight)
* DRAWBORDER ( hDC, oSay:nLeft, oSay:nTop, oSay:nWidth, oSay:nHeight,0 , 1, nColor1, .t. )
*DRAWBORDER ( hDC, oGEt:nLeft, oGEt:nTop, oGEt:nWidth, oGet:nHeight,0 , 1, nColor1, .t. )
RETURN NIL
>
ACTIVATE DIALOG oDlg ;
on init oGet:disable()
return nil
Function TestBrush(hDC,oControl,nColor1,nColor2, nLeft, nTop, nWidth, nHeight )
local oGraphics := Graphics():New( hDC )
local nRed1 := nRGBRed( nColor1 )
local nGreen1 := nRGBGreen( nColor1 )
local nBlue1 := nRGBBlue( nColor1 )
local nRed2 := nRGBRed( nColor2 )
local nGreen2 := nRGBGreen( nColor2 )
local nBlue2 := nRGBBlue( nColor2 )
local oBrush
local oPen ,nPen:=1
oPen := Pen():New( 255, nRed1, nGreen1, nBlue1, nPen )
oBrush := Brush():NewGradientBrush( nTop, nLeft, nWidth, nHeight, 3,;
180, nRed1, nGreen1, nBlue1,;
180, nRed2, nGreen2, nBlue2)
oGraphics:DrawRect( , oBrush, nLeft, nTop, nWidth, nHeight )
return nil