// C:\FWH..\SAMPLES\TESTFX1.PRG
#include "FiveWin.ch"
#include "xbrowse.ch"
#include "gif.ch"
function main()
local oWnd, i, oBrw, oBrush2, oCtrl, oGroup
local oFld, oFld1, aList
local aMonths := {"January", "February", "March", ;
"April", "May", "June", ;
"July", "August", "September", ;
"October", "November", "December"}
local aBitmaps := { "..\bitmaps\alphabmp\facebook.bmp",;
"..\bitmaps\alphabmp\windows.bmp",;
"..\bitmaps\alphabmp\game.bmp",;
"..\bitmaps\alphabmp\viddler.bmp",;
"..\bitmaps\alphabmp\mail.bmp",;
"..\bitmaps\alphabmp\call.bmp",;
"..\bitmaps\alphabmp\settings2.bmp",;
"..\bitmaps\alphabmp\exit.bmp" }
DEFINE BRUSH oBrush2 FILE "..\bitmaps\backgrnd\metal.bmp"
DEFINE WINDOW oWnd TITLE "TFolderex - Testing -"
@ 3, 3 FOLDEREX oFld PIXEL ADJUST;
PROMPT "&Social1", "&OS2", "&Games3", "&Movies4", "&Email5", "Mo&nths6", "Se&tting7", "E&xit";
BITMAPS aBitmaps;
ACTION( If( nOption == 8, oWnd:End(), ;
MsgInfo( "Action defined to " + StrTran( ::aPrompts[ nOption ], "&", "" ) ) ) );
ON PAINT TAB PaintTab( Self, nOption );
POPUP MenuTabs( Self, nOption );
ON CHANGE ( If( nOption == 8, If( MsgYesNo( "Do you want exit??" ), ;
oWnd:End(), ( ::SetOption( nOldOption ), ::Refresh() ) ), ) );
ON PAINT TEXT( If( nOption == ::nOption .and. nOption == 2, CLR_YELLOW, CLR_BLACK ) );
TOP OPTION 2 ALIGN AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_RIGHT;
ANIMATE SPEED 50
oFld:SetBrightBmp( "..\bitmaps\alphabmp\exit2.bmp", 8 )
//Dialog Social
@ 3,10 FOLDEREX OF oFld:aDialogs[ 1 ] PIXEL SIZE 450, 190 ;
PROMPT "Facebook", "MySpace", "Twitter" ;
BITMAPS "..\bitmaps\alphabmp\Facebook.bmp", ;
"..\bitmaps\alphabmp\myspace.bmp", ;
"..\bitmaps\alphabmp\Twitter.bmp"
//Dialog OS
@ 3,10 FOLDEREX OF oFld:aDialogs[ 2 ] PIXEL SIZE 450, 190 ;
PROMPT "", "", "";
BITMAPS "..\bitmaps\alphabmp\windows.bmp", ;
"..\bitmaps\alphabmp\apple.bmp",;
"..\bitmaps\alphabmp\ubuntu.bmp";
ALIGN AL_LEFT, AL_CENTER, AL_RIGHT
//Dialog Game
aList = {}
for i := 1 to 20
AAdd( aList, { "Game-" + Chr(64+i), ;
"Description for Game-" + Chr(64+i), ;
Round( hb_Random( 100, 999 ), 2 ) } )
next i
@ 0,0 xBrowse oBrw OF oFld:aDialogs[ 3 ] ARRAY aList LINES
oBrw:CreateFromCode()
oFld:aDialogs[ 3 ]:oClient = oBrw
//Dialog Game
@ 1, 1 GIF FILE "..\gifs\matrix4.gif" OF oFld:aDialogs[ 4 ]
@ 1, 165 GIF FILE "..\gifs\matrix5.gif" OF oFld:aDialogs[ 4 ]
@ 1, 330 GIF FILE "..\gifs\matrix.gif" OF oFld:aDialogs[ 4 ] SIZE 176, 262 ADJUST
@ 125, 1 GIF FILE "..\gifs\matrix3.gif" OF oFld:aDialogs[ 4 ] SIZE 324, 137 ADJUST
//Dialog Mail
@ 3,10 FOLDEREX OF oFld:aDialogs[ 5 ] PIXEL SIZE 450, 190 ;
PROMPT "Gmail", "Outlook", "Yahoo";
BITMAPS "..\bitmaps\alphabmp\gmail.bmp", ;
"..\bitmaps\alphabmp\Outlook.bmp", ;
"..\bitmaps\alphabmp\yahoo.bmp";
TAB HEIGHT 45 ROUND 5
//Dialog Months
// Suport Arrays and list
@ 3,10 FOLDEREX OF oFld:aDialogs[ 6 ] PIXEL SIZE 450, 190 ;
PROMPT aMonths ;
TAB HEIGHT 18 ROUND 0;
ON PAINT TAB ChangeClr( Self, nOption );
ON PAINT TEXT ChangeTxtClr( Self, nOption )
//Dialog Setting
oFld:aDialogs[ 2 ]:SetBrush( oBrush2 )
@ 3,10 FOLDEREX OF oFld:aDialogs[ 7 ] PIXEL SIZE 450, 190 /*;
PROMPT aMonths ;
TAB HEIGHT 18 ROUND 0;
ON PAINT TAB ChangeClr( Self, nOption );
ON PAINT TEXT ChangeTxtClr( Self, nOption )*/
// oCtrl := TGroup():New(2,2,5,30,"tGroup class()",oFld:aDialogs[ 7 ],,CLR_WHITE,.f.,,,.f.) // this line added: tGroup control
@ 040, 10 GROUP oGroup TO 150, 248 LABEL "tGroup class()" OF oFld:aDialogs[ 7 ] PIXEL ;
TRANSPARENT
@ 05, 3 SAY "UNDER CONSTRUCTION" OF oFld:aDialogs[ 7 ] TRANSPARENT
ACTIVATE WINDOW oWnd;
ON INIT oFld:Resize()
RETURN NIL
FUNCTION PaintTab( o, nOption )
LOCAL hBrush, hBmp, nLastRow
IF nOption == o:nOption .and. nOption == 2
hBmp = ReadBitmap( 0, "..\bitmaps\backgrnd\metal.bmp" )
hBrush = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
nLastRow = o:aPos[ o:aLines[ o:aOrder[ 1 ] ][ 1 ] ][ 2 ] + o:nFolderHeight
SetBrushOrgEx( o:hDC, 1, nLastRow + 2 )
RETURN hBrush
ENDIF
RETURN o:SetFldColors( o, nOption )
FUNCTION ChangeClr( o, n )
LOCAL nMonth := Month( Date() )
LOCAL aGrad1 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 255, 240, 180 ) },;
{ 0.5, nRGB( 255, 240, 180 ), nRGB( 255, 200, 140 ) } }
LOCAL aGrad2 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 200, 200, 240 ) },;
{ 0.5, nRGB( 200, 200, 240 ), nRGB( 100, 100, 240 ) } }
LOCAL aGrad3 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 255, 240, 240 ) },;
{ 0.5, nRGB( 255, 240, 240 ), nRGB( 255, 200, 200 ) } }
LOCAL aGradMonth := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 185, 207, 147 ) },;
{ 0.5, nRGB( 185, 207, 147 ), nRGB( 85, 107, 47 ) } }
LOCAL hBrush, aGrad
IF n == nMonth
aGrad = aGradMonth
ELSE
IF n > 0 .AND. n < 5
aGrad = aGrad1
ELSEIF n > 4 .AND. n < 9
aGrad = aGrad2
ELSE
aGrad = aGrad3
ENDIF
ENDIF
o:aGradUnSel = aGrad
hBrush = o:SetFldColors( o, n )
RETURN hBrush
FUNCTION ChangeTxtClr( o, n )
LOCAL nMonth := Month( Date() )
LOCAL nClr := CLR_BLACK, ;
nClr1 := CLR_HRED
IF n > 0 .AND. n < 7
nClr = nClr1
ENDIF
RETURN nClr
FUNCTION MenuTabs( oFld, nOpt )
LOCAL oMenu
MENU oMenu POPUP 2007
MENUITEM oFld:aPrompts[ nOpt ]
SEPARATOR
MenuAddItem( "Show", , ;
oFld:aVisible[ nOpt ], ,;
{|| If( oFld:aVisible[ nOpt ], ;
oFld:HideTab( nOpt ), ;
oFld:ShowTab( nOpt ) ) } )
MenuAddItem( "Enabled", , ;
oFld:aEnable[ nOpt ], ,;
{|| If( oFld:aEnable[ nOpt ], ;
oFld:DisableTab( nOpt ), ;
oFld:EnableTab( nOpt ) ) } )
ENDMENU
RETURN oMenu
// FIN / END