Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VirtualStringTree TextMargin or Indentation problem

82 views
Skip to first unread message

DoctorC

unread,
Jun 5, 2009, 6:03:39 AM6/5/09
to
Hi all,
I'm writing a descendant of TVirtualStringTree and I would like to
dispaly the nodes the way the Object Inspector of TD2006 does.
It means: the second level of nodes has the same indentation as the
first level, while the other levels are shown with the normal
indentation (relative to their parents).

I tried modifing the values of indent ad text margin in DoPaintNode and
in other painting procedures... and the nodes are shown in the position
I want but then the inplace editors stop showing correctly.
(It seems that if I add code to DoPaintNode then the editors don't show
correclty.)

Does anybody know how to solve it?

Regards,
Enrico

NickT

unread,
Jun 5, 2009, 12:41:41 PM6/5/09
to
Are you referring to the Soft Gems Virtual String Tree?

If so then you need to create a record structure to hold your values:

tMyrec = record
Caption : String;
Data1 : String;
Data2 : String;
end;

When you add a new node to the tree you need to create a new instance of
this record and add it as the data record for that node.

There is an event, GetText, (I think, I am doing this from memory) that is
then used to get the associated value and display it in the tree.

It's sort of a mixture between a TreeView and a Listview. A collapsible
tListview if you will.

Look at his examples and you will see how it works.

-- Nick

------------------------------------------------------------------
Web site -> http://www.infinites.com

"DoctorC" <doc...@o2.pl> wrote in message
news:h0aqht$on5$1...@news.task.gda.pl...

DoctorC

unread,
Jun 8, 2009, 4:35:52 AM6/8/09
to
NickT pisze:

> Are you referring to the Soft Gems Virtual String Tree?
>
> If so then you need to create a record structure to hold your values:
>
> tMyrec = record
> Caption : String;
> Data1 : String;
> Data2 : String;
> end;
>
> When you add a new node to the tree you need to create a new instance of
> this record and add it as the data record for that node.
>
> There is an event, GetText, (I think, I am doing this from memory) that is
> then used to get the associated value and display it in the tree.
>
> It's sort of a mixture between a TreeView and a Listview. A collapsible
> tListview if you will.
>
> Look at his examples and you will see how it works.
>
> -- Nick

I had another problem. I wanted to copy the Object inspector look and I
needed to move to the right the nodes of level 1 (it means the second
level).
I solved it using OnBeforeItemPaint where I can modify the ContentRect.

Thanks for your help

Enrico

0 new messages