class
GUITreeView
GUI element that displays some contents in a tree-view where elements are placed vertically above/beneath each other, and different elements may be nested within other elements.
Elements may be selected, renamed, dragged and re-parented.
This class is abstract and meant to be extended by an implementation specific to some content type (for example scene object hierarchy).
Public
Methods
staticGetGuiTypeName
Returns type name of the GUI element used for finding GUI element styles.
DeleteSelection
Deletes all currently selected elements.
DuplicateSelection
Duplicates the currently selected entries.
CopySelection
Marks the current selection for copying.
CutSelection
Marks the current selection for cutting.
Paste
Pastes a set of entries previously marked for cut or copy.
RenameSelected
Starts rename operation on the currently selected element.
Internal
Methods
UpdateInternal
Updates tree view if dirty, among other operations.
Must be called every frame.
Protected
Constructors
GUITreeView
Methods
~GUITreeView
CalculateUnconstrainedOptimalSize
Calculates the optimal size for the GUI element, ignoring size constraints.
UpdateLayoutForChildren
Calculates sizes and relative positions for all child elements.
Should be preceded with a call to UpdateOptimalLayoutSizes().
UpdateAbsoluteCoordinates
Updates the absolute coordinates of the GUI element using the currently assigned relative coordinates and the provided .
Also calculates the visible area clip rectangle and marks culled elements if they have no visible area. This should be called after updating the layout (as layout update calculates the needed relative coordinates). This may also be called independently of layout update, which is useful for scroll areas that then do not require a full layout pass to scroll their children.
- parentOrigin
- Absolute origin to add to the relative coordinates, in order to determine the absolute element coordinates.
- parentScale
- Scale of the parent GUI element.
- parentVisibleArea
- Absolute visible (clipped) area though which this element may be seen. This will be used for culling and clipping.
DoOnMouseEvent
Called when a mouse event is received on any GUI element the mouse is interacting with.
Return true if you have processed the event and don't want other elements to process it.
DoOnCommandEvent
Called when a command event is triggered.
Return true if you have processed the event and don't want other elements to process it.
FindElementUnderCoord
Attempts to find an interactable element under the specified coordinates.
Returns null if one cannot be found.
- coord
- Coordinates relative to parent GUI widget.
GetTopMostSelectedElement
Returns the top-most selected tree element if selection is active, null otherwise.
GetBottomMostSelectedElement
Returns the bottom-most selected tree element if selection is active, null otherwise.
EnableEdit
Starts rename operation on the specified tree element, spawning an input box.
DisableEdit
Ends rename operation if one is currently active.
- acceptChanges
- Should the new name be accepted or discarded.
ElementToggled
Triggered when the Foldout button for a tree element was been toggled (something was expanded or collapsed).
GetRootElementConst
Returns the top level TreeElement that cannot be modified.
UpdateTreeElementHierarchy
Checks if the hierarchy needs any updates and performs those updates if needed.
RenameTreeElement
Changes the name of the content associated with the provided tree element.
DeleteTreeElement
Deletes the content associated with the provided tree element.
AcceptDragAndDrop
Checks whether the tree view can accept the currently active drag and drop operation.
DragAndDropStart
Triggered when the user drags a tree element and starts a drag and drop operation.
DragAndDropEnded
Triggered when the user ends a drag and drop operation over the tree view.
- overTreeElement
- TreeElement the drag operation ended over, if any.
SelectionChanged
Triggered whenever a TreeElement gets selected or deselected.
IsSelectionActive
Are any tree elements currently selected.
UnselectElement
Unselects the provided TreeElement.
UnselectAll
Unselects all selected TreeElements.
- sendEvent
- Determines should the external world be notified of this change.
ExpandToElement
Expands all parents of the provided TreeElement making it interactable.
ExpandElement
Expands the provided TreeElement making its children interactable.
Set to true to change the toggle state on the toggle button itself. Set this to false if called from the toggle button callback.
CollapseElement
Collapses the provided TreeElement making its children hidden and not interactable.
Set to true to change the toggle state on the toggle button itself. Set this to false if called from the toggle button callback.
UpdateElementGui
Rebuilds the needed GUI elements for the provided TreeElement.
CloseTemporarilyExpandedElements
Close any elements that were temporarily expanded due to a drag operation hovering over them.
TemporarilyExpandElement
Temporarily expand the provided element.
Temporarily expanded elements can be closed by calling closeTemporarilyExpandedElements().
ScrollToElement
Scrolls the parent GUIScrollArea (if any) so that the specified TreeElement is visible.
- element
- Element to scroll to.
- center
- If true the element will be centered in the scroll view, otherwise it will be at the top.
FindParentScrollArea
Attempts to find the parent GUIScrollArea that the tree view is a child of.
Ping
Scrolls the tree view to the specified element and highlights it.
ClearPing
Clears the ping highlight on the currently highlighted element.
OnEditAccepted
Triggered when the user accepts the changes during a rename operation.
OnEditCanceled
Triggered when the user rejects the changes during a rename operation.
OnEditFocusLost
Triggered when the user clicks outside of the edit box during a rename operation.