Show / Hide Table of Contents

Class CharacterPicker

Displays the glyphs associated with a font and allows the user to select one.

Inheritance
object
ControlBase
CompositeControl
SurfaceViewer
CharacterPicker
Implements
IContainer
IList<ControlBase>
ICollection<ControlBase>
IEnumerable<ControlBase>
IEnumerable
Inherited Members
SurfaceViewer.HorizontalScroller
SurfaceViewer.VerticalScroller
SurfaceViewer.ResetSurface()
SurfaceViewer.OnSurfaceChanged(ICellSurface, ICellSurface)
SurfaceViewer.ScrollBarMode
CompositeControl.MouseLastHandledByChild
CompositeControl.Controls
CompositeControl.NamedControls
CompositeControl.CreateChildControls()
CompositeControl.OnMouseExit(ControlBase.ControlMouseState)
CompositeControl.AddControl(ControlBase)
CompositeControl.RemoveControl(ControlBase)
CompositeControl.Count
CompositeControl.this[int]
ControlBase.MouseState_IsMouseOver
ControlBase.MouseState_EnteredWithButtonDown
ControlBase.MouseState_IsMouseLeftDown
ControlBase.MouseState_IsMouseRightDown
ControlBase.OnUnfocused()
ControlBase.OnFocused()
ControlBase.OnIsDirtyChanged()
ControlBase.ProcessKeyboard(Keyboard)
ControlBase.LostMouse(MouseScreenObjectState)
ControlBase.OnParentChanged()
ControlBase.OnPositionChanged()
ControlBase.PlaceRelativeTo(ControlBase, Direction.Types, int)
ControlBase.DetermineState()
ControlBase.OnStateChanged(ControlStates, ControlStates)
ControlBase.FindThemeFont()
ControlBase.FindThemeColors()
ControlBase.SetThemeColors(Colors)
ControlBase.HasThemeColors()
ControlBase.Resize(int, int)
ControlBase.OnResized()
ControlBase.RefreshThemeStateColors(Colors)
ControlBase.OnMouseEnter(ControlBase.ControlMouseState)
ControlBase.OnRightMouseClicked(ControlBase.ControlMouseState)
ControlBase.ThemeState
ControlBase.UseKeyboard
ControlBase.UseMouse
ControlBase.CanFocus
ControlBase.CanResize
ControlBase.AlternateFont
ControlBase.Surface
ControlBase.MouseArea
ControlBase.IsMouseButtonStateClean
ControlBase.Position
ControlBase.AbsolutePosition
ControlBase.IsVisible
ControlBase.Tag
ControlBase.TabStop
ControlBase.TabIndex
ControlBase.IsDirty
ControlBase.Name
ControlBase.FocusOnMouseClick
ControlBase.Width
ControlBase.Height
ControlBase.IsFocused
ControlBase.IsEnabled
ControlBase.Bounds
ControlBase.Parent
ControlBase.State
ControlBase.IsDirtyChanged
ControlBase.Focused
ControlBase.Unfocused
ControlBase.PositionChanged
ControlBase.MouseEnter
ControlBase.MouseExit
ControlBase.MouseMove
ControlBase.MouseButtonClicked
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole.UI.Controls
Assembly: SadConsole.Extended.dll
Syntax
public class CharacterPicker : SurfaceViewer, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

Constructors

CharacterPicker(Color, Color, Color, IFont, int, int, int)

Creates a new character picker control.

Declaration
public CharacterPicker(Color foreground, Color fill, Color selectedCharacterColor, IFont characterFont, int visibleColumns, int visibleRows, int fontColumns)
Parameters
Type Name Description
Color foreground

Foreground color of all the glyphs.

Color fill

Background color of all the glyphs.

Color selectedCharacterColor

The foreground color displayed on the selected glyph.

IFont characterFont

The font used to display the glyphs.

int visibleColumns

The number of columns to show. The control will be this wide plus 1.

int visibleRows

The number of rows to show. The control will be this high plus 1.

int fontColumns

How many columns are defined in the font file.

CharacterPicker(Color, Color, Color, SadFont, int, int)

Creates a new picker control with the specified font.

Declaration
public CharacterPicker(Color foreground, Color fill, Color selectedCharacterColor, SadFont characterFont, int visibleColumns, int visibleRows)
Parameters
Type Name Description
Color foreground

Foreground color of all the glyphs.

Color fill

Background color of all the glyphs.

Color selectedCharacterColor

The foreground color displayed on the selected glyph.

SadFont characterFont

The font used to display the glyphs.

int visibleColumns

The number of columns to show. The control will be this wide plus 1.

int visibleRows

The number of rows to show. The control will be this high plus 1.

Properties

GlyphBackground

Gets the background color used when drawing the glyphs.

Declaration
public Color GlyphBackground { get; }
Property Value
Type Description
Color

GlyphForeground

Gets the foreground color used when drawing the glyphs.

Declaration
public Color GlyphForeground { get; }
Property Value
Type Description
Color

HighlightSelectedCharacter

When true, highlights the selected character with SelectedGlyphForeground when HighlightSelectedCharacterWithEffect is false;

Declaration
public bool HighlightSelectedCharacter { get; set; }
Property Value
Type Description
bool

HighlightSelectedCharacterWithEffect

When true, uses SelectedGlyphEffect to highlight the character.

Declaration
public bool HighlightSelectedCharacterWithEffect { get; set; }
Property Value
Type Description
bool

MirrorSetting

Gets or sets the mirror effect to apply in the theme.

Declaration
public Mirror MirrorSetting { get; set; }
Property Value
Type Description
Mirror

NewCharacterLocation

Gets the position of the newly selected character. Used by the theme.

Declaration
public Point NewCharacterLocation { get; }
Property Value
Type Description
Point

OldCharacterLocation

Gets the position of the previously selected character. Used by the theme.

Declaration
public Point OldCharacterLocation { get; }
Property Value
Type Description
Point

SelectedCharacter

Gets or sets the selected glyph character.

Declaration
public int SelectedCharacter { get; set; }
Property Value
Type Description
int

SelectedGlyphEffect

Gets the effect to apply when drawing the selected glyph.

Declaration
public ICellEffect? SelectedGlyphEffect { get; set; }
Property Value
Type Description
ICellEffect

SelectedGlyphForeground

Gets the foreground color used when drawing the selected glyph.

Declaration
public Color SelectedGlyphForeground { get; }
Property Value
Type Description
Color

UseFullClick

When true, indicates that the control should use a mouse click to select a new character; otherwise false to indicate that just having the mouse down will select a new character.

Declaration
public bool UseFullClick { get; set; }
Property Value
Type Description
bool

Methods

CreateControlSurface()

Generates the surface to be used by this control. This method is called internally to assign the Surface property a value.

Declaration
protected override ICellSurface CreateControlSurface()
Returns
Type Description
ICellSurface

A surface that should be assigned to the Surface property.

Overrides
ControlBase.CreateControlSurface()

OnLeftMouseClicked(ControlMouseState)

Called when the left mouse button is clicked. Raises the MouseButtonClicked event and calls the DetermineState() method.

Declaration
protected override void OnLeftMouseClicked(ControlBase.ControlMouseState info)
Parameters
Type Name Description
ControlBase.ControlMouseState info
Overrides
ControlBase.OnLeftMouseClicked(ControlBase.ControlMouseState)

OnMouseIn(ControlMouseState)

Called as the mouse moves around the control area. Raises the MouseMove event and calls the DetermineState() method.

Declaration
protected override void OnMouseIn(ControlBase.ControlMouseState info)
Parameters
Type Name Description
ControlBase.ControlMouseState info
Overrides
ControlBase.OnMouseIn(ControlBase.ControlMouseState)

ProcessMouse(MouseScreenObjectState)

Processes the mouse on each control hosted by this control.

Declaration
public override bool ProcessMouse(MouseScreenObjectState state)
Parameters
Type Name Description
MouseScreenObjectState state

The mouse state based on the parent screen object.

Returns
Type Description
bool

true when a control processes the mouse; otherwise false.

Overrides
CompositeControl.ProcessMouse(MouseScreenObjectState)

UpdateAndRedraw(TimeSpan)

Updates each control hosted by this control.

Declaration
public override void UpdateAndRedraw(TimeSpan time)
Parameters
Type Name Description
TimeSpan time

The game frame time delta.

Overrides
SurfaceViewer.UpdateAndRedraw(TimeSpan)

Events

SelectedCharacterChanged

Raised when the SelectedCharacter property changes.

Declaration
public event EventHandler<ValueChangedEventArgs<int>>? SelectedCharacterChanged
Event Type
Type Description
EventHandler<ValueChangedEventArgs<int>>

Implements

IContainer
IList<T>
ICollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX