// C:\FWH\SAMPLES\SILVFLD4.PRG
#include "FiveWin.ch"
#include "Constant.ch"
#define DLG_nColorDlg RGB(245,245,235)
#define DLG_nColortitle1 RGB(219,230,244)
#define DLG_nColortitle2 RGB(207,221,239)
#define DLG_nColorBar1 RGB(250,250,245)
#define DLG_nColorBar2 RGB(245,245,235)
#define DLG_nColorBtn1 RGB(245,245,235)
#define DLG_nColorBtn2 RGB(250,250,245)
#define DLG_nColorBtnB RGB(195,195,185)
FUNCTION Test_Folder_Silvio()
LOCAL oNew AS OBJECT
LOCAL oOpen AS OBJECT
LOCAL oExit AS OBJECT
LOCAL oDlg AS OBJECT
LOCAL oFld AS OBJECT
LOCAL oFont AS OBJECT
LOCAL oBold AS OBJECT
LOCAL oBar AS OBJECT
LOCAL oBrush AS OBJECT
LOCAL oImage AS OBJECT
LOCAL oCursorBtn := TCursor():New(, 'HAND' )
LOCAL aFolder := { "Menu1", "Menu2", "Menu3", "Menu4", "Menu5", "Menu6" }
LOCAL aCooDlg := { 0, 0 }, aGrad, nLinha := 14
LOCAL nBottom := 41
LOCAL nRight := 94.6
LOCAL nHt := nBottom * DLG_CHARPIX_H
LOCAL nWd := Max( nRight * DLG_CHARPIX_W, 180 )
aCooDlg[ 1 ] := nWd
aCooDlg[ 2 ] := nHt
oFont := TFont():New( "TAHOMA", 0, 18,, )
oBold := TFont():New( "TAHOMA", 0, 14,, .T. )
DEFINE DIALOG oDlg SIZE aCooDlg[ 1 ], aCooDlg[ 2 ] PIXEL TRUEPIXEL ;
FONT oFont TITLE "Test Folderex" COLOR CLR_BLACK, DLG_nColorDlg ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX )
DEFINE BUTTONBAR oBar BUTTONSIZE 40, 50 _3DLOOK OF oDlg 2015 BOTTOM GDIPLUS
WITH OBJECT oBar
oBar:bClrGrad := {| lPressed | If( ! lPressed, ;
{ { 1, DLG_nColorBar1, DLG_nColorBar1 } }, ;
{ { 1, DLG_nColorBar2, DLG_nColorBar2 } } ) }
oBar:bRClicked := {|| ( NIL ) } // Mouse Direito
oBar:bLClicked := {|| ( NIL ) } // Mouse Esquerdo
oBar:SetFont( oFont )
oBar:nClrText := CLR_HBLUE
oBar:Adjust()
END
DEFINE BUTTON oNew OF oBar FILENAME "..\bitmaps\16x16\new.bmp" FLAT ;
PROMPT "&New" ACTION MsgInfo( "New" ) ;
TOOLTIP "Creates a new document" GROUP
DEFINE BUTTON oOpen OF oBar FILENAME "..\bitmaps\16x16\open.bmp" FLAT ;
PROMPT "&Open" ;
ACTION MsgInfo( cGetFile( "*.*", "Select a document to open" ) ) ;
TOOLTIP "Opens a document" GROUP
DEFINE BUTTON oExit OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
PROMPT "&Exit" ACTION( oDlg:End() ) TOOLTIP "Exit this app" GROUP
/*
@ 005, 000 FOLDEREX oFld PROMPTS aFolder ;
SIZE oDlg:nWidth, oDlg:nHeight - 200 PIXEL ;
FONT oFont COLOR aGrad TAB HEIGHT 30 ROUND 5 TOP
*/
// 12/06/2024 - Joao
@ 005, 018 FOLDEREX oFld PROMPTS aFolder SIZE 700, 540 PIXEL ;
FONT oFont COLOR aGrad TAB HEIGHT 30 ROUND 0 TOP
WITH OBJECT oFld
:lTransparent := .T.
:aGradSel := { { 1.0, 3926784, 16777215 }, { 0.1, 3926784, 16777215 } } // Green
:aGradUnSel := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue
:aGradOver := { { 1.0, 255, 16777215 }, { 0.1, 255, 16777215 } } // Red
:aGradOverUnSel := { { 1.0, 12824535, 16777215 }, { 0.1, 12824535, 16777215 } } // Purple
:aGradDis := { { 1.0, 15790320, 16777215 }, { 0.1, 15790320, 167772 } }
//
:SetOption( 1 )
:aEnable = { .T., .T., .T., .T., .T., .T., .F. }
:Show()
// :DisableTab( 3 ) // idem a :aEnable
:oCursor := oCursorBtn
END
@ nLinha, 15 SAY "FOLDER 1:" OF oFld:aDialogs[ 1 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "FOLDER 2:" OF oFld:aDialogs[ 2 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "FOLDER 3:" OF oFld:aDialogs[ 3 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "FOLDER 4:" OF oFld:aDialogs[ 4 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "FOLDER 5:" OF oFld:aDialogs[ 5 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "FOLDER 6:" OF oFld:aDialogs[ 6 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
oFld:bAction := {|| Change_Size( oFld:nOption, aCooDlg, oDlg, oFld, oBar ) }
oDlg:bResized := < ||
LOCAL oRect := { 0, 0, 645, 740 } // USE fix value instead of Function oDlg:GetCliRect()
oFld:nbottom := 550 // oRect:nBottom - 100
RETURN NIL
>
// only test
@ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
OF oFld:aDialogs[ 1 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
TRANSPARENT UPDATE CENTER PIXEL
@ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
OF oFld:aDialogs[ 2 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
TRANSPARENT UPDATE CENTER PIXEL
@ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
OF oFld:aDialogs[ 3 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
TRANSPARENT UPDATE CENTER PIXEL
@ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
OF oFld:aDialogs[ 4 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
TRANSPARENT UPDATE CENTER PIXEL
@ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
OF oFld:aDialogs[ 5 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
TRANSPARENT UPDATE CENTER PIXEL
@ 170, 90 SAY OemToAnsi( "Silvio Falconi, Este ‚s un Show de Folderex." ) ;
OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS METRO_VIOLET, CLR_WHITE FONT oBold ;
TRANSPARENT UPDATE CENTER PIXEL
@ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
TRANSPARENT UPDATE CENTER PIXEL
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oDlg:Resize(), ChangeButtons( oBar ) )
oBold:End()
oFont:End()
RETURN NIL
FUNCTION Change_Size( n, aCooDlg, oDlg, oFld, oBar )
LOCAL nBottom, nHt
/* not need when using FIX value
DO CASE
CASE n = 3
nBottom := 32.4
nHt := nBottom * DLG_CHARPIX_H + 28 // For Buttons in Dialog
CASE n = 6
nBottom := 22
nHt := nBottom * DLG_CHARPIX_H + 184 // For Buttons in Dialog
OTHERWISE
nHt := aCooDlg[ 2 ] // - 50 // Only test Silvio.
ENDCASE
*/
// USE fix value
nHt := 645
oDlg:Hide()
oDlg:SetSize( aCooDlg[ 1 ], nHt )
oDlg:Show()
Eval( oDlg:bResized )
RETURN NIL
FUNCTION ChangeButtons( oBar ) // No comprendo esto. ??
AEval( oBar:aControls, {| oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
RETURN( .T. )
// FIN / END