TreeView
From LoTROInterface Wiki
API Reference > Turbine.UI.TreeView
A control to display data in a tree.
Contents |
Methods
Name | Description |
---|---|
CollapseAll | Collapses all nodes in the tree view. |
ExpandAll | Expands all nodes in the tree view. |
Focus | Request that the control take focus. (Inherited from Control) |
GetAllowDrop | Gets if the control supports drop operations from drag and drop. (Inherited from Control) |
GetBackColor | Gets the solid background color of the control. (Inherited from Control) |
GetBackColorBlendMode | Gets the blend mode applied to the background color. (Inherited from Control) |
GetBlendMode | Gets the blend mode applied to the background image. (Inherited from Control) |
GetControls | Gets the list of child controls. (Inherited from Control) |
GetFilter | |
GetHeight | Gets the height of the control. (Inherited from Control) |
GetHorizontalScrollBar | Gets the horizontal scroll bar. (Inherited from ScrollableControl) |
GetIndentationWidth | Gets the width of the indentation insert prefer nodes at each level in the tree. |
GetItemAt | |
GetLeft | Gets the left coordinate of the control. (Inherited from Control) |
GetMousePosition | Gets the mouse position relative to this control. (Inherited from Control) |
GetNodes | Gets the root nodes in the tree view control. |
GetOpacity | Gets the opacity of the window. (Inherited from Control) |
GetParent | Gets the parent of the control. (Inherited from Control) |
GetPosition | Gets the position of the control. (Inherited from Control) |
GetSelectedNode | Gets the currently selected node. |
GetSize | Gets the size of the control. (Inherited from Control) |
GetSortMethod | |
GetTop | Gets the top coordinate of the window. (Inherited from Control) |
GetVerticalScrollBar | Gets the vertical scroll bar. (Inherited from ScrollableControl) |
GetWantsKeyEvents | Gets a flag indicating if the control wants to receive key events. (Inherited from Control) |
GetWantsUpdates | Gets the flag indicating if the control wants to receive Update notifications. (Inherited from Control) |
GetWidth | Gets the width of the control. (Inherited from Control) |
GetZOrder | Gets the Z ordering index of the control. (Inherited from Control) |
HasFocus | Returns true if the control has focus. (Inherited from Control) |
IsAltKeyDown | Test if the alt key is pressed. (Inherited from Control) |
IsControlKeyDown | Test if the control key is pressed. (Inherited from Control) |
IsEnabled | Gets a flag indicating if the control is enabled. (Inherited from Control) |
IsMouseVisible | Gets a flag indicating if the mouse will see this control. (Inherited from Control) |
IsShiftKeyDown | Test if the shift key is pressed. (Inherited from Control) |
IsVisible | Gets a flag indicating if the control is visible. (Inherited from Control) |
PointToClient | Converts a coordinate from control space to screen space. (Inherited from Control) |
PointToScreen | Converts a coordinate from control space to screen space. (Inherited from Control) |
Refresh | |
SetAllowDrop | Sets if the control supports drop operations from drag and drop. (Inherited from Control) |
SetBackColor | Sets the background color of the control. (Inherited from Control) |
SetBackColorBlendMode | Sets the blend mode applied to the background color. (Inherited from Control) |
SetBackground | Sets the background image of the control. (Inherited from Control) |
SetBlendMode | Sets the blend mode applied to the background image. (Inherited from Control) |
SetEnabled | Sets a flag indicating if the control is enabled. (Inherited from Control) |
SetFilter | |
SetHeight | Sets the height of the control. (Inherited from Control) |
SetHorizontalScrollBar | Sets the horizontal scroll bar. (Inherited from ScrollableControl) |
SetIndentationWidth | Sets the width of the indentation insert prefer nodes at each level in the tree. |
SetLeft | Sets the left coordinate of the window. (Inherited from Control) |
SetMouseVisible | Gets a flag indicating if the mouse will see this control. (Inherited from Control) |
SetOpacity | Sets the opacity of the window. (Inherited from Control) |
SetParent | Sets the parent of the control. (Inherited from Control) |
SetPosition | Sets the position of the control. (Inherited from Control) |
SetSelectedNode | Sets the currently selected node. |
SetSize | Sets the size of the control. (Inherited from Control) |
SetSortMethod | |
SetTop | Sets the top coordinate of the window. (Inherited from Control) |
SetVerticalScrollBar | Sets the vertical scroll bar. (Inherited from ScrollableControl) |
SetVisible | Sets the visible flag of a control. (Inherited from Control) |
SetWantsKeyEvents | Sets a flag indicating if the control wants to receive key events. (Inherited from Control) |
SetWantsUpdates | Sets the flag indicating if the cotnrol wants to receive update notifications. (Inherited from Control) |
SetWidth | Sets the width of the control. (Inherited from Control) |
SetZOrder | Sets the Z order of the control. (Inherited from Control) |
Events
Name | Description |
---|---|
DragDrop | Event fired when a drag drop operation is completed. (Inherited from Control) |
DragEnter | Event fired when a drag drop operation enters the control. (Inherited from Control) |
DragLeave | Event fired when a drag drop operation leaves the control. (Inherited from Control) |
EnabledChanged | Event fired when the enabled state of the control changes. (Inherited from Control) |
FocusGained | Event fired when the control gains focus. (Inherited from Control) |
FocusLost | Event fired when the control loses focus. (Inherited from Control) |
KeyDown | Event fired when a key is pressed down. (Inherited from Control) |
KeyUp | Event fired when a key is released. (Inherited from Control) |
MouseClick | Event fired when a mouse button is clicked. (Inherited from Control) |
MouseDoubleClick | Event fired when a mouse button is double clicked. (Inherited from Control) |
MouseDown | Event fired when a mouse button is pressed. (Inherited from Control) |
MouseEnter | Event fired when the mouse enters the control. (Inherited from Control) |
MouseHover | Event fired when the mouse is hovering over the control. (Inherited from Control) |
MouseLeave | Event fired when the mouse leaves the cotnrol. (Inherited from Control) |
MouseMove | Event fired when the mouse moves. (Inherited from Control) |
MouseUp | Event fired when a mouse button is released. (Inherited from Control) |
MouseWheel | Event fired when a mouse wheel moves. (Inherited from Control) |
PositionChanged | Event fired when the position of the control changes. (Inherited from Control) |
SelectedNodeChanged | Event fired when the selected node has changed. |
SizeChanged | Event fired when the size of the control changes. (Inherited from Control) |
Update | Event fired every frame when WantsUpdates is enabled. (Inherited from Control) |
VisibleChanged | Event fired when the visible state of the control changes. (Inherited from Control) |
Remarks
This control display a hierarchy of nodes that can be expanded and collapsed. This base control does not automatically expand or collapse nodes. It is the responsibility of the scripter to invoke the SetExpanded method on the nodes in response to user input.
Examples
This example demonstrates creating a tree view control and populating it with nodes.
Using a TreeView | |
---|---|
-- Define a tree node class to put into the tree. MyTreeNode = class( Turbine.UI.TreeNode ); function MyTreeNode:Constructor() Turbine.UI.TreeNode.Constructor( self ); self:SetBackColor( Turbine.UI.Color( math.random(), math.random(), math.random() ) ); self:SetSize( 100, 18 ); end -- Create the container window. window = Turbine.UI.Lotro.Window(); window:SetSize( 400, 400 ); window:SetPosition( 100, 100 ); window:SetText( "Treeview test" ); window:SetVisible( true ); -- Create the tree view control. treeView = Turbine.UI.TreeView(); treeView:SetParent( window ); treeView:SetPosition( 10, 50 ); treeView:SetSize( 300, 200 ); treeView:SetBackColor( Turbine.UI.Color( 0.2, 0.2, 0.2 ) ); treeView:SetIndentationWidth( 15 ); -- Give the tree view a scroll bar. scriptTextScrollBar = Turbine.UI.Lotro.ScrollBar(); scriptTextScrollBar:SetOrientation( Turbine.UI.Orientation.Vertical ); scriptTextScrollBar:SetParent( window ); scriptTextScrollBar:SetPosition( 300, 50 ); scriptTextScrollBar:SetSize( 10, 200 ); treeView:SetVerticalScrollBar( scriptTextScrollBar ); -- Populate the test nodes. rootNodes = treeView:GetNodes(); local i; local j; for i = 1, 5 do local node = MyTreeNode(); rootNodes:Add( node ); local subNodes = node:GetChildNodes(); for j = 1, 5 do local node = MyTreeNode(); subNodes:Add( node ); local subNodes = node:GetChildNodes(); for k = 1, 5 do local node = MyTreeNode(); subNodes:Add( node ); local subNodes = node:GetChildNodes(); for l = 1, 5 do local node = MyTreeNode(); subNodes:Add( node ); end end end end |
Inheritence Hierarchy
- Turbine.UI.Control
- Turbine.UI.ScrollableControl
- Turbine.UI.TreeView
- Turbine.UI.ScrollableControl