Link to home
Start Free TrialLog in
Avatar of Mutley2003
Mutley2003

asked on

Lightweight bottom-up tree with variable size nodes

Hi
I'd like to build a tree display that is a bit unusual.

a) firstly the nodes are of different sizes .. that is, they have different amounts of text in them, multiple lines etc

b) I want the first level nodes to appear alternately left and right of the "main trunk", and left side nodes always expand out to the left, right side nodes to the right

c) conceptually at least, this is built from the bottom up. I am not sure that this makes any difference in practice, but that is my idea.

d) the tree is of unknown size, in general. Scrolling will be required.

I need some help getting started.

q1. What sort of container should I use for the tree? a Tscrollbox?

q2. For the nodes, should I use panels?

q3. I need some clues as to how to do the painting.  When the user scrolls, how do I determine what needs to be painted . What messages do I need to handle?

q4. The coordinate system will need to be "virtual" - in the sense that I cannot know in advance, until I start drawing, what the coordinates of any node should be. This will thus involve some negative coordinates .. do I need to map these back to a positive coordinate space?

I know there are good tree packages out there (like TeeTree and VirtualTreeView), but I want to try this for myself. It does not need to do much except draw itself and respond to expand/collapse clicks.

thanks
Avatar of kretzschmar
kretzschmar
Flag of Germany image

you may take a look to this question i asked:

https://www.experts-exchange.com/questions/10331656/upsidedown-tree.html

maybe it fits your needs

meikl ;-)
Avatar of Mutley2003
Mutley2003

ASKER

thanks meikl .. there are some ideas there I can maybe try out.
I see igor used Tlabel as the container and for the nodes. hmm. Maybe that will work for me, but I am still confused about scrolling and when to paint.
i used in my final panels instead, as viewarea i used a tscrollbox,
a special painting was not needed

i will dig out my final and post it here,
this may take a bit time, because its archived

meikl ;-)
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi meikl

I only just came across your latest comment .. yes I would like to see the screenshot.

sending you an email now

regards
thanks meikl, got me on the right track