- Code: Select all Expand view RUN
//----------------------------------------------------------------------------//
// ( C ) Cristobal Navarro - 2020
// TDockPnel with ActiveX
//----------------------------------------------------------------------------//
#include "Fivewin.ch"
#include "colores.ch"
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
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 := "Segoe UI Symbol" //TAHOMA //CALIBRI
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()
Return nil
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Static Function TestDockPnel()
local nCol
local nRow
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
Return nil
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function CreaDocks()
local cUrl := "www.google.es"
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 | cUrl } )
:SetColors( CLR_WHITE, METRO_RED, Rgb( 88, 88, 88 ), CLR_WHITE )
//:SetColors( METRO_RED, CLR_WHITE, Rgb( 88, 88, 88 ), CLR_HGRAY )
:SetFont( oFont4 )
:SetBorderSize( 1 )
:SetImgsFiles( { { "..\bitmaps\16x16\options.bmp", { | o | MyPopupMnu( o ) }, "ToolTip" } } )
:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := ShowPageWeb( o, cUrl ), ;
SetParent( oB:hWnd, o:hWnd ) } )
: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 | "https://www.scintilla.org/ScintillaDoc.html" } )
:SetColors( CLR_WHITE, METRO_AMBER, METRO_AMBER, CLR_WHITE )
:SetBorderSize( 1 )
:SetFont( oFont4 )
:SetImgsFiles( { { "..\bitmaps\16x16\options.bmp", { | o | MyPopupMnu( o ) }, "ToolTip" } } )
:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := ShowPageWeb( o, "https://www.scintilla.org/ScintillaDoc.html" ), ;
SetParent( oB:hWnd, o:hWnd ) } )
:Activate()
END
//cUrl := "http://wiki.fivetechsoft.com/doku.php"
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 | "http://forums.fivetechsupport.com/index.php" } )
:SetBorderSize( 4 )
:SetColors( CLR_WHITE, METRO_OLIVE, Rgb( 88, 88, 88 ), CLR_WHITE )
:SetFont( oFont4 )
:SetImgsFiles( { { "..\bitmaps\16x16\options.bmp", { | o | MyPopupMnu( o ) }, "ToolTip" } } )
:SetCtrlsPnel( { | o, nT, nL, nH, nW, oB | oB := ShowPageWeb( o, "http://forums.fivetechsupport.com/index.php" ), ;
SetParent( oB:hWnd, o:hWnd ) } )
:Activate()
END
Return nil
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
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 "Info" ACTION MsgInfo( "Class TDockPnel" )
SEPARATOR
MENUITEM "Exit" ACTION o:oWnd:oWnd:End()
ENDMENU
ACTIVATE MENU oMnu AT nRow, nCol OF o:oWnd
Return oMnu
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//
Function ShowPageWeb( oParent, cUrl )
local oActX
oActX := CreateObject( "InternetExplorer.Application" )
WITH OBJECT oActX
:Visible := .t.
:ToolBar := .f.
:StatusBar := .f.
:MenuBar := .f.
:FullScreen := .t.
:Invoke( "Navigate", cURL )
END
Return oActX
//----------------------------------------------------------------------------//
//
//----------------------------------------------------------------------------//