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
Treeview question
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Thanks Antonio
You're right but the samples show a control from code not from resource. I don't know if this could be the problem. I've set up a SysTreeView32 control on this way from RWS
CONTROL "", 1007, "SysTreeView32", WS_CHILD | WS_VISIBLE | WS_BORDER, 12, 72, 206, 100
and my code is
so as I say before, the grid work ok, every brance works fine. If I define bitmaps on the oImageList object this shows ok... the only thing is the lines dots. Take in mind that the database object was defined ok and working... just I don't put code about it for compact the sample
Thanks
You're right but the samples show a control from code not from resource. I don't know if this could be the problem. I've set up a SysTreeView32 control on this way from RWS
CONTROL "", 1007, "SysTreeView32", WS_CHILD | WS_VISIBLE | WS_BORDER, 12, 72, 206, 100
and my code is
Code: Select all
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
so as I say before, the grid work ok, every brance works fine. If I define bitmaps on the oImageList object this shows ok... the only thing is the lines dots. Take in mind that the database object was defined ok and working... just I don't put code about it for compact the sample
Thanks
Dear friends:
After look several samples, finally I found the solution to the (+)/(-) bitmaps and dotlines. When you defined an SysTreeView32 control on a DLL or .RC file, you should set the constant number 135 or 7 in the control style box
The another tip is fill the tree in the ON INIT event of your dialog activation. After that you Tree control should look fine
After look several samples, finally I found the solution to the (+)/(-) bitmaps and dotlines. When you defined an SysTreeView32 control on a DLL or .RC file, you should set the constant number 135 or 7 in the control style box
Code: Select all
CONTROL "", 1007, "SysTreeView32", WS_CHILD | WS_VISIBLE | 135 | WS_BORDER, 12, 72, 206, 100
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Hi Again Williams
Since now accomplished to decomapile the dll. I post here the results for you or enyone who want this info.
Try the following:
Regards from Greece
Dionisis
Since now accomplished to decomapile the dll. I post here the results for you or enyone who want this info.
Try the following:
Code: Select all
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
Dionisis