Table of Contents

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

TSelectionBox

Type of the selection box that manages the dropdown list.

TChain

Type of HudChain<TElementContainer, TElement> used inside the selection box.

TContainer

Container type wrapping each entry's UI element.

TElement

UI element type displayed for each entry.

Inheritance
TreeBoxBase<TSelectionBox, TChain, TContainer, TElement>
Implements
IEntryBox<TContainer, TElement>
IEnumerable<TContainer>
IValueControl<TContainer>
Derived
Inherited Members

Remarks

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

int

DropdownHeight

Gets or sets the height of the dropdown list when open.

public float DropdownHeight { get; set; }

Property Value

float

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

Color

FocusHandler

Handles keyboard/input focus for the entire tree box (header + list).

public IFocusHandler FocusHandler { get; }

Property Value

IFocusHandler

FocusTextColor

Text color used for the entry that currently has input focus.

public Color FocusTextColor { get; set; }

Property Value

Color

Format

Default text formatting applied to both the header and all list entries.

public GlyphFormat Format { get; set; }

Property Value

GlyphFormat

HeaderColor

Background color of the header.

public Color HeaderColor { get; set; }

Property Value

Color

HighlightColor

Default highlight color for entries (when hovered without input focus).

public Color HighlightColor { get; set; }

Property Value

Color

HighlightPadding

Padding around the selection highlight in the dropdown list.

public Vector2 HighlightPadding { get; set; }

Property Value

Vector2

IndentSize

Horizontal offset applied to each level of nested/child entries

public float IndentSize { get; set; }

Property Value

float

LabelHeight

Height of the clickable header

public float LabelHeight { get; set; }

Property Value

float

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

bool

MouseInput

Mouse input handler for the header (used for clicking to open/close the list).

public IMouseInput MouseInput { get; }

Property Value

IMouseInput

Name

Text displayed in the header of the tree box.

public RichText Name { get; set; }

Property Value

RichText

TabColor

Color of the vertical tab next to a selection

public Color TabColor { get; set; }

Property Value

Color

TextBoard

Provides direct access to the ITextBoard used by the header label.

public override ITextBoard TextBoard { get; }

Property Value

ITextBoard

UpdateValueCallback

Allows registering a ValueChanged in an initializer block.

public EventHandler UpdateValueCallback { set; }

Property Value

EventHandler

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

member TContainer

SetSelectionAt(int)

Selects the entry at the given index.

public void SetSelectionAt(int index)

Parameters

index int

Events

ValueChanged

Raised when the selected entry changes.

public event EventHandler ValueChanged

Event Type

EventHandler

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.