Hi guys
I'm working in a Treeview control and don't find the way to show the dots lines and (+) (-) sign. There is no problem with the items brance neither bitmaps only the dots.
Any suggest?
Thanks
Williams
define dialog oDlg of oWChild resource "nomdepto" font oCfg:aFonts[1]
oImageList := TImageList():New( 0, 0 )
oTree := TTreeView():Redefine( 1007, oDlg )
oTree:bChanged = { || ChkTreeItem( oTree:GetSelected(), oNomDep ), ;
ChgCtrlMode( oGet, "REFRESH" ) }
activate window oWChild valid on init FillTree( oTree, oImageList, oNomDep )
// --------------------------------------------------------
function FillTree( oTree, oImageList, oNomDep )
local cCodigo, lFirst := .t.
local cOrder := oNomDep:SetOrder( "codigo" )
oTree:SetImageList( oImageList )
do while !oNomDep:Eof()
if lFirst
cCodigo := AllTrim( oNomDep:nomdepcod )
lFirst := .f.
endif
if Len( AllTrim( oNomDep:nomdepcod )) == Len( cCodigo )
oTree:Add( AllTrim( oNomDep:nomdepcod ) + " - " + AllTrim( oNomDep:nomdepnom ), 0 )
endif
oNomDep:Skip()
enddo
oNomDep:SetOrder( cOrder )
return nil
// --------------------------------------------------------
function ChkTreeItem( oItem, oNomDep, oGet )
local cCodigo := AllTrim( StrToken( oItem:cPrompt, 1, "-" ))
local cOrder := oNomDep:SetOrder( "codigo" )
local nPos
oNomDep:Seek( cCodigo )
nPos := oNomDep:RecNo()
if Len( oItem:aItems ) = 0
oNomDep:Skip()
cRoot := AllTrim( oNomDep:nomdepcod )
if !oNomDep:Eof()
do while !oNomDep:Eof()
if Left( oNomDep:nomdepcod, Len( cCodigo )) == cCodigo .and. ;
Len( AllTrim( oNomDep:nomdepcod )) = Len( cRoot )
oItem:Add( AllTrim( oNomDep:nomdepcod ) + " - " + AllTrim( oNomDep:nomdepnom ))
endif
oNomDep:Skip()
enddo
endif
endif
oNomDep:GoTo( nPos )
oNomDep:Load()
oItem:Expand()
return nil
CONTROL "", 1007, "SysTreeView32", WS_CHILD | WS_VISIBLE | 135 | WS_BORDER, 12, 72, 206, 100
CONTROL "", 4008, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 402, 195, 225, 150 , 0x00020200
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: dutch and 35 guests