Code: Select all
#include "Fivewin.ch"
Static aRes
Function Main()
local oWnd
local nRow := 2
local nCol := 2
local nWAlto := 760
local nWAncho := 1360
local oPanel
aRes := { GetSysMetrics(0), GetSysMetrics(1) }
DEFINE WINDOW oWnd FROM nRow, nCol TO nWAlto + nRow, nWAncho + nCol ;
PIXEL TITLE "Movimentos do Dia "+Dtoc( Date() ) ; //MENU oMenu ;
COLOR CLR_WHITE, Rgb( 182, 182, 182 ) // VSCROLL //NOSYSMENU //NOZOOM //NOMINIMIZE
// CreateDocks(oWnd)
oPanel := TScrollPanel() : New( 1, 1, oWnd:nHeight, oWnd:nWidth, oWnd, .f. )
oPanel:SetColor( , CLR_WHITE )
ACTIVATE WINDOW oWnd MAXIMIZED ON INIT ( CreateDocks( oPanel ), oPanel:SetRange() )
Return nil
STATIC FUNCTION CreateDocks(oWnd)
LOCAL aPos:={},oFnt,oDock[4]
DEFINE FONT oFnt NAME "CALIBRI" SIZE 0,-16
Aadd(aPos,{ 014, 005, 370, 278 } )
Aadd(aPos,{ 014, 300, 360, aRes[1] - 10 } )
Aadd(aPos,{ 390, 300, aRes[2]/3 + 390, aRes[1] - 10 + 300 } )
oDock[1] := TDockPnel():New( oWnd )
WITH OBJECT oDock[1]
:SetCoors( aPos[1,1], aPos[1,2], aPos[1,3], aPos[1,4] )
:SetHeightCaption( 40 )
:SetBorderSize( 4 )
:SetCaption( "Calendário" )
:SetColors( CLR_WHITE, METRO_OLIVE, , )
:SetFont( oFnt )
:cAlignText := "CC"
:SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog( o, nT, nL, nH, nW, 1 ) } )
:Activate()
END
oDock[2] := TDockPnel():New( oWnd )
WITH OBJECT oDock[2]
:SetCoors( aPos[2,1], aPos[2,2], Int( aRes[ 1 ] / 6 ), aPos[2,4] - if( oWnd:WinStyle( WS_VSCROLL ), 20, 0 ) )
:SetHeightCaption( 40 )
:SetBorderSize( 4 )
:SetCaption( "Autorizações" )
:SetColors( CLR_WHITE, METRO_OLIVE, , )
:SetFont( oFnt )
:cAlignText := "CC"
:SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog( o, nT, nL, nH, nW, 2 ) } )
:Activate()
END
oDock[3] := TDockPnel():New( oWnd )
WITH OBJECT oDock[3]
:SetCoors( { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom + 10, o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 2 ]:nLeft, o ) }, ;// { | o | Int( 2 * aRes[ 1 ] / 6 ) + 20 }, ;
{ | o | XEval( o:oWnd:aControls[ 2 ]:nBottom + 10 + Int( aRes[ 2 ] / 2 ) , o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 2 ]:nRight, o ) } )
// :SetCoors( aPos[3,1], aPos[3,2], aPos[3,3], aPos[3,4] )
:SetHeightCaption( 40 )
:SetBorderSize( 4 )
:SetCaption( "Faturamento" )
:SetColors( CLR_WHITE, METRO_OLIVE, , )
:SetFont( oFnt )
:cAlignText := "CC"
:SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog( o, nT, nL, nH, nW, 3 ) } )
:Activate()
END
oDock[4] := TDockPnel():New( oWnd )
WITH OBJECT oDock[4]
:SetCoors( { | o | XEval( o:oWnd:aControls[ 3 ]:nBottom + 10, o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 3 ]:nLeft, o ) }, ; // { | o | Int( 3 * aRes[ 1 ] / 6 ) + 30 }, ;
{ | o | XEval( o:oWnd:aControls[ 3 ]:nBottom + 10 + Int( aRes[ 2 ] / 2 ) , o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 3 ]:nRight, o ) } )
:SetHeightCaption( 40 )
:SetBorderSize( 4 )
:SetCaption( "Baixas" )
:SetColors( CLR_WHITE, METRO_OLIVE, , )
:SetFont( oFnt )
:cAlignText := "CC"
:SetCtrlsPnel( { | o, nT, nL, nH, nW | DefDialog( o, nT, nL, nH, nW, 4 ) } )
:Activate()
END
oFnt:End()
RETURN nil
STATIC FUNCTION DefDialog( oP, nT, nL, nH, nW, nD )
LOCAL oCol,k,oLbx[3]
local aData := { { "JAN", 1000, 1200, 900, 400, 700, 400 }, ;
{ "FEB", 1100, 1300, 1000, 500, 800, 500 }, ;
{ "MAR", 1050, 1800, 1900, 700, 1400, 1600 }, ;
{ "APR", 1825, 1975, 1850, 675, 1100, 1425 }, ;
{ "MAY", 2000, 1670, 1550, 675, 1100, 1425 }, ;
{ "JUN", 0970, 1025, 1100, 675, 1100, 1425 }, ;
{ "JUL", 1150, 1600, 1750, 675, 1100, 1425 }, ;
{ "AUG", 1250, 1700, 1850, 675, 1100, 1425 }, ;
{ "SEP", 1150, 1320, 1450, 675, 1100, 1425 }, ;
{ "OCT", 1250, 1700, 1850, 675, 1100, 1425 }, ;
{ "NOV", 1250, 1700, 1850, 675, 1100, 1425 }, ;
{ "DEC", 1250, 1700, 1850, 675, 1100, 1425 } ;
}
RETURN nil