#Include "Fivewin.ch"
STATIC oFont
Function Main()
Local oWnd, oDlg, oFld, oBtn1, oBtn2, oBtn3
Local oFont, oBrush1, oBrush2, oBrush3
Local c_path, c_path1
Local oCbx1, nCbx1 := 3, oRadio1, nRadio1 := 3
c_path := cFilePath(GetModuleFileName( GetInstance() ) )
c_path1 := c_path + "SYSTEM\"
oFont := TFont():New("Arial",,-14,.F.,.T. ,,,,.F. )
DEFINE BRUSH oBrush1 GRADIENT { { 0.50, 16710607, 16759929 }, { 0.50, 16759929, 16710607 } }
DEFINE BRUSH oBrush2 GRADIENT { { 1, 16710607, 16759929 } }
DEFINE BRUSH oBrush3 GRADIENT { { 1, 16759929, 16710607 } }
oFont := TFont():New("Arial",,-14,.F.,.F. ,,,,.F. )
DEFINE WINDOW oWnd TITLE "Foldertest FWH-version => " + FWVERSION BRUSH oBrush1
DEFINE DIALOG oDlg FROM 50, 50 TO 450, 610 TITLE "Test folder" PIXEL OF oWnd BRUSH oBrush2
@ 15, 10 FOLDEREX SIZE 260, 170 oFld PIXEL ROUND 5 UPDATE ;
PROMPT "Page &1", "Page &2", "&EXIT" OF oDlg ;
ON PAINT TAB PaintTab( Self, nOption );
ON CHANGE ( nSavePage := oFld:nOption, ;
IF( nOption == 3, If( MsgYesNo( "Do you want exit??" ), ;
oWnd:End(), ( ::SetOption( nOldOption ), ::Refresh() ) ), ) ) ;
ON PAINT TEXT( If( nOption == ::nOption .and. nOption == 2, 8388608, 0 ) );
TOP OPTION 1 ALIGN 0, 0, 0
oFld:lTransparent := .T.
oFld:nFolderHeight := 40
oFld:nSeparator := 2
oFld:bClrText := {| o, n | 128 }
oFld:oFont := oFont
oFld:nOption := 1
oFld:aDialogs[ 1 ]:SetBrush( oBrush1 )
oFld:aDialogs[ 2 ]:SetBrush( oBrush2 )
oFld:aDialogs[ 3 ]:SetBrush( oBrush3 )
@ 20, 50 BTNBMP oBtn1 OF oFld:adialogs[1] ;
SIZE 50, 30 PIXEL 2007 ;
NOBORDER ;
PROMPT " Change &2" ;
FILENAME c_path1 + "Exit1.Bmp" ;
ACTION oBtn2:SetFile( c_path1 + "Info.Bmp", c_path1 + "Info.Bmp" ) ;
FONT oFont ;
TOP
oBtn1:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
{ { 0.50, 11513775, 16777215 }, ;
{ 0.50, 16777215, 11513775 } }, ;
{ { 0.50, 16761992, 16777215 }, ;
{ 0.50, 16777215, 16761992 } } ) }
oBtn1:lTransparent := .t.
oBtn1:cToolTip = { "Test" + CRLF + "Button 1","Button", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 0, )
@ 60, 50 BTNBMP oBtn2 OF oFld:adialogs[1] ;
SIZE 50, 30 PIXEL 2007 ;
NOBORDER ;
PROMPT " Change &1" ;
FILENAME c_path1 + "Preview.Bmp" ;
ACTION oBtn1:SetFile( c_path1 + "Info.Bmp", c_path1 + "Info.Bmp" ) ;
FONT oFont ;
TOP
oBtn2:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
{ { 0.50, 6711039, 16777215 }, ;
{ 0.50, 16777215, 6711039 } }, ;
{ { 0.50, 16761992, 16777215 }, ;
{ 0.50, 16777215, 16761992 } } ) }
oBtn2:lTransparent := .t.
oBtn2:cToolTip = { "Change Image" + CRLF + "Button 1","CHANGE", 1, CLR_BLACK, 14089979 }
oBtn2:SetColor( 0, )
@ 100, 50 BTNBMP oBtn3 OF oFld:adialogs[1] ;
SIZE 50, 30 PIXEL 2007 ;
NOBORDER ;
PROMPT " &Reset" ;
FILENAME c_path1 + "Recall.Bmp" ;
ACTION ( nSelect1 := .F., nSelect2 := .F. , ;
oBtn1:SetFile( c_path1 + "Exit1.Bmp", c_path1 + "Exit1.Bmp" ), ;
oBtn2:SetFile( c_path1 + "Preview.Bmp", c_path1 + "Preview.Bmp" ), ;
nRadio1 := 3, oRadio1:Refresh(), ;
nCbx1 := 3, oCbx1:Refresh() ) ;
FONT oFont ;
TOP
oBtn3:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
{ { 0.50, 3067734, 16777215 }, ;
{ 0.50, 16777215, 3067734 } }, ;
{ { 0.50, 3145727, 16777215 }, ;
{ 0.50, 16777215, 3145727 } } ) }
oBtn3:lTransparent := .t.
oBtn3:cToolTip = { "Change Image" + CRLF + "Button 1","CHANGE", 1, CLR_BLACK, 14089979 }
oBtn3:SetColor( 0, )
// ------------------------
@ 20, 125 COMBOBOX oCbx1 VAR nCbx1 ITEMS { "Change Button 1", "Change Button 2", "Reset" } ;
SIZE 110, 100 OF oFld:adialogs[1] PIXEL ;
ON CHANGE ( IIF( nCbx1 = 1, oBtn1:SetFile( c_path1 + "Info.Bmp", c_path1 + "Info.Bmp" ), NIL ), ;
IIF( nCbx1 = 2, oBtn2:SetFile( c_path1 + "Info.Bmp", c_path1 + "Info.Bmp" ), NIL ), ;
IIF( nCbx1 = 3, ( oBtn1:SetFile( c_path1 + "Exit1.Bmp", c_path1 + "Exit1.Bmp" ), ;
oBtn2:SetFile( c_path1 + "Preview.Bmp", c_path1 + "Preview.Bmp" ) ), NIL ) )
oCbx1:oFont := oFont
// -----
@ 55, 125 RADIO oRadio1 VAR nRadio1 ITEMS "Button 1", "Button 2", "Reset" SIZE 40, 15 ;
OF oFld:adialogs[1] PIXEL ;
ON CHANGE { || ( IIF( nRadio1 = 1, oBtn1:SetFile( c_path1 + "Info.Bmp", c_path1 + "Info.Bmp" ), NIL ), ;
IIF( nRadio1 = 2, oBtn2:SetFile( c_path1 + "Info.Bmp", c_path1 + "Info.Bmp" ),NIL), ;
IIF( nRadio1 = 3, ( oBtn1:SetFile( c_path1 + "Exit1.Bmp", c_path1 + "Exit1.Bmp" ), ;
oBtn2:SetFile( c_path1 + "Preview.Bmp", c_path1 + "Preview.Bmp" ) ),NIL) ) } UPDATE
AEval( oRadio1:aItems, { | oRad | oRad:lTransparent := .T., ;
oRad:SetFont ( oFont ), oRad:nClrText := 0 } )
ACTIVATE DIALOG oDlg NOWAIT CENTER
ACTIVATE WINDOW oWnd MAXIMIZED
RELEASE BRUSH oBrush1, oBrush2, oBrush3, oFont
RETURN NIL
// ------------------------
FUNCTION PaintTab( o, nOption )
IF nOption == o:nOver .OR. nOption == o:nOption
o:SetAlphaLevel( nOption, 255 )
ELSE
o:SetAlphaLevel( nOption, 50 )
ENDIF
RETURN o:SetFldColors( o, nOption )