FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour treeview
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
treeview
Posted: Tue Aug 14, 2007 04:05 PM

To bind treeview to a database I pass the record-ID with the text.

TestNode ID 345
TestNode Child ID 500
TestNode 2 ID 8555
TestNode Child ID 102333
TestNode Child ID 394949

Do you think there is a way to make the last characters of the nodetext invisible?
Thanks in advance
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
treeview
Posted: Tue Aug 14, 2007 05:32 PM
Otto,

When an item is inserted into a treeview a TV_INSERTSTRUCT struct is used (please review source\winapi\treeview.c).

The TV_INSERTSTRUCT contains a TV_ITEM structure and there you have a member, named lParam where you can store a 32 bits number. Similar like Clipper "cargo".

So you have to modify source\winapi\treeview.c and add this line:

is.item.lParam = _parnl( 5 );

Then modify the Class TTreeView to accept an extra parameter:

METHOD Add( cPrompt, nImage, nValue ) CLASS TTreeView
...
oItem := TTVItem():New( TVInsertItem( ::hWnd, cPrompt,, nImage, nValue ), Self )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
treeview
Posted: Tue Aug 14, 2007 05:39 PM
Then, given a TV_ITEM handle, you can retrieve its lParam value:
HB_FUNC( TVIPARAM ) // hItem --> nLParam
{
   hb_retnl( ( ( TV_ITEM * ) hb_parnl( 1 ) )->lParam );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion