oDock3 := TDockPnel():New( oWindow )
WITH OBJECT oDock3
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom, o ) + 10 }, ; // utilizo el nBottom del segundo control definido, o sea oDock2
{ | o | 10 }, ; // Empiezo en la columna 10, aunque igualmente podria haberle dicho { | o | XEval( o:oWnd:aControls[ 1 ]:nLeft, o ) }
{ | o | Int( o:oWnd:nHeight / 2 ) + XEval( o:oWnd:aControls[ 2 ]:nHeight, o ) - 94 }, ; // Establezco el nBottom del dockpnel referenciando a la altura total de la ventana y la altura del dockpanel numero 2, esto está hecho asi como ejemplo para que se entienda que la complejidad del cálculo puede ser la que el usuario decida, pero podría ser más sencillo evidentemente
{ | o | XEVal( o:oWnd:aControls[ 2 ]:nRight, o ) } ) // Por último, referencio el right de este dockpnel al right del dockpnel 2, para que se queden alineados por la derecha
oDock1 := TDockPnel():New( oWindow )
WITH OBJECT oDock1
:SetHeightCaption( 40 )
:SetCoors( { | o | 10 }, { | o | 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) + 54 }, ; // El nBottom es la mitad de la ventana. Por qué el 54, para realizar un ajuste, prueba a quitarlo
{ | o | Int( o:oWnd:nWidth / 2 ) - XEVal( o:nLeft, o ) } ) // Esto es lo que he tenido que modificar ya que antes dividia por / 3, porque habia tres dockpnels horizontales, y ahora solo necesito 2
oDock2 := TDockPnel():New( oWindow )
WITH OBJECT oDock2
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 1 ]:nTop, o ) }, ; // Mismo nTop que el 1
{ | o | XEval( o:oWnd:aControls[ 1 ]:nRight, o ) + 10 }, ; // El nLeft a partir del nRight del DockPnel 1 mas una separación, si quiero
{ | o | XEval( o:oWnd:aControls[ 1 ]:nBottom, o ) }, ; // para que tenga el nBottom igual que el 1, y por lo tanto la misma altura
{ | o | Int( o:oWnd:nWidth / 2 ) + XEval( o:nLeft, o ) - 40 } ) // Como el dock 1 ocupa la mitad, este ocupará la otra mitad. Modifica el 40 para que se ajuste mejor a la parte derecha de la ventana
#include "Fivewin.ch"
#include "colores.ch"
#include "tgraph.ch"
#include "ribbon.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Static oWindow
Static nWAncho
Static nWAlto
Static nCol
Static nRow
Static oFont
Static oFontB
Static oFontD
Static oFont1
Static oFont2
Static oFont3
Static oFont4
Static oFontE
Static oFontS
Static oFontCtrl
Static cPathApp
Static oDock1
Static oDock2
Static oDock3
Static oDock4
Static oDock5
Static cText := ""
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function Main()
local cFont := "Liberation Mono" //TAHOMA //CALIBRI //SEGOE UI SYMBOL
SetResDebug( .T. )
//? JPEGLee()
cPathApp := cFilePath( GetModuleFileName( GetInstance() ) )
FErase( cPathApp + "Checkres.txt" )
DEFINE FONT oFont NAME cFont SIZE 0,-11
DEFINE FONT oFontB NAME cFont SIZE 0,-14 BOLD //ARIAL NARROW
DEFINE FONT oFont1 NAME cFont SIZE 0,-11 BOLD
DEFINE FONT oFontE NAME cFont SIZE 0,-14
DEFINE FONT oFont2 NAME cFont SIZE 0,-16
DEFINE FONT oFont3 NAME cFont SIZE 0,-20 //BOLD
DEFINE FONT oFont4 NAME "CALIBRI" SIZE 0,-16
DEFINE FONT oFontCtrl NAME cFont SIZE 0, -9 BOLD
DEFINE FONT oFontS NAME "FIXEDSYS" SIZE 0,-12
TestDockPnel()
oFont:End()
oFont1:End()
oFont2:End()
oFont3:End()
oFont4:End()
oFontB:End()
oFontE:End()
oFontCtrl:End()
oFontS:End()
Checkres()
Return nil
//----------------------------------------------------------------------------//
FUNCTION JPEGLee()
#pragma __binarystreaminclude "..\bitmaps\olga1.jpg" | RETURN %s
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Static Function TestDockPnel()
local nCol
local nRow
TDockPnel():lAllowMove := .T.
nWAncho := Int( GetSysMetrics( 0 ) * 0.95 )
nWAlto := Int( GetSysMetrics( 1 ) * 0.95 )
nCol := Int( ( GetSysMetrics( 0 ) - nWAncho ) / 2 )
nRow := Int( ( GetSysMetrics( 1 ) - nWAlto ) / 2 ) // + 2
DEFINE WINDOW oWindow FROM nRow, nCol TO nWAlto + nRow, nWAncho + nCol ; //MDI ;
PIXEL TITLE "Test TDockPnel Control - " + FWVERSION ;
COLOR CLR_WHITE, Rgb( 182, 182, 182 )
CreaDocks()
ACTIVATE WINDOW oWindow // ON INIT CreaDocks()
Return nil
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function CreaDocks()
oDock1 := TDockPnel():New( oWindow )
WITH OBJECT oDock1
:SetHeightCaption( 40 )
:SetCoors( { | o | 10 }, { | o | 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) + 54 }, ;
{ | o | Int( o:oWnd:nWidth / 2 ) - XEVal( o:nLeft, o ) } )
:SetCaption( { | o | "Title" } )
:SetColors( METRO_RED, CLR_WHITE, Rgb( 88, 88, 88 ), CLR_HGRAY )
:SetFont( oFont4 )
:SetBorderSize( 1 )
:SetImgsFiles( { { "..\bitmaps\16x16\panel.bmp", ;
{ || oDock1:aBtnBmps[ 1 ]:SetImages( if( oDock1:lSelected, "..\bitmaps\16x16\panel.bmp", "\Fwh\bitmaps\16x16\check.bmp" ) ), ;
oDock1:lSelected := !oDock1:lSelected }, "ToolTip" } } )
:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := Test1( o, nT, nL, nH, nW ) } )
:bRClicked := { || MsgInfo( oDock1:oWnd:aControls[ 1 ]:ClassName() ) }
//
// Controls predefined in :oPnelH ( interior Panel )
//
:lBottomH := .T.
:SetTypeCtrl( 2 )
:SetHeightCtrl( 32 )
:SetColorsCtrl( CLR_WHITE, METRO_OLIVE )
:aRectText := { 8, 60 }
:cTitH := "Control Title - " + if( :lBottomH, "TOP", "BOTTOM" )
:Activate()
END
oDock2 := TDockPnel():New( oWindow )
WITH OBJECT oDock2
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 1 ]:nTop, o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 1 ]:nRight, o ) + 10 }, ;
{ | o | XEval( o:oWnd:aControls[ 1 ]:nBottom, o ) }, ;
{ | o | Int( o:oWnd:nWidth / 2 ) + XEval( o:nLeft, o ) - 40 } )
:SetCaption( { | o | "Login Process" } )
:SetColors( CLR_WHITE, METRO_AMBER, METRO_AMBER, CLR_WHITE )
:SetBorderSize( 1 )
:SetFont( oFont4 )
//:aResources := { { "info_on", { | o | MyPopupMnu( o ) }, } }
//:SetImgsResources( { { "info_on", { | o | MyPopupMnu( o ) }, } } )
:SetImgsFiles( { { "..\bitmaps\16x16\options.bmp", { | o | MyPopupMnu( o ) }, "ToolTip" } } )
:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := Test3( o, nT, nL, nH, nW ) } )
:bRClicked := { || MsgInfo( oDock2:oPnelH:aControls[ 1 ]:ClassName() ) }
:Activate()
END
oDock3 := TDockPnel():New( oWindow )
WITH OBJECT oDock3
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom, o ) + 10 }, ;
{ | o | 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) + XEval( o:oWnd:aControls[ 2 ]:nHeight, o ) - 94 }, ;
{ | o | XEVal( o:oWnd:aControls[ 2 ]:nRight, o ) } )
:SetCaption( { | o | "Title" } )
:SetBorderSize( 4 )
:SetColors( CLR_WHITE, METRO_RED, Rgb( 88, 88, 88 ), CLR_WHITE )
:SetFont( oFont4 )
:SetImgsFiles( { { "..\bitmaps\16x16\min.bmp", ;
{ || oDock1:aBtnBmps[ 1 ]:SetImages( if( oDock1:lSelected, "\Fwh\bitmaps\16x16\panel.bmp", "\Fwh\bitmaps\16x16\check.bmp" ) ), ;
oDock1:lSelected := !oDock1:lSelected }, "ToolTip" } } )
:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := Test2( o, nT, nL, nH - 1, nW, 4 ), ;
Test2( o, nT, oB:nRight + 2, nH - 1, nW - 2, 1 ) } )
:bRClicked := { || MsgInfo( oDock1:oWnd:aControls[ 1 ]:ClassName() ) }
:Activate()
END
/*
oDock4 := TDockPnel():New( oWindow )
WITH OBJECT oDock4
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 2 ]:nTop, o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 2 ]:nRight, o ) + 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) - o:nHTit - XEval( o:nTop, o ) }, ;
{ | o | Int( o:oWnd:nWidth / 3 ) + XEval( o:nLeft, o ) + 2 } )
:SetCaption( { | o | "Title DockPanel Top + RibbonBar" } )
:SetBorderSize( 1 )
:SetColors( CLR_WHITE, METRO_STEEL, METRO_TEAL, CLR_GRAY )
:nClrPaneT := CLR_WHITE
:SetFont( oFont4 )
//:SetImgsResources( { { "info_on", , } } )
:SetImgsFiles( { { "..\bitmaps\16x16\max.bmp", , } } )
:SetTypeCtrl( 3 ) // TRibbonBar
:SetHeightCtrl( 24 * 2 )
//:bSetupCtrl := { | oCtrl, oParent | MyRibbonSetup( oCtrl, oParent ) }
:SetSetupCtrls( { | oCtrl, oParent | MyRibbonSetup( oCtrl, oParent ) } )
:Activate()
END
oDock5 := TDockPnel():New( oWindow )
WITH OBJECT oDock5
:lBottom := .T.
:SetHeightCaption( 40 )
:SetBorderSize( 1 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 4 ]:nBottom + 10, o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 4 ]:nLeft, o ) }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) + XEval( o:oWnd:aControls[ 4 ]:nHeight, o ) + 10 }, ;
{ | o | XEval( o:oWnd:aControls[ 4 ]:nRight, o ) } )
:SetCaption( { | o | "Title DockPanel Bottom [ Top + Right ] + ButtonBar" } )
:cAlignText := "R" //"TR"
:SetColors( CLR_WHITE, METRO_ORANGE, CLR_GRAY, METRO_OLIVE )
:SetFont( oFont4 )
:lLeftImgs := .F.
//:SetImgsResources( { { "info_on", , } } )
:SetImgsFiles( { { "..\bitmaps\16x16\closew.bmp", , } } )
:SetTypeCtrl( 1 ) // ButtonBar
:SetHeightCtrl( 48 )
:SetSetupCtrls( { | oCtrl, oParent | MyButtonBarSetup( oCtrl, oParent ) } )
:Activate()
END
*/
Return nil
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function Test1( oP, nT, nL, nH, nW )
local oBrw
local oBar
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 } ;
}
@ nT, nL XBROWSE oBrw ;
SIZE nW, nH OF oP PIXEL ;
DATASOURCE aData ;
COLUMNS 1, 2, 3, 4, 5, 6 ;
HEADERS "MONTH", "USA", "EUROPE", "ASIA", "OTHERS", "REST" ;
AUTOSORT LINES STYLE FLAT // NOBORDER
WITH OBJECT oBrw
:lRecordSelector := .F.
:lHScroll := .F.
:lVScroll := .F.
:l2007 := .F.
:nStretchCol := 1
:lFitGridHeight := .T.
:nHeaderHeight := 32
:nRowHeight := 27
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:bClrRowFocus := { || { CLR_BLACK, RGB( 185, 220, 255 ) } }
:bClrStd := { || { Rgb( 88, 88, 88 ), CLR_WHITE } }
:nColorPen := CLR_HGRAY
:bClrHeader := { || { CLR_BLACK, CLR_WHITE, CLR_HGRAY } }
:lFullGrid := .T.
:SetFont( oFontCtrl )
AEVal( :aCols, { | o | o:cEditPicture := "999,999.99", o:nWidth := Int( o:oBrw:nWidth / 6 ) }, 2, Len( :aCols ) )
AEVal( :aCols, { | o | o:oHeaderFont := oFont1 } )
:CreateFromCode()
END
Return oBrw
//----------------------------------------------------------------------------//
Static Function Test2( oP, nT, nL, nH, nW, nType )
local oGraph
local aVals1
local aVals2
local aVals3
local aCols := { ;
{ "MONTH", 'C', 3, 0 }, ;
{ "USAS", 'N', 4, 0 }, ;
{ "EUROS", 'N', 4, 0 }, ;
{ "ASIAS", 'N', 4, 0 }, ;
{ "USAC", 'N', 4, 0 }, ;
{ "EUROC", 'N', 4, 0 }, ;
{ "ASIAC", 'N', 4, 0 } }
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 } ;
}
DEFAULT nT := 2
DEFAULT nL := 2
DEFAULT nH := oP:nHeight - 4
DEFAULT nW := oP:nWidth - 4
DEFAULT nType := 1
if !File( cPathApp + "SALECOST.DBF" )
DBCREATE( cPathApp + "SALECOST.DBF", aCols, "DBFCDX", .T., "SC1" )
FW_ArrayToDBF( aData )
else
DbUseArea( .F., "DBFCDX", cPathApp + "SALECOST.DBF", "SC1", .T., .F. )
endif
GO TOP
@ nT, nL GRAPH oGraph SIZE Int( nW / 2 ) - 2, nH PIXEL OF oP ;
TITLE "Sales and Costs" ;
XVALUES YVALUES LEGENDS
//oGraph:lBorders := .T.
oGraph:lViewVal := .T.
oGraph:nType := nType
oGraph:SetColor( oP:nClrText, oP:nClrPane )
oGraph:cTitY := SC1->MONTH
//oGraph:l3D := .T.
aVals1 := { SC1->USAS, SC1->EUROS }
aVals2 := { SC1->USAC, SC1->EUROC }
ADD SERIE TO oGraph SERIE aVals1 LEGEND "Sales" COLOR METRO_OLIVE
ADD SERIE TO oGraph SERIE aVals2 LEGEND "Costs" COLOR METRO_STEEL
SET Y LABELS OF oGraph TO { "USA", "EUROPE" } //, "ASIA" }
oGraph:nMaxVal := 2000
oGraph:SetArrayFonts( { oFont4, oFont, oFont1, oFont, oFontB, oFontE, oFont1, oFont1, oFontB } )
if nType = 1 .or. nType = 2
//oGraph:SetYVals( { "A", "N", "V", "O", "J" } )
oGraph:nXRanges := 8
oGraph:nMaxVal := 3000
endif
Return oGraph
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function MyPopupMnu( o )
local oMnu
local nRow := o:nTop + Int( o:nHeight / 2 )
local nCol := o:nLeft + Int( o:nWidth / 2 )
MENU oMnu POPUP 2013 ;
COLORSELECT METRO_STEEL, METRO_STEEL, CLR_WHITE ;
COLORMENU CLR_WHITE, CLR_BLUE ;
COLORSEPARATOR METRO_STEEL ;
COLORLEFT CLR_WHITE ;
FONT oFont4
MENUITEM "Save Prompt" ACTION cText := oDock2:SetCaption()
MENUITEM "Change Prompt" ACTION oDock2:SetCaption( "New Caption" + CRLF + "Second Line" )
MENUITEM "Restore Prompt" ACTION oDock2:SetCaption( cText )
SEPARATOR
MENUITEM "Change Colors Panel Main" ACTION oDock2:ChangeColorsP( { || CLR_RED }, { || CLR_WHITE } )
MENUITEM "Change Colors Panel Controls" ACTION oDock2:ChangeColorsH( { || CLR_WHITE }, { || CLR_RED } )
SEPARATOR
MENUITEM "Exit" ACTION o:oWnd:oWnd:End()
ENDMENU
ACTIVATE MENU oMnu AT nRow, nCol OF o:oWnd
Return oMnu
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function Test3( oP, nT, nL, nH, nW )
local oWnd, oImage, oFontSay
local oNameUser, oPassword
local oBtn1, oBtn2
local oFontI, oFontBtn
local cNameUser := space( 40 )
local cPassword := SPACE( 40 )
DEFINE FONT oFontI NAME "CALIBRI" SIZE 0,-15
DEFINE FONT oFontBtn NAME "VERDANA" SIZE 0,-17 BOLD
DEFINE FONT oFontSay NAME "VERDANA" SIZE 0,-25 BOLD //ITALIC
DEFINE DIALOG oWnd STYLE nOr( 0, WS_CHILD ) COLOR CLR_BLACK, nRGB( 253, 254, 254 ) ;
FROM nT, nL TO nH, nW PIXEL TRUEPIXEL OF oP
//DEFINE WINDOW oWnd STYLE nOr( WS_POPUP, WS_BORDER ) COLOR CLR_BLACK, nRGB( 253, 254, 254 )
// oWnd:nHeight := 320
// oWnd:nWidth := 400
//oWnd := oP
@ 15, 0 SAY "Cristóbal Navarro ( ® ) " PIXEL SIZE 400,30 OF oWnd ;
FONT oFontSay CENTER TRANSPARENT
@ 45, 0 SAY Upper( "FiveTech: ") + "Enter your Credentials" PIXEL ;
SIZE 400,30 OF oWnd FONT oFontI CENTER TRANSPARENT
@ 110, 50 GET oNameUser VAR cNameUser OF oWnd;
COLOR Rgb( 128, 128, 128 ), CLR_WHITE PICTURE "@!" ;
CUEBANNER "User" PIXEL BOTTOMBORDER ;
FONT oFontBtn ;
INFIELD INFONT oFontI INCLRTXT CLR_GRAY INCLRBORDER Rgb( 204, 204, 204 ) ;
INCLRLINE CLR_RED DYNAMIC //GROUP
@ 110, 50 GET oPassword VAR cPassword OF oWnd;
COLOR Rgb( 128, 128, 128 ), CLR_WHITE;
CUEBANNER "Enter Password" PASSWORD PIXEL BOTTOMBORDER ;
FONT oFontBtn PICTURE "@40" ;
INFIELD INFONT oFontI INALIGN 0
@ 260, 40 FLATBTN oBtn1 PROMPT "Access" OF oWnd SIZE 140, 40 ;
FONT oFontBtn;
COLOR CLR_WHITE, METRO_STEEL ;
ACTION ( oWnd:End() )
@ 260,210 FLATBTN oBtn2 PROMPT "Exit" OF oWnd SIZE 140, 40 ;
FONT oFontBtn;
COLOR CLR_WHITE, METRO_STEEL ;
ACTION ( oWnd:End() )
ACTIVATE DIALOG oWnd ON INIT ( oNameUser:SetFocus() ) NOWAIT
//ACTIVATE WINDOW oWnd CENTER ON INIT ( oNameUser:SetFocus() )
oFontI:End()
oFontBtn:End()
oFontSay:End()
RETURN oWnd
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function MyRibbonSetup( oCtrl, oP )
local oGr1
oCtrl:aPrompts[ 1 ] := "NEW"
ADD GROUP oGr1 RIBBON oCtrl TO OPTION 1 PROMPT "New" WIDTH Int( oP:nWidth / 3 ) ;
GRADIANT { { 1, Rgb( 192, 192, 192 ), Rgb( 192, 192, 192 ) } }
oCtrl:AddTab( "OTHER" )
//oCtrl:SetStyles( .F., .T. )
Return oP
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function MyButtonBarSetup( oCtrl, oP )
local oBtt1
local oBtt2
DEFINE BUTTON oBtt1 PROMPT "Exit" OF oCtrl ACTION MsgInfo( "ButtonBar" ) ;
TOOLTIP "TDockPnel Power" GROUP LEFT FILE "..\bitmaps\16x16\close.bmp" FLAT
oBtt1:nClrText := CLR_BLUE
oBtt1:nWidth := 48 * 2
DEFINE BUTTON oBtt2 PROMPT "Button" OF oCtrl ACTION MsgInfo( "Button" ) ;
TOOLTIP "TDockPnel Power" GROUP LEFT FILE "..\bitmaps\16x16\folder.bmp" FLAT
oBtt2:nClrText := CLR_BLUE
oBtt2:nWidth := 48 * 2
Return oP
//----------------------------------------------------------------------------//
leandro wrote:Cristobal como siempre gracias por responder,
En este momento me surge una duda, se puede montar sobre una ventana MDI?
de antemano gracias
fTesDock()
FUNCTION fTesDock()
#include "fivewin.ch"
#include "report.ch"
#include "Ado.ch"
#include "vrd.ch"
#include "dtpicker.ch"
#include "xbrowse.ch"
#include "colores.ch"
#include "tgraph.ch"
Local oWChRgr1
Local cFont := "Liberation Mono" //TAHOMA //CALIBRI //SEGOE UI SYMBOL
Public oFontCtrl,oFont1
DEFINE FONT oFontCtrl NAME cFont SIZE 0, -9 BOLD
DEFINE FONT oFont1 NAME cFont SIZE 0,-11 BOLD
DEFINE WINDOW oWChRgr1 MDICHILD TITLE "Reporte Inventario Gráfico" ICON "#8001" OF oWnd
oDock1 := TDockPnel():New( oWChRgr1 )
WITH OBJECT oDock1
:SetHeightCaption( 40 )
:SetCoors( { | o | 10 }, { | o | 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) + 54 }, ;
{ | o | Int( o:oWnd:nWidth / 2 ) - XEVal( o:nLeft, o ) } )
:SetCaption( { | o | "Title" } )
:SetColors( METRO_RED, CLR_WHITE, Rgb( 88, 88, 88 ), CLR_HGRAY )
:SetFont( oFont4 )
:SetBorderSize( 1 )
:SetImgsFiles( { { "C:\fwh1909\bitmaps\16x16\panel.bmp", ;
{ || oDock1:aBtnBmps[ 1 ]:SetImages( if( oDock1:lSelected, "..\bitmaps\16x16\panel.bmp", "\Fwh\bitmaps\16x16\check.bmp" ) ), ;
oDock1:lSelected := !oDock1:lSelected }, "ToolTip" } } )
:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := Test1( o, nT, nL, nH, nW ) } )
:bRClicked := { || MsgInfo( oDock1:oWnd:aControls[ 1 ]:ClassName() ) }
//
// Controls predefined in :oPnelH ( interior Panel )
//
/*
:lBottomH := .T.
:SetTypeCtrl( 2 )
:SetHeightCtrl( 32 )
:SetColorsCtrl( CLR_WHITE, METRO_OLIVE )
:aRectText := { 8, 60 }
:cTitH := "Control Title - " + if( :lBottomH, "TOP", "BOTTOM" )*/
:Activate()
END
oDock2 := TDockPnel():New( oWChRgr1 )
WITH OBJECT oDock2
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 1 ]:nTop, o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 1 ]:nRight, o ) + 10 }, ;
{ | o | XEval( o:oWnd:aControls[ 1 ]:nBottom, o ) }, ;
{ | o | Int( o:oWnd:nWidth / 2 ) + XEval( o:nLeft, o ) - 40 } )
:SetCaption( { | o | "Login Process" } )
:SetColors( CLR_WHITE, METRO_AMBER, METRO_AMBER, CLR_WHITE )
:SetBorderSize( 1 )
:SetFont( oFont4 )
//:aResources := { { "info_on", { | o | MyPopupMnu( o ) }, } }
//:SetImgsResources( { { "info_on", { | o | MyPopupMnu( o ) }, } } )
//:SetImgsFiles( { { "..\bitmaps\16x16\options.bmp", { | o | MyPopupMnu( o ) }, "ToolTip" } } )
//:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := Test1( o, nT, nL, nH, nW ) } )
:bRClicked := { || MsgInfo( oDock2:oPnelH:aControls[ 1 ]:ClassName() ) }
:Activate()
END
oDock3 := TDockPnel():New( oWChRgr1 )
WITH OBJECT oDock3
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom, o ) + 10 }, ;
{ | o | 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) + XEval( o:oWnd:aControls[ 2 ]:nHeight, o ) - 94 }, ;
{ | o | XEVal( o:oWnd:aControls[ 2 ]:nRight, o ) } )
:SetCaption( { | o | "Title" } )
:SetBorderSize( 4 )
:SetColors( CLR_WHITE, METRO_RED, Rgb( 88, 88, 88 ), CLR_WHITE )
:SetFont( oFont4 )
:SetImgsFiles( { { "C:\fwh1909\bitmaps\16x16\min.bmp", ;
{ || oDock1:aBtnBmps[ 1 ]:SetImages( if( oDock1:lSelected, "\Fwh\bitmaps\16x16\panel.bmp", "\Fwh\bitmaps\16x16\check.bmp" ) ), ;
oDock1:lSelected := !oDock1:lSelected }, "ToolTip" } } )
//:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := Test2( o, nT, nL, nH - 1, nW, 4 ), ;
//Test2( o, nT, oB:nRight + 2, nH - 1, nW - 2, 1 ) } )
:bRClicked := { || MsgInfo( oDock1:oWnd:aControls[ 1 ]:ClassName() ) }
:Activate()
END
ACTIVATE WINDOW oWChRgr1 MAXIMIZED
Return nil
Function Test1( oP, nT, nL, nH, nW )
local oBrw
local oBar
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 } ;
}
@ nT, nL XBROWSE oBrw ;
SIZE nW, nH OF oP PIXEL ;
DATASOURCE aData ;
COLUMNS 1, 2, 3, 4, 5, 6 ;
HEADERS "MONTH", "USA", "EUROPE", "ASIA", "OTHERS", "REST" ;
AUTOSORT LINES STYLE FLAT // NOBORDER
WITH OBJECT oBrw
:lRecordSelector := .F.
:lHScroll := .F.
:lVScroll := .F.
:l2007 := .F.
:nStretchCol := 1
:lFitGridHeight := .T.
:nHeaderHeight := 32
:nRowHeight := 27
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:bClrRowFocus := { || { CLR_BLACK, RGB( 185, 220, 255 ) } }
:bClrStd := { || { Rgb( 88, 88, 88 ), CLR_WHITE } }
:nColorPen := CLR_HGRAY
:bClrHeader := { || { CLR_BLACK, CLR_WHITE, CLR_HGRAY } }
:lFullGrid := .T.
:SetFont( oFontCtrl )
AEVal( :aCols, { | o | o:cEditPicture := "999,999.99", o:nWidth := Int( o:oBrw:nWidth / 6 ) }, 2, Len( :aCols ) )
AEVal( :aCols, { | o | o:oHeaderFont := oFont1 } )
:CreateFromCode()
END
Return oBrw
WITH OBJECT oDock1
:SetHeightCaption( 40 )
:SetCoors( { | o | 10 }, { | o | 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) + 54 }, ;
{ | o | Int( o:oWnd:nWidth / 2 ) - XEVal( o:nLeft, o ) } )
**********************************
* REPORTE DE KARDEX Y MOVIMIENTO *
**********************************
fTesDock()
FUNCTION fTesDock()
#include "fivewin.ch"
#include "report.ch"
#include "Ado.ch"
#include "vrd.ch"
#include "dtpicker.ch"
#include "xbrowse.ch"
#include "colores.ch"
#include "tgraph.ch"
Local oWChRgr1
Local cFont := "Liberation Mono" //TAHOMA //CALIBRI //SEGOE UI SYMBOL
Public oFontCtrl,oFont1
Public cPathApp := cFilePath( GetModuleFileName( GetInstance() ) )
DEFINE FONT oFont NAME cFont SIZE 0,-11
DEFINE FONT oFontB NAME cFont SIZE 0,-14 BOLD //ARIAL NARROW
DEFINE FONT oFont1 NAME cFont SIZE 0,-11 BOLD
DEFINE FONT oFontE NAME cFont SIZE 0,-14
DEFINE FONT oFont2 NAME cFont SIZE 0,-16
DEFINE FONT oFont3 NAME cFont SIZE 0,-20 //BOLD
DEFINE FONT oFont4 NAME "CALIBRI" SIZE 0,-16
DEFINE FONT oFontCtrl NAME cFont SIZE 0, -9 BOLD
DEFINE FONT oFontS NAME "FIXEDSYS" SIZE 0,-12
DEFINE WINDOW oWChRgr1 MDICHILD TITLE "Reporte Inventario Gráfico" ICON "#8001" OF oWnd
oDock1 := TDockPnel():New( oWChRgr1 )
WITH OBJECT oDock1
:SetHeightCaption( 40 )
:SetCoors( { | o | 10 }, { | o | 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) }, ;
{ | o | Int( o:oWnd:nWidth / 2 ) - XEVal( o:nLeft, o ) } )
:SetCaption( { | o | "Entradas y Salidas Mensuales" } )
:SetColors( METRO_RED, CLR_WHITE, Rgb( 88, 88, 88 ), CLR_HGRAY )
:SetFont( oFont4 )
:SetBorderSize( 1 )
:SetImgsFiles( { { "C:\fwh1909\bitmaps\16x16\panel.bmp", ;
{ || oDock1:aBtnBmps[ 1 ]:SetImages( if( oDock1:lSelected, "..\bitmaps\16x16\panel.bmp", "\Fwh\bitmaps\16x16\check.bmp" ) ), ;
oDock1:lSelected := !oDock1:lSelected }, "ToolTip" } } )
:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := fMovMeses( o, nT, nL, nH, nW ) } )
:bRClicked := { || MsgInfo( oDock1:oWnd:aControls[ 1 ]:ClassName() ) }
:Activate()
END
oDock2 := TDockPnel():New( oWChRgr1 )
WITH OBJECT oDock2
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 1 ]:nTop, o ) }, ;
{ | o | XEval( o:oWnd:aControls[ 1 ]:nRight, o ) + 10 }, ;
{ | o | XEval( o:oWnd:aControls[ 1 ]:nBottom, o ) }, ;
{ | o | Int( o:oWnd:nWidth / 2 ) + XEval( o:nLeft, o ) - 40 } )
:SetCaption( { | o | "Kardex Por Artículo" } )
:SetColors( CLR_WHITE, METRO_AMBER, METRO_AMBER, CLR_WHITE )
:SetBorderSize( 1 )
:SetFont( oFont4 )
:Activate()
END
oDock3 := TDockPnel():New( oWChRgr1 )
WITH OBJECT oDock3
:SetHeightCaption( 40 )
:SetCoors( { | o | XEval( o:oWnd:aControls[ 2 ]:nBottom, o ) + 10 }, ;
{ | o | 10 }, ;
{ | o | Int( o:oWnd:nHeight / 2 ) + XEval( o:oWnd:aControls[ 2 ]:nHeight, o ) - 34 }, ;
{ | o | XEVal( o:oWnd:aControls[ 2 ]:nRight, o ) } )
:SetCaption( { | o | "Graficas Informativas" } )
:SetBorderSize( 4 )
:SetColors( CLR_WHITE, METRO_RED, Rgb( 88, 88, 88 ), CLR_WHITE )
:SetFont( oFont4 )
:SetImgsFiles( { { "C:\fwh1909\bitmaps\16x16\min.bmp", ;
{ || oDock1:aBtnBmps[ 1 ]:SetImages( if( oDock1:lSelected, "\Fwh\bitmaps\16x16\panel.bmp", "\Fwh\bitmaps\16x16\check.bmp" ) ), ;
oDock1:lSelected := !oDock1:lSelected }, "ToolTip" } } )
:Activate()
END
ACTIVATE WINDOW oWChRgr1 MAXIMIZED
Return nil
**********************************
*MOVIMIENTO DE ARTICULOS POR MESES
**********************************
function fMovMeses(oP, nT, nL, nH, nW)
Local cQry
Local oBrwMs
Local nWidth := 0
TEXT INTO cQry
SELECT mes,SUM(entradas) AS entradas,SUM(salidas) AS salidas,nombre FROM (
SELECT MONTH(MOV.o_fechas) AS mes,SUM(MOV.o_cansal) AS salidas,SUM(MOV.o_canent) AS entradas,"Leandro" AS nombre
FROM tbl_movi MOV WHERE MOV.o_articu='CORP012' GROUP BY MONTH(MOV.o_fechas)
UNION
SELECT MONTH(FAC.mm_fechas) AS mes,SUM(FAC.mm_cansal) AS salidas,SUM(FAC.mm_canent) AS entradas,"Arevalo" AS nombre
FROM tbl_mofa FAC WHERE FAC.mm_articu='CORP012' GROUP BY MONTH(FAC.mm_fechas)
) MOV GROUP BY mes
ENDTEXT
Define Font oFont Name "Calibri" Size 0,-13 BOLD
Define Font oFont1 Name "Calibri" Size 0,-13
Define Font oFont2 Name "Calibri" Size 0,-20 BOLD
//CREAMOS UNA CONEXION PARA EL REPORTE
vCnd := "DSN=dlyma;Uid="+oLamcla:cUsuario+";Pwd="+oLamcla:cPassword+";"
oCnMes := FW_OpenAdoConnection( vCnd )
//Activamos DB
vQry := "USE "+oLamcla:cEmpDBda
TRY
oCnMes:Execute(vQry)
CATCH oError
FW_ShowAdoError(oCnMes)
END
oRsMes := FW_OPENRECORDSET(oCnMes,cQry,adLockOptimistic,adOpenKeyset)
oBrwMs := TXBrowse():New( oP )
oBrwMs:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrwMs:nRowDividerStyle := LINESTYLE_LIGHTGRAY
oBrwMs:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrwMs:nHeaderLines := 1
oBrwMs:lColDividerComplete := .t.
oBrwMs:lRecordSelector := .t.
oBrwMs:l2007 := .f.
oBrwMs:oFont := oFont1
oBrwMs:bClrRowFocus := { || { CLR_BLACK, RGB( 185, 220, 255 ) } }
oBrwMs:bClrStd := { || { Rgb( 88, 88, 88 ), CLR_WHITE } }
oBrwMs:nColorPen := CLR_HGRAY
oBrwMs:bClrHeader := { || { CLR_BLACK, CLR_WHITE, CLR_HGRAY } }
oBrwMs:lFullGrid := .T.
oBrwMs:lRecordSelector := .F.
oBrwMs:lHScroll := .F.
oBrwMs:lVScroll := .F.
oBrwMs:lFitGridHeight := .T.
oBrwMs:nHeaderHeight := 32
oBrwMs:nRowHeight := 27
oCol = oBrwMs:AddCol()
oCol:bStrData = { || If( oRsMes:Eof, Space( nWidth ), Transform( oRsMes:Fields( "mes" ):Value , "99" ) ) }
oCol:cHeader = "Mes"
oCol:nWidth = 80
oCol:nHeadStrAlign = AL_LEFT
oCol:nDataStrAlign = AL_LEFT
oCol:oHeaderFont = oFont
oCol = oBrwMs:AddCol()
oCol:bStrData = { || If( oRsMes:Eof, Space( nWidth ), Transform( oRsMes:Fields( "entradas" ):Value , "999,999" ) ) }
oCol:cHeader = "Entradas"
oCol:nWidth = 80
oCol:nHeadStrAlign = AL_LEFT
oCol:nDataStrAlign = AL_LEFT
oCol:oHeaderFont = oFont
oCol = oBrwMs:AddCol()
oCol:bStrData = { || If( oRsMes:Eof, Space( nWidth ), Transform( oRsMes:Fields( "salidas" ):Value , "999,999" ) ) }
oCol:cHeader = "Salidas"
oCol:nWidth = 80
oCol:nHeadStrAlign = AL_LEFT
oCol:nDataStrAlign = AL_LEFT
oCol:oHeaderFont = oFont
oCol = oBrwMs:AddCol()
oCol:bStrData = { || If( oRsMes:Eof, Space( nWidth ), Transform( oRsMes:Fields( "entradas" ):Value - oRsMes:Fields( "salidas" ):Value , "999,999" ) ) }
oCol:cHeader = "Saldo"
oCol:nWidth = 80
oCol:nHeadStrAlign = AL_LEFT
oCol:nDataStrAlign = AL_LEFT
oCol:oHeaderFont = oFont
oCol = oBrwMs:AddCol()
oCol:bStrData = { || If( oRsMes:Eof, Space( nWidth ), cValtoChar( oRsMes:Fields( "nombre" ):Value ) ) }
oCol:cHeader = "Nombre"
oCol:nWidth = 80
oCol:nHeadStrAlign = AL_LEFT
oCol:nDataStrAlign = AL_LEFT
oCol:oHeaderFont = oFont
oBrwMs:SetADO( oRsMes )
oBrwMs:CreateFromCode()
Return oBrwMs
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 51 guests