tree menus
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 137
- Joined: Thu Jul 24, 2008 11:22 pm
tree menus
Is it possible to build tree menus in RR?
Just kidding 
Basically there's two ways I'd recommend to do this:
The first uses icons within a field to show the tree extraction points (the little arrows). You keep the whole tree in a variable or a customproperty and also store which parts are currently expanded there. The little arrow icons also have a link stored within them, which uniquely identifies each node. When the user clicks one, you generate the htmltext of the tree field on the fly.
Look up these terms to get yourself started:
imageSource (for making chars in fields into images)
linkText (for storing data for each node in the field)
link (both linkText and link are needed)
linkClicked (to expand/hide nodes on user interaction)
Another approach is to use a group with several controls. The approach also benefits from a full tree stored somewhere, but that can be omitted theoretically. You hide and show, or create and delete relevant objects (icons and fields), then position them correctly relative to each other. You could also use buttons, with the icon set, and the textAlign set to left, but then you also need to change the margins whenever the text in the button is enlarged or made smaller. This might be a bit more complex then the first approach as soon as you scroll the tree, because then all the locations will change, and you need to handle that yourself. On the other hand this approach allows you to not change the whole tree every time something expands/hides more easily.
Relevant terms:
lockScreen (so the tree can be changed without too much of a lag)
hide / show (to get rid of hidden stuff)
delete / create / clone (to completely remove hidden stuff)
location (for positioning)
rectangle (for size changes)
vScrollbar (if your tree needs scrolling within the group)
margins (if you use buttons)
icon (if you use buttons)
There's many approaches and also quite a few examples on revOnline, so scroll trough there and look out for things like hierarchical, tree, listview, disclosure, arrows, explorer-like, etc.

Basically there's two ways I'd recommend to do this:
The first uses icons within a field to show the tree extraction points (the little arrows). You keep the whole tree in a variable or a customproperty and also store which parts are currently expanded there. The little arrow icons also have a link stored within them, which uniquely identifies each node. When the user clicks one, you generate the htmltext of the tree field on the fly.
Look up these terms to get yourself started:
imageSource (for making chars in fields into images)
linkText (for storing data for each node in the field)
link (both linkText and link are needed)
linkClicked (to expand/hide nodes on user interaction)
Another approach is to use a group with several controls. The approach also benefits from a full tree stored somewhere, but that can be omitted theoretically. You hide and show, or create and delete relevant objects (icons and fields), then position them correctly relative to each other. You could also use buttons, with the icon set, and the textAlign set to left, but then you also need to change the margins whenever the text in the button is enlarged or made smaller. This might be a bit more complex then the first approach as soon as you scroll the tree, because then all the locations will change, and you need to handle that yourself. On the other hand this approach allows you to not change the whole tree every time something expands/hides more easily.
Relevant terms:
lockScreen (so the tree can be changed without too much of a lag)
hide / show (to get rid of hidden stuff)
delete / create / clone (to completely remove hidden stuff)
location (for positioning)
rectangle (for size changes)
vScrollbar (if your tree needs scrolling within the group)
margins (if you use buttons)
icon (if you use buttons)
There's many approaches and also quite a few examples on revOnline, so scroll trough there and look out for things like hierarchical, tree, listview, disclosure, arrows, explorer-like, etc.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode