// \SAMPLES\MANUEL.PRG / MANUEL.RC
#Include "FiveWin.ch"
//----------------------------------------------------------------------------//
FUNCTION Main()
LOCAL oDlg, nButton, oFont, oBtn := Array( 5 ), cTitle, aGrad
SkinButtons()
cTitle := "Armando: BOTONES DE COLORES"
aGrad := { { 0.30, CLR_CYAN, CLR_HCYAN },{ 0.70, CLR_HCYAN, CLR_CYAN } }
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, - 14 BOLD
DEFINE DIALOG oDlg RESOURCE "Main" TITLE cTitle GRADIENT aGrad
oDlg:lHelpIcon := .F.
REDEFINE BTNBMP oBtn[1] ID 110 OF oDlg ;
RESOURCE "Yes" NOBORDER ;
ACTION ( oBtn[1]:Toggle(), MsgBeep() )
oBtn[1]:GoDown()
REDEFINE BTNBMP oBtn[2] ID 120 OF oDlg ;
RESOURCE "No"
REDEFINE BTNBMP oBtn[3] ID 130 OF oDlg ;
RESOURCE "Cancel" ;
ACTION( oDlg:End() )
oBtn[3]:lCancel := .T.
FOR nButton = 1 TO 3 // FONT .and. COLORS.
SET FONT OF oBtn[ nButton ] TO oFont
SET_Color_oBot( oBtn[ nButton ], "AZUL" )
NEXT
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
FUNCTION SET_Color_oBot( oBot, cColor )
DEFAULT cColor := NIL
IF .NOT. cColor = NIL
IF cColor = "ORO"
oBot:bClrGrad = {| lMouseOver | If( ! lMouseOver, ;
{ { 1.00, 14481663, 38075 }, ;
{ 1.00, 38075, 14481663 } }, ;
{ { 0.10, 16777215, 9363707 }, ;
{ 0.10, 9363707, 16777215 } } ) }
oBot:SetColor( 0 )
ELSEIF cColor = "PLATA"
oBot:bClrGrad = {| lMouseOver | If( ! lMouseOver, ;
{ { 0.30, 12961221, 16777215 }, ;
{ 0.30, 16777215, 12961221 } }, ;
{ { 0.10, 9363707, 16777215 }, ;
{ 0.10, 16777215, 9363707 } } ) }
oBot:SetColor( 0 )
ELSEIF cColor = "AZUL"
oBot:bClrGrad := {| lInvert | If( ! lInvert, { { 0.50, 16776960, 16777215 }, ;
{ 0.50, 16777215, 16776960 } }, ;
{ { 0.50, 128, 16777215 }, ;
{ 0.50, 16777215, 128 } } ) }
oBot:SetColor( 0 )
ELSEIF cColor = "APUB"
oBot:bClrGrad := {| 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 ) } ;
} ) }
oBot:SetColor( 0 )
ENDIF
ENDIF
RETURN NIL
// fin / end
/* // MANUEL.RC
#include "..\include\WinApi.ch"
Yes BITMAP "../bitmaps/yes.bmp"
No BITMAP "../bitmaps/no.bmp"
Cancel BITMAP "../bitmaps/cancel.bmp"
main DIALOG 50, 67, 162, 76
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "FiveWin Class TBtnBmp"
FONT 12, "MS Sans Serif"
{
CONTROL "", 110, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 9, 46, 43, 16
CONTROL "", 120, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 60, 46, 43, 16
CONTROL "", 130, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 110, 46, 42, 16
}
*/