Otto wrote:Dear Antonio,
I think this would be a nice task tor webview.
I am working on a DMS with similar layout.
Best regards,
Otto
// Using a TreeView with checkboxes and checking their status
#include "FiveWin.ch"
#include "Splitter.ch"
function Main()
local nHt := Int( ScreenHeight() * 0.3 )
local nWd := 600
local oDlg, oTree,oFont,oBold
local oSplit
local nSplit:=100
local oExbar
* DEFINE ICON oIcon RESOURCE "ICON1"
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
DEFINE FONT oBold NAME 'Tahoma' SIZE 0, -12 BOLD
DEFINE DIALOG oDlg SIZE nWd,nHt PIXEL ;
COLOR CLR_BLACK, nRgb( 245,244,234) FONT oFont ; //ICON oIcon
TITLE "Configurazione" STYLE nOr( WS_OVERLAPPEDWINDOW )
oExBar := TPanel():New(0,0,oDlg:nBottom,nSplit, oDlg )
oExBar:SetColor(0,RGB(143,172,230))
* oTree:OnClick = { || CheckStatus( oTree, oTree:aItems ) }
@ 0,nSplit SPLITTER oSplit ;
VERTICAL _3DLOOK ;
PREVIOUS CONTROLS oExBar ;
HINDS CONTROLS oDlg ;
SIZE 2,oDlg:nBottom PIXEL ;
LEFT MARGIN 20 ;
RIGHT MARGIN 25 ;
OF oDlg
oDlg:bResized := <||
local oRect := oDlg:GetCliRect()
oExbar:ntop := oRect:nTop
oExBar:nBottom := oRect:nheight
oSplit:nBottom := oRect:nbottom
RETURN nil
>
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT (oDlg:resize(),;
CreateTree(oExBar,oTree) )
return nil
//-------------------------------------------------------------------//
Function CreateTree(oExBar,oTree)
oTree := TTreeView():New( 0, 0, oExBar,,,,,oExbar:nWidth,oExbar:nBottom,,.t.)
BuildTree( oTree )
oExBar:oClient :=oTree
return oTree
//-------------------------------------------------------------------//
function BuildTree( oTree )
local oMenu := Array( 2 ), oSubMenu := Array( 3 )
oMenu[ 1 ]:= oTree:Add( "Principal" )
oSubMenu[ 1 ]:= oMenu[ 1 ]:Add( "Imprimir..." )
oSubMenu[ 1 ]:SetCheck( .T. )
oMenu[ 2 ]:= oTree:Add( "Proyectos" )
oSubMenu[ 2 ]:= oMenu[ 2 ]:Add( "Definir Proyectos" )
oSubmenu[ 3 ]:= oMenu[ 2 ]:Add( "Actualización datos" )
oTree:Expand()
return nil
function CheckStatus( oTree, aItems )
local n
for n = 1 to Len( aItems )
MsgInfo( oTree:GetCheck( aItems[ n ] ) )
CheckStatus( oTree, aItems[ n ]:aItems )
next
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 86 guests