Code: Select all | Expand
// C:\FWH\SAMPLES\SILVFLD2.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)
#Define aPubGrad {| lInvert | If( lInvert, ;
{ { 1 / 3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2 / 3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } ;
}, ;
{ { 1 / 2, nRGB( 219, 230, 244 ), nRGB( 207 - 50, 221 - 25, 255 ) }, ;
{ 1 / 2, nRGB( 201 - 50, 217 - 25, 255 ), nRGB( 231, 242, 255 ) } ;
} ) }
STATIC oBtnAnnulla, oBtnAiuto, oBtnConferma
FUNCTION Test_Folder_Silvio()
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 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
SkinButtons()
aGrad := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue
DEFINE BRUSH oBrush COLOR aGrad
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 Folder Advanced by Silvio Falconi" ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX ) BRUSH oBrush
DEFINE BUTTONBAR oBar BUTTONSIZE 40, 50 _3DLOOK TOP OF oDlg 2007
WITH OBJECT oBar // VER: ANCHO.PRG
oBar:bClrGrad := aPubGrad
oBar:bRClicked := { || ( NIL ) } // Mouse Direito
oBar:bLClicked := { || ( NIL ) } // Mouse Esquerdo
oBar:SetFont( oBold )
oBar:nClrText := CLR_HBLUE // BLACK
oBar:Adjust()
END
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\new.bmp" FLAT ;
ACTION MsgInfo( "New" ) ;
TOOLTIP "Creates a new document" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\open.bmp" FLAT ;
ACTION MsgInfo( cGetFile( "*.*", "Select a document to open" ) ) ;
TOOLTIP "Opens a document" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\floppy.bmp" FLAT ;
ACTION MsgInfo( Time() ) TOOLTIP "Saves this document" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\printer.bmp" FLAT ;
ACTION MsgInfo( "Prints this document" ) TOOLTIP "Print this document" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\prop.bmp" FLAT ;
ACTION( NIL ) TOOLTIP "Setup the printer" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\HelpInd.bmp" FLAT ;
ACTION MsgInfo( Version() ) TOOLTIP "A multiple lines" + ;
Chr( 13 ) + Chr( 10 ) + "tooltip!" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Help.bmp" FLAT ;
ACTION MsgInfo( "fivewin power!" ) TOOLTIP "fivewin power!" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
ACTION( oDlg:End() ) TOOLTIP "Exit this app" GROUP
@ 060, 0 FOLDEREX oFld PROMPTS aFolder ;
SIZE oDlg:nWidth, oDlg:nHeight - 200 PIXEL ;
FONT oFont COLOR aGrad ;
TAB HEIGHT 40 ROUND 5 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 := oHand
END
@ nLinha, 15 SAY "Código 1:" OF oFld:aDialogs[ 1 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "Código 2:" OF oFld:aDialogs[ 2 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "Código 3:" OF oFld:aDialogs[ 3 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "Código 4:" OF oFld:aDialogs[ 4 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "Código 5:" OF oFld:aDialogs[ 5 ] FONT oFont UPDATE ;
COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL
@ nLinha, 15 SAY "Código 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 := oDlg:GetCliRect()
oFld:nbottom := oRect:nBottom - 100
RETURN NIL
>
@ 080, 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 ) )
oBrush:End()
oBold:End()
oFont:End()
RETURN NIL
FUNCTION change_size( n, aCooDlg, oDlg, oFld, obar )
LOCAL nBottom, nHt
DO CASE
CASE n = 3
nBottom := 32.4
nHt := nBottom * DLG_CHARPIX_H
CASE n = 6
nBottom := 22
nHt := nBottom * DLG_CHARPIX_H
OTHERWISE
nHt := aCooDlg[ 2 ]
ENDCASE
oDlg:Hide()
oDlg:SetSize( aCooDlg[ 1 ], nHt )
oDlg:Show()
Eval( oDlg:bResized )
oBar:Refresh()
// oDlg:Refresh()
RETURN NIL
FUNCTION ChangeButtons( oBar )
AEval( oBar:aControls, {| oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
RETURN( .T. )
// FIN / END - kapiabafwh@gmail.com
Regards, saludos.