#include "fivewin.ch"
#include "xbrowse.ch"
#include "metropnl.ch"
static oMetro, oTools
static nClrBack := CLR_GREEN
//----------------------------------------------------------------------------//
function Main( cParam )
local oWnd, oBar, oMetro, oBrush
local cTitle := "Start"
SET DATE ITALIAN
SET CENTURY ON
DEFINE WINDOW oWnd TITLE cTitle STYLE nOr( WS_POPUP, WS_MAXIMIZE );
COLOR CLR_WHITE, CLR_GREEN
oMetro := MakeMetroPanel( oWnd )
DEFINE BRUSH oBrush FILE '..\bitmaps\hires\earth.bmp' RESIZE
oMetro:SetBrush( oBrush )
oBrush:End()
oMetro:bRClicked := { |r,c,f,o| msginfo( 'HWND' + NUMTOHEX( oWnd:hWnd, 8 ) ) }
ACTIVATE WINDOW oWnd MAXIMIZED ON INIT oMetro:Show()
return nil
//----------------------------------------------------------------------------//
static function MakeMetroPanel( oWnd )
local oMetro, oBtn
DEFINE METROPANEL oMetro OF oWnd TITLE "Start" ;
COLOR CLR_WHITE, CLR_GREEN ;
ON CLICK oWnd:End()
oMetro:lDesignMode := .t.
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_HBLUE,CLR_WHITE ;
CAPTION "Metro" ;
ALIGN "MIDDLECENTER" ;
BITMAP "..\bitmaps\fivetech3.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 50, 50 ;
BODYTEXT "FiveWin Power" ;
TEXTALIGN "BOTTOMRIGHT" ;
BACKGROUND "..\bitmaps\fiveback.bmp" ;
LARGE ;
ACTION oMetro:Minimize() // aca minimiza
oBtn:nClrCaption := CLR_HRED
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 86, 177, 14 ) ;
CAPTION "Tile Components" ;
ALIGN "TOPRIGHT" ;
BITMAP "..\bitmaps\metro\contact.bmp" ;
BMPALIGN "BOTTOMRIGHT" ;
SIZE 50, 50 ;
BODYTEXT "Caption;BodyText;Bitmap;BackGround" ;
TEXTALIGN "MIDDLELEFT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR RGB( 15, 15, 15 ),RGB( 213, 177, 1 ) ;
CAPTION "Align Component" ;
ALIGN "TOPRIGHT" ;
BODYTEXT "Left-Center-Right;Top-Mid-Bottom" ;
TEXTALIGN "BOTTOMCENTER" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR RGB( 15, 15, 15 ),RGB( 219, 239, 107 ) ;
CAPTION "Image Types" ;
ALIGN "TOPRIGHT" ;
BITMAP "..\bitmaps\AlphaBmp\explorer.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 50, 50 ;
BODYTEXT "Bmp, Jpg;Ico;Png, ....any" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 86, 177, 14 ) ;
CAPTION "Image Size" ;
ALIGN "TOPRIGHT" ;
BITMAP "..\bitmaps\olga1.jpg" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 50, 50 ;
BODYTEXT "Tile Image AutoReszed;Bitmap to Specify" ;
TEXTALIGN "MIDDLERIGHT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 70, 133 ) ;
CAPTION "Design" ;
ALIGN "TOPCENTER" ;
BITMAP "..\bitmaps\metro\utilities.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 50, 50 ;
BODYTEXT "Right Click;to Design;All Components" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR RGB( 255, 255, 128 ),RGB( 202, 7, 218 ) ;
CAPTION "Re-Arrange" ;
ALIGN "TOPCENTER" ;
BODYTEXT "By Just;Drag && Drop" ;
TEXTALIGN "MIDDLECENTER"
oBtn:nClrCaption := CLR_WHITE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR RGB( 15, 15, 15 ),RGB( 213, 177, 1 ) ;
CAPTION "Generate Code" ;
ALIGN "TOPRIGHT" ;
BODYTEXT "Right Click;Generate Code;Tile or Metro" ;
TEXTALIGN "MIDDLELEFT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR RGB( 15, 15, 15 ),RGB( 255, 128, 0 ) ;
CAPTION "Scroll" ;
ALIGN "TOPCENTER" ;
BODYTEXT "Horizontally;by MouseWheel" ;
TEXTALIGN "BOTTOMCENTER"
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 174, 224 ) ;
CAPTION "Sub Menu" ;
ALIGN "TOPLEFT" ;
BITMAP "..\bitmaps\metro\files.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48 ;
BODYTEXT "Click to View;Directory" ;
TEXTALIGN "MIDDLERIGHT" ;
LARGE ;
MENU MetroFiles()
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 174, 224 ) ;
CAPTION "Folders" ;
ALIGN "TOPRIGHT" ;
BITMAP "..\bitmaps\AlphaBmp\folder.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 64, 64 ;
BODYTEXT "Rearrange;Tiles by;Drag && Drop" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION {|o| MsgInfo( o:cCaption ) }
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 234, 112, 39 ) ;
CAPTION "Pictures" ;
ALIGN "TOPRIGHT" ;
BITMAP "..\bitmaps\metro\graphics.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48 ;
BACKGROUND "..\bitmaps\olga1.jpg" ;
MENU ImageFiles()
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 70, 133 ) ;
CAPTION "Internet" ;
ALIGN "TOPRIGHT" ;
BITMAP "..\bitmaps\metro\internet.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48 ;
BODYTEXT "Favourites;Forums" ;
TEXTALIGN "MIDDLERIGHT" ;
BACKGROUND "..\bitmaps\hires\earth.bmp" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 86, 177, 14 ) ;
CAPTION "Calculator" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "..\bitmaps\metro\calculator.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48 ;
ACTION WinExec( "calc" )
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 174, 224 ) ;
CAPTION "Reports" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "..\bitmaps\metro\print.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 24, 152, 78 ) ;
CAPTION "Utilities" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "..\bitmaps\metro\utilities.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48 ;
BODYTEXT "RightClick;to Design" ;
TEXTALIGN "BOTTOMRIGHT"
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 234, 112, 39 ) ;
CAPTION "Customers" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "..\bitmaps\metro\users.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48 ;
BODYTEXT "Sales;Promotions" ;
TEXTALIGN "MIDDLERIGHT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 181, 31, 60 ) ;
CAPTION "Stock" ;
ALIGN "TOPLEFT" ;
GROUP 2 ;
BITMAP "..\bitmaps\metro\stock.bmp" ;
BMPALIGN "BOTTOMRIGHT" ;
SIZE 48, 48 ;
BODYTEXT "Quotes;Trends" ;
TEXTALIGN "BOTTOMLEFT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_BLACK,RGB( 213, 177, 1 ) ;
CAPTION "Contacts" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "..\bitmaps\metro\contact.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48 ;
BODYTEXT "Family;Friends;Business" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 70, 133 ) ;
CAPTION "Movies" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "..\bitmaps\alphabmp\ichat.bmp" ;
BMPALIGN "MIDDLECENTER" ;
SIZE 80, 80 ;
BODYTEXT "3D;HD;DVD" ;
TEXTALIGN "BOTTOMLEFT" ;
LARGE
DEFINE METROBUTTON oBtn OF oMetro ;
COLOR CLR_WHITE,RGB( 86, 177, 14 ) ;
CAPTION "Exit" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "..\bitmaps\metro\exit.bmp" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 48, 48 ;
ACTION If( MsgYesNo( "Want to exit ?" ), oWnd:End(),)
return oMetro
//----------------------------------------------------------------------------//
static function MetroFiles( oWnd )
local oMetro, n
local aDir := Directory( "*.*" )
DEFINE METROPANEL oMetro OF oWnd TITLE "Files" ;
COLOR CLR_WHITE, nClrBack
for n := 1 to Min( Len( aDir ), 20 )
oMetro:AddButton( .t., nil, aDir[ n ][ 1 ],nil,nil,nil,"..\metro\files.bmp" )
next
return oMetro
//----------------------------------------------------------------------------//
static function ImageFiles( oWnd )
local oMetro, aFiles, aFile
aFiles := Directory( "..\bitmaps\AlphaBmp\*.bmp" )
DEFINE METROPANEL oMetro OF oWnd TITLE "Bitmaps" ;
COLOR CLR_WHITE, nClrBack
for each aFile in aFiles
DEFINE METROBUTTON OF oMetro ;
CAPTION aFile[ 1 ] ALIGN 'BOTTOMCENTER' ;
BITMAP "..\bitmaps\AlphaBmp\" + aFile[ 1 ] ;
BMPALIGN "TOPCENTER"
next
return oMetro
//----------------------------------------------------------------------------//
static function ExitTo( cExe )
if File( cExe )
WinExec( cExe )
WndMain():End()
else
MsgInfo( cExe + " not found" )
endif
return nil
//----------------------------------------------------------------------------//