Class TreeBoxBase<TSelectionBox, TChain, TContainer, TElement>
- Namespace
- RichHudFramework.UI
- Assembly
- RichHudClient.dll
Fully generic abstract base for tree box controls. Combines a clickable header (with expand/collapse arrow) and a dropdown selection list that appears below it when opened.
public abstract class TreeBoxBase<TSelectionBox, TChain, TContainer, TElement> : LabelElementBase, IReadOnlyHudElement, IReadOnlyHudNode, IReadOnlyHudParent, IMinLabelElement, IEntryBox<TContainer, TElement>, IEnumerable<TContainer>, IEnumerable, IValueControl<TContainer>, IValueControl, IClickableElement, IFocusableElement where TSelectionBox : SelectionBoxBase<TChain, TContainer, TElement>, new() where TChain : HudChain<TContainer, TElement>, new() where TContainer : class, ISelectionBoxEntry<TElement>, new() where TElement : HudElementBase, IMinLabelElement
Type Parameters
TSelectionBoxType of the selection box that manages the dropdown list.
TChainType of HudChain<TElementContainer, TElement> used inside the selection box.
TContainerContainer type wrapping each entry's UI element.
TElementUI element type displayed for each entry.
- Inheritance
-
TreeBoxBase<TSelectionBox, TChain, TContainer, TElement>
- Implements
-
IEntryBox<TContainer, TElement>IEnumerable<TContainer>IValueControl<TContainer>
- Derived
- Inherited Members
Remarks
This is the abstract base for TreeBox<TContainer, TElement> and TreeList<TContainer, TElement, TValue>.
Fields
selectionBox
The dropdown selection box that contains all list entries and manages selection logic.
public readonly TSelectionBox selectionBox
Field Value
- TSelectionBox
Properties
Count
Number of entries currently in the dropdown list.
public int Count { get; }
Property Value
DropdownHeight
Gets or sets the height of the dropdown list when open.
public float DropdownHeight { get; set; }
Property Value
EntryList
Read-only access to the full list of entries currently in the tree box.
public IReadOnlyList<TContainer> EntryList { get; }
Property Value
- IReadOnlyList<TContainer>
FocusColor
Color used for highlighting focused entries
public Color FocusColor { get; set; }
Property Value
FocusHandler
Handles keyboard/input focus for the entire tree box (header + list).
public IFocusHandler FocusHandler { get; }
Property Value
FocusTextColor
Text color used for the entry that currently has input focus.
public Color FocusTextColor { get; set; }
Property Value
Format
Default text formatting applied to both the header and all list entries.
public GlyphFormat Format { get; set; }
Property Value
HeaderColor
Background color of the header.
public Color HeaderColor { get; set; }
Property Value
HighlightColor
Default highlight color for entries (when hovered without input focus).
public Color HighlightColor { get; set; }
Property Value
HighlightPadding
Padding around the selection highlight in the dropdown list.
public Vector2 HighlightPadding { get; set; }
Property Value
IndentSize
Horizontal offset applied to each level of nested/child entries
public float IndentSize { get; set; }
Property Value
LabelHeight
Height of the clickable header
public float LabelHeight { get; set; }
Property Value
ListContainer
Enables nested collection-initializer syntax (e.g., new MyTreeBox { ListContainer = { entry1, entry2 } })
public TreeBoxBase<TSelectionBox, TChain, TContainer, TElement> ListContainer { get; }
Property Value
- TreeBoxBase<TSelectionBox, TChain, TContainer, TElement>
ListOpen
Indicates whether the dropdown list is currently visible.
public bool ListOpen { get; protected set; }
Property Value
MouseInput
Mouse input handler for the header (used for clicking to open/close the list).
public IMouseInput MouseInput { get; }
Property Value
Name
Text displayed in the header of the tree box.
public RichText Name { get; set; }
Property Value
TabColor
Color of the vertical tab next to a selection
public Color TabColor { get; set; }
Property Value
TextBoard
Provides direct access to the ITextBoard used by the header label.
public override ITextBoard TextBoard { get; }
Property Value
UpdateValueCallback
Allows registering a ValueChanged in an initializer block.
public EventHandler UpdateValueCallback { set; }
Property Value
Value
Currently selected entry, or null if nothing is selected.
public TContainer Value { get; }
Property Value
- TContainer
Methods
ClearSelection()
Clears the current selection.
public void ClearSelection()
CloseList()
Closes the dropdown list.
public void CloseList()
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<TContainer> GetEnumerator()
Returns
- IEnumerator<TContainer>
An enumerator that can be used to iterate through the collection.
OpenList()
Opens the dropdown list.
public void OpenList()
SetSelection(TContainer)
Selects the specified entry.
public void SetSelection(TContainer member)
Parameters
memberTContainer
SetSelectionAt(int)
Selects the entry at the given index.
public void SetSelectionAt(int index)
Parameters
indexint
Events
ValueChanged
Raised when the selected entry changes.
public event EventHandler ValueChanged
Event Type
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
IEnumerator IEnumerable.GetEnumerator()
Returns
- IEnumerator
An IEnumerator object that can be used to iterate through the collection.