// C:\FWH..\SAMPLES\GRADSIL2.PRG
#Include "FiveWin.ch"
#Define GRAD_BTN_BLACK { | lInvert | If( ! lInvert, ;
{ { 0.70,0 ,12429486 },{ 0.70,12429486,0 } },;
{ { 0.40,9928844,12429486 },{ 0.40,12429486,9928844 } } ) }
#Define aPubGrad { | lInvert | If( lInvert, ;
{ { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2/3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } ;
}, ;
{ { 1/2, nRGB( 219, 230, 244 ), nRGB( 207-50, 221-25, 255 ) }, ;
{ 1/2, nRGB( 201-50, 217-25, 255 ), nRGB( 231, 242, 255 ) } ;
} ) }
#Define aPubRedGr { | lInvert | If( ! lInvert, { { 0.50,16776960,16777215 }, ;
{ 0.50,16777215,16776960 } }, { { 0.50,128,16777215 }, ;
{ 0.50,16777215,128 } } ) }
#Define bGrad { | lInvert | If( ! lInvert, ;
{ { 1, nRGB( 255, 255, 255 ), nRGB( 230, 234, 239 ) } }, ;
{ { 1/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2/3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } ;
} ) }
FUNCTION Test()
LOCAL oWnd
LOCAL oBar, oPlus, oNumber, oCancel, oExit
LOCAL lNumber := nil
DEFINE WINDOW oWnd
DEFINE BUTTONBAR oBar TOP OF oWnd 2015
DEFINE BUTTON oNumber FILENAME "..\bitmaps\16x16\floppy.bmp" OF oBar ;
TOOLTIP "one number" ;
ACTION ( ChangePressedBtn( oNumber ), lNumber := .F. )
DEFINE BUTTON oPlus FILENAME "..\bitmaps\16x16\plus.bmp" OF oBar ;
TOOLTIP "plus numbers" ;
ACTION ( ChangePressedBtn( oPlus ), lNumber := .T. )
DEFINE BUTTON oCancel FILENAME "..\bitmaps\16x16\delete.bmp" OF oBar ;
TOOLTIP "cancel" ;
ACTION AnnullaSelezione( oPlus, oNumber, lNumber )
DEFINE BUTTON oExit FILENAME "..\bitmaps\16x16\exit.bmp" OF oBar ;
TOOLTIP "Salida - Exit - Cancelar" ;
ACTION( oWnd:End() )
ACTIVATE WINDOW oWnd
RETURN NIL
FUNCTION ChangePressedBtn( oBtn )
LOCAL bClrGradSelect := { | lInvert | If( ! lInvert, ;
{ { 1, RGB( 244, 244, 245 ), RGB( 244, 244, 245 ) } }, ;
{ { 1, RGB( 255, 253, 222 ), RGB( 255, 231, 151 ) } } ) }
LOCAL bClrGradNormal := { | lInvert | If( ! lInvert, ;
{ { 1, RGB( 244, 244, 245 ), RGB( 244, 244, 245 ) } }, ;
{ { 1, RGB( 145, 201, 247 ), RGB( 145, 201, 247 ) } } ) }
oBtn:Toggle()
IF oBtn:lPressed
// bGrad-aPubRedGr-aPubGrad-bClrGradSelect
oBtn:bClrGrad := GRAD_BTN_BLACK // Bello.
ELSE
oBtn:bClrGrad := bClrGradNormal
ENDIF
oBtn:refresh()
RETURN NIL
FUNCTION AnnullaSelezione( oPlus, oNumber, lNumber )
IF lNumber != nil
IF lNumber
ChangePressedBtn( oPlus )
ENDIF
IF !lNumber
ChangePressedBtn( oNumber )
ENDIF
oPlus:refresh()
oNumber:refresh()
ENDIF
RETURN NIL
// FIN / END