
Tree component
229
When a Tree displays a node it uses the
label
attribute of the node by default as the text label.
If any other attributes exist, they become additional properties of the node’s attributes within
the Tree.
The actual root node is interpreted as the Tree component itself. This means that the
firstChild
(in the sample,
<node label="Mail">
), is rendered as the root node in the Tree view. This means
that a tree can have multiple root folders. In this sample, there is only one root folder displayed in
the tree: “Mail”. However, if you were to add sibling nodes at that level in the XML, multiple root
nodes would be displayed in the Tree.
Tree parameters
The following are authoring parameters that you can set for each Tree component instance in the
Property inspector.
multipleSelection
A Boolean value that indicates whether a user can select multiple items
(
true
) or not (
false
). The default value is false.
rowHeight
The height of each row in pixels. The default value is 20.
You can write Lingo or JavaScript to control these and additional options for the Tree component
using its properties, methods, and events.
You cannot enter data parameters in the Property inspector for the Tree component like you can
with other components.
Customizing the Tree component
You can size a Tree component horizontally and vertically both while authoring and at runtime.
While authoring, select the component on the Stage and drag the resize handles. At runtime, use
the
setSize()
method. When a tree isn’t wide enough to display the text of the nodes, the text
is clipped.
Method summary for the Tree class
Method Description
PopUpManager.createPopUp()
Adds a node to a tree instance.
Accordion.createSegment()
Adds a node at a specific location in a tree instance.
Accordion.destroyChildAt()
Specifies whether the folder is a branch (has a folder icon and an
expander arrow).
Accordion.getChildAt()
Indicates whether a branch is open or closed.
Tree.getDisplayIndex()
Returns the display index of a given node.
Tree.getNodeDisplayedAt()
Returns the display index of a given node.
Tree.getTreeNodeAt()
Returns a node on the root of the tree.
Tree.removeAll()
Removes all nodes from a tree instance and refreshes the tree.
Tree.removeTreeNodeAt()
Removes a node at a specified position and refreshes the tree.
Tree.setIsBranch()
Indicates whether a node is a branch (receives folder icon and
expander arrow).
Содержание DIRECTOR MX 2004-USING DIRECTOR
Страница 1: ...DIRECTOR MX 2004 Using Director...
Страница 16: ...16 Chapter 1 Introduction...
Страница 82: ...82 Chapter 3 Sprites...
Страница 98: ...98 Chapter 4 Animation...
Страница 134: ...134 Chapter 5 Bitmaps...
Страница 242: ...242 Chapter 10 Sound and Synchronization...
Страница 274: ...274 Chapter 11 Using Digital Video...
Страница 290: ...290 Chapter 12 Behaviors...
Страница 302: ...302 Chapter 13 Navigation and User Interaction...
Страница 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Страница 392: ...392 Chapter 16 Working with Models and Model Resources...
Страница 418: ...418 Chapter 18 Movies in a Window...
Страница 446: ...446 Chapter 22 Managing and Testing Director Projects...