Table of Contents

Class SelectionBox<TChain, TContainer, TElement, TValue>

Namespace
RichHudFramework.UI
Assembly
RichHudClient.dll

Generic list of pooled, selectable entries of uniform size.

public class SelectionBox<TChain, TContainer, TElement, TValue> : SelectionBoxBase<TChain, TContainer, TElement>, IReadOnlyHudElement, IReadOnlyHudNode, IReadOnlyHudParent, IEntryBox<TContainer, TElement>, IEnumerable<TContainer>, IEnumerable, IValueControl<TContainer>, IValueControl, IClickableElement, IFocusableElement where TChain : HudChain<TContainer, TElement>, new() where TContainer : class, IListBoxEntry<TElement, TValue>, new() where TElement : HudElementBase, IMinLabelElement

Type Parameters

TChain

Linear stacking element containing entries. May or may not be scrollable.

TContainer

Container element type wrapping the UI element

TElement

UI element in the list

TValue

Data type stored associated with each entry

Inheritance
SelectionBoxBase<TChain, TContainer, TElement>
SelectionBox<TChain, TContainer, TElement, TValue>
Implements
IEntryBox<TContainer, TElement>
IEnumerable<TContainer>
IValueControl<TContainer>
Derived
Inherited Members

Constructors

SelectionBox()

public SelectionBox()

SelectionBox(HudParentBase)

public SelectionBox(HudParentBase parent)

Parameters

parent HudParentBase

Fields

border

Tintable border surrounding the selection box

public readonly BorderBox border

Field Value

BorderBox

Properties

LineHeight

Uniform height applied to list entries

public float LineHeight { get; set; }

Property Value

float

ListContainer

Enables collection-initializer syntax (e.g., new SelectionBox { ListContainer = { entry1, entry2 } })

public SelectionBox<TChain, TContainer, TElement, TValue> ListContainer { get; }

Property Value

SelectionBox<TChain, TContainer, TElement, TValue>

ListPadding

Sets padding for the list independent of selection box padding.

public virtual Vector2 ListPadding { get; set; }

Property Value

Vector2

MemberPadding

Padding applied to list members.

public Vector2 MemberPadding { get; set; }

Property Value

Vector2

Methods

Add(RichText, TValue, bool)

Adds a new member to the list box with the given name and associated object.

public TContainer Add(RichText name, TValue assocMember, bool enabled = true)

Parameters

name RichText
assocMember TValue
enabled bool

Returns

TContainer

AddNew()

Adds a new pooled container entry to the list in its default state and returns it.

public TContainer AddNew()

Returns

TContainer

AddRange(IReadOnlyList<MyTuple<RichText, TValue, bool>>)

Adds the given range of entries to the list box.

public void AddRange(IReadOnlyList<MyTuple<RichText, TValue, bool>> entries)

Parameters

entries IReadOnlyList<MyTuple<RichText, TValue, bool>>

ClearEntries()

Removes all entries from the list box.

public void ClearEntries()

Insert(int, RichText, TValue, bool)

Inserts an entry at the given index.

public void Insert(int index, RichText name, TValue assocMember, bool enabled = true)

Parameters

index int
name RichText
assocMember TValue
enabled bool

Remove(TContainer)

Removes the member at the given index from the list box.

public bool Remove(TContainer entry)

Parameters

entry TContainer

Returns

bool

RemoveAt(int)

Removes the member at the given index from the list box.

public void RemoveAt(int index)

Parameters

index int

RemoveRange(int, int)

Removes the specified range of indices from the list box.

public void RemoveRange(int index, int count)

Parameters

index int
count int

SetSelection(TValue)

Sets the selection to the member associated with the given object.

public void SetSelection(TValue assocMember)

Parameters

assocMember TValue