- Code: Select all Expand view
- #include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oSay
DEFINE DIALOG oDlg
@ 1, 1 SAY oSay PROMPT "";
SIZE 100, 20
@ 3, 1 BUTTON "Test";
ACTION TEST( oSay )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
STATIC FUNCTION TEST( oSay )
LOCAL i, j
FOR i = 1 TO 3
FOR j = 0 TO 100
GRADIENTFILL( oSay:GetDC(), 0, 0, oSay:nHeight, oSay:nWidth, ACLRGRAD( j ), .F. )
oSay:ReleaseDC()
INKEY( 0.01 )
SYSREFRESH()
NEXT
NEXT
RETURN NIL
#define CLRSTA RGB( 4, 210, 10 )
#define CLREND RGB( 255, 255, 255 )
STATIC FUNCTION ACLRGRAD( nPos )
LOCAL aClr
IF nPos = 0
aClr = { { 1, CLREND, CLRSTA } }
ELSEIF nPos = 100
aClr = { { 1, CLRSTA, CLREND } }
ELSE
aClr = { { nPos / 100, CLRSTA, CLREND }, { ( 100 - nPos ) / 100, CLREND, CLRSTA } }
ENDIF
RETURN aClr
EMG