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
TChainLinear stacking element containing entries. May or may not be scrollable.
TContainerContainer element type wrapping the UI element
TElementUI element in the list
TValueData 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
parentHudParentBase
Fields
border
Tintable border surrounding the selection box
public readonly BorderBox border
Field Value
Properties
LineHeight
Uniform height applied to list entries
public float LineHeight { get; set; }
Property Value
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
MemberPadding
Padding applied to list members.
public Vector2 MemberPadding { get; set; }
Property Value
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
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
entriesIReadOnlyList<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
Remove(TContainer)
Removes the member at the given index from the list box.
public bool Remove(TContainer entry)
Parameters
entryTContainer
Returns
RemoveAt(int)
Removes the member at the given index from the list box.
public void RemoveAt(int index)
Parameters
indexint
RemoveRange(int, int)
Removes the specified range of indices from the list box.
public void RemoveRange(int index, int count)
Parameters
SetSelection(TValue)
Sets the selection to the member associated with the given object.
public void SetSelection(TValue assocMember)
Parameters
assocMemberTValue