#include "FiveWin.ch"
#include "Constant.ch"
#define DEF_COLOR1 nRgb( 245,244,234)
#define DEF_COLOR2 nRgb(233,229,206)
#define DEF_COLOR3 RGB( 238,236,219 )
#define DEF_COLOR4 nRgb(218,214,179)
#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()
local oDlg,oFld,oFont,oBold
local oBar,oBtnAnnulla,oBtnAiuto,oBtnConferma
local aFolder := {"Menu1","Menu2","Menu3","Menu4","Menu5","Menu6"}
local aCooDlg := {0,0}
// per la dialog e folder
local nHeight:= 680
local aPt := { 111,200 }
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 870,nHeight PIXEL TRUEPIXEL;
FONT oFont title "test folder" COLOR CLR_BLACK, DLG_nColorDlg ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX)
aPt := ClientToScreen( oDlg:hWnd, aPt )
//-------------------------------------------------ButtonBar
DEFINE BUTTONBAR oBar OF oDlg SIZE 84, 70 2015 BOTTOM NOBORDER
DEFINE BUTTON oBtnAnnulla OF oBar ;
FILENAME "DLG_NO";
PROMPT "Annulla" TOOLTIP "Esci" ;
ACTION ( oDlg:end( IDCANCEL ) )
DEFINE BUTTON oBtnAiuto OF oBar ;
FILENAME "HLP_DLG";
PROMPT "Aiuto" TOOLTIP "Aiuto" ;
ACTION NIL GROUP
DEFINE BUTTON oBtnConferma OF oBar BTNRIGHT ;
FILENAME "DLG_OK";
PROMPT "Conferma" ;
TOOLTIP "Conferma i dati" ;
ACTION ( oDlg:end( IDOK ) )
oBar:bClrGrad := { | lPressed | If( ! lPressed,;
{ { 1, DLG_nColorBar1, DLG_nColorBar1} },;
{ { 1, DLG_nColorBar2, DLG_nColorBar2} } ) }
//-----------------------------------------------------------------//
@100,0 FOLDEREX oFolder PROMPTS aFolder ;
SIZE oDlg:nWidth,oDlg:nHeight-oBar:nheight PIXEL ;
FONT oFont ;
COLOR nRgb( 245,244,234) ROUND 0
oFolder:bAction := { || IF(oFolder:nOption=3 .or. oFolder:nOption=6 ,;
(oDlg:nHeight:=400,oDlg:Move( aPt[ 1 ] , aPt[ 2 ] )),;
(oDlg:nHeight:=680,oDlg:Move( aPt[ 1 ] , aPt[ 2 ] )) ) }
oDlg:bResized := <||
local oRect := oDlg:GetCliRect()
oFolder:nTop := oRect:ntop+120
oFolder:nHeight := oRect:nbottom-190
oFolder:nWidth := oRect:nWidth
oBar:GoDown()
oBar:refresh()
return nil
>
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oDlg:Move( aPt[ 1 ] , aPt[ 2 ] ),;
Eval( oDlg:bResized),;
ChangeButtons(oBar ),;
oBar:refresh(),;
Eval(oFolder:baction) )
//------------------------------------------------------------------------//
function ChangeButtons( oBar )
AEval( oBar:aControls, { | oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
return .T.
//----------------------------------------------//