#include "fivewin.ch"
#xcommand @ <nRow>, <nCol> SWITCH [ <oSw> VAR ] <lVar> ;
[ PROMPT <cCaption> ] ;
[ <of:OF, WINDOW, DIALOG> <oWnd> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ FONT <oFont> ] ;
[ <change: ON CLICK, ON CHANGE> <uClick> ] ;
[ VALID <ValidFunc> ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ <design: DESIGN> ] ;
[ <pixel: PIXEL> ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ WHEN <WhenFunc> ] ;
[ BORDERSIZE <nBorderSize> ] [ BORDERCOLOR <nClrBorder> ] ;
[ THUMBSIZE <nThumbSize> ] [ THUMBCOLOR <nClrThumb> ] ;
[ RADSTYLE <lRadStyle> ] [ OVAL <lOval> ];
=> ;
[ <oSw> := ] TSwitch():New( <nRow>, <nCol>, <cCaption>,;
bSETGET(<lVar>), <oWnd>, <nWidth>, <nHeight>, <nHelpId>,;
[<{uClick}>], <oFont>, <{ValidFunc}>, <nClrFore>, <nClrBack>,;
<.design.>, <.pixel.>, <cMsg>, <.update.>, <{WhenFunc}>, ;
<nBorderSize>, <nClrBorder>, <nThumbSize>, <nClrThumb>, <lRadStyle>, <lOval> )
function Main()
local oWnd, oFont
local lVar1, lVar2, lVar3
local oYn1, oYn2, oYn3, oSay1, oSay2, oSay3
lVar1 := lVar2 := lVar3 := .t.
DEFINE FONT oFont NAME "Segoe UI Light" SIZE 0,-18 BOLD
DEFINE WINDOW oWnd COLOR CLR_GRAY,CLR_WHITE
oWnd:SetFont( oFont )
// oWnd:nOpacity := 140
@ 98, 40 SAY oSay1 PROMPT If( lVar1, 'On', 'Off' ) SIZE 60,30 PIXEL OF oWnd UPDATE
@ 100,207 SWITCH oYn1 VAR lVar1 OVAL .f. PIXEL OF oWnd UPDATE ;
COLOR CLR_GREEN, CLR_GRAY ;
ON CHANGE oWnd:Update()
@ 128, 40 SAY oSay2 PROMPT If( lVar2, 'On', 'Off' ) SIZE 60,30 PIXEL OF oWnd UPDATE
@ 130,207 SWITCH oYn2 VAR lVar2 OVAL .t. PIXEL OF oWnd UPDATE ;
COLOR CLR_GREEN, CLR_GRAY ;
THUMBSIZE 16 THUMBCOLOR CLR_BLUE ;
ON CHANGE oWnd:Update()
@ 158, 40 SAY oSay3 PROMPT If( lVar3, 'On', 'Off' ) SIZE 60,30 PIXEL OF oWnd UPDATE
@ 160,207 SWITCH oYn3 VAR lVar3 OVAL .f. RADSTYLE .t.PIXEL OF oWnd UPDATE ;
ON CHANGE oWnd:Update() //con radstyle oval debe ser .f.
ACTIVATE WINDOW oWnd
RELEASE FONT oFont
return nil