Class Selection
Selection cyclic renderer
Inherited Members
Namespace: Terminaux.Writer.CyclicWriters.Graphical
Assembly: Terminaux.dll
Syntax
public class Selection : GraphicalCyclicWriter
Constructors
| Edit this page View SourceSelection()
Makes a new selection instance
Declaration
public Selection()
Selection(InputChoiceCategoryInfo[])
Makes a new selection instance
Declaration
public Selection(InputChoiceCategoryInfo[] categories)
Parameters
| Type | Name | Description |
|---|---|---|
| InputChoiceCategoryInfo[] | categories | Categories |
Selection(InputChoiceGroupInfo[])
Makes a new selection instance
Declaration
public Selection(InputChoiceGroupInfo[] groups)
Parameters
| Type | Name | Description |
|---|---|---|
| InputChoiceGroupInfo[] | groups | Groups |
Selection(InputChoiceInfo[])
Makes a new selection instance
Declaration
public Selection(InputChoiceInfo[] choices)
Parameters
| Type | Name | Description |
|---|---|---|
| InputChoiceInfo[] | choices | Choices |
Properties
| Edit this page View SourceAltBackgroundColor
Alternative option background color
Declaration
public Color AltBackgroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
AltChoicePos
Alternative choice position (one-based)
Declaration
public int AltChoicePos { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
AltForegroundColor
Alternative option foreground color
Declaration
public Color AltForegroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
AltSelectedBackgroundColor
Selected alternative option background color
Declaration
public Color AltSelectedBackgroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
AltSelectedForegroundColor
Selected alternative option foreground color
Declaration
public Color AltSelectedForegroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
BackgroundColor
Option background color
Declaration
public Color BackgroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
CurrentSelection
Current selection (zero-based)
Declaration
public int CurrentSelection { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Use this property only if either CurrentSelections is not null or if ShowRadioButtons is not true. Otherwise, rely on the value of SelectedChoice
CurrentSelections
Current selections (null for single selection)
Declaration
public int[]? CurrentSelections { get; set; }
Property Value
| Type | Description |
|---|---|
| int[] |
DisabledBackgroundColor
Disabled option background color
Declaration
public Color DisabledBackgroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
DisabledForegroundColor
Disabled option foreground color
Declaration
public Color DisabledForegroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
Ellipsis
Whether to use ellipsis for selection entries or not
Declaration
public bool Ellipsis { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ForegroundColor
Option foreground color
Declaration
public Color ForegroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
SelectedBackgroundColor
Selected option background color
Declaration
public Color SelectedBackgroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
SelectedChoice
Selected choice (zero-based, -1 if ShowRadioButtons is not true or if CurrentSelections is not null)
Declaration
public int SelectedChoice { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Use this property only if CurrentSelections is null and ShowRadioButtons is true. Otherwise, rely on the value of CurrentSelection
SelectedForegroundColor
Selected option foreground color
Declaration
public Color SelectedForegroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
Selections
List of selection categories
Declaration
public InputChoiceCategoryInfo[] Selections { get; set; }
Property Value
| Type | Description |
|---|---|
| InputChoiceCategoryInfo[] |
Settings
Selection style settings
Declaration
public SelectionStyleSettings Settings { get; set; }
Property Value
| Type | Description |
|---|---|
| SelectionStyleSettings |
ShowRadioButtons
Whether to show the radio buttons or not (ignored when CurrentSelections is not null)
Declaration
public bool ShowRadioButtons { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
SliderColor
Slider foreground color
Declaration
public Color SliderColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
SwapSelectedColors
Whether to swap the selected colors or not
Declaration
public bool SwapSelectedColors { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
UseColors
Whether to use colors or not
Declaration
public bool UseColors { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Width
Element width
Declaration
public override int Width { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Methods
| Edit this page View SourceCanGenerateSelectionHitbox(int, int, out (PointerHitbox hitbox, ChoiceHitboxType type, int related))
Checks to see whether the generation of the selection hitboxes is possible
Declaration
public bool CanGenerateSelectionHitbox(int selectionIdx, int hitboxIdx, out (PointerHitbox hitbox, ChoiceHitboxType type, int related) hitbox)
Parameters
| Type | Name | Description |
|---|---|---|
| int | selectionIdx | Selection index from all choices |
| int | hitboxIdx | Hitbox index |
| (PointerHitbox hitbox, ChoiceHitboxType type, int related) | hitbox | Pointer hitbox instances that are built for each selection |
Returns
| Type | Description |
|---|---|
| bool | True if generation is possible; false otherwise |
CanGenerateSelectionHitbox(int, out (PointerHitbox hitbox, ChoiceHitboxType type, int related))
Checks to see whether the generation of the selection hitboxes is possible
Declaration
public bool CanGenerateSelectionHitbox(int hitboxIdx, out (PointerHitbox hitbox, ChoiceHitboxType type, int related) hitbox)
Parameters
| Type | Name | Description |
|---|---|---|
| int | hitboxIdx | Hitbox index |
| (PointerHitbox hitbox, ChoiceHitboxType type, int related) | hitbox | Pointer hitbox instances that are built for each selection |
Returns
| Type | Description |
|---|---|
| bool | True if generation is possible; false otherwise |
GenerateSelectionHitbox(int)
Generates the selection hitboxes
Declaration
public (PointerHitbox hitbox, ChoiceHitboxType type, int related) GenerateSelectionHitbox(int hitboxIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| int | hitboxIdx | Hitbox index |
Returns
| Type | Description |
|---|---|
| (PointerHitbox hitbox, ChoiceHitboxType type, int related) | Pointer hitbox instances that are built for each selection |
GenerateSelectionHitbox(int, int)
Generates the selection hitboxes
Declaration
public (PointerHitbox hitbox, ChoiceHitboxType type, int related) GenerateSelectionHitbox(int selectionIdx, int hitboxIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| int | selectionIdx | Selection index from all choices |
| int | hitboxIdx | Hitbox index |
Returns
| Type | Description |
|---|---|
| (PointerHitbox hitbox, ChoiceHitboxType type, int related) | Pointer hitbox instances that are built for each selection |
GenerateSelectionHitboxes()
Generates the selection hitboxes
Declaration
public (PointerHitbox hitbox, ChoiceHitboxType type, int related)[] GenerateSelectionHitboxes()
Returns
| Type | Description |
|---|---|
| (PointerHitbox hitbox, ChoiceHitboxType type, int related)[] | Pointer hitbox instances that are built for each selection |
GenerateSelectionHitboxes(int)
Generates the selection hitboxes
Declaration
public (PointerHitbox hitbox, ChoiceHitboxType type, int related)[] GenerateSelectionHitboxes(int selectionIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| int | selectionIdx | Selection index from all choices |
Returns
| Type | Description |
|---|---|
| (PointerHitbox hitbox, ChoiceHitboxType type, int related)[] | Pointer hitbox instances that are built for each selection |
GetHitboxIndex()
Gets the hitbox index from the selection index
Declaration
public int GetHitboxIndex()
Returns
| Type | Description |
|---|---|
| int | Hitbox index that represents the selection index |
GetHitboxIndex(int)
Gets the hitbox index from the selection index
Declaration
public int GetHitboxIndex(int selectionIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| int | selectionIdx | Selection index from all choices |
Returns
| Type | Description |
|---|---|
| int | Hitbox index that represents the selection index |
InvalidateCache()
Forces refresh
Declaration
public void InvalidateCache()
Render()
Renders a selection
Declaration
public override string Render()
Returns
| Type | Description |
|---|---|
| string | A string representation of the selection |