Skip to content

PropertyList.Dialogs.CharInputDialog

JaykeBird edited this page Feb 21, 2023 · 3 revisions

Back to home | Back to Reference | View raw text

CharInputDialog class

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi.PropertyList.Dialogs
  SolidShineUi.PropertyList.Dialogs.CharInputDialog[[CharInputDialog]]
  end
  subgraph System.Windows.Markup
System.Windows.Markup.IComponentConnector[[IComponentConnector]]
  end
  subgraph SolidShineUi
  SolidShineUi.FlatWindow[[FlatWindow]]
  end
System.Windows.Markup.IComponentConnector --> SolidShineUi.PropertyList.Dialogs.CharInputDialog
SolidShineUi.FlatWindow --> SolidShineUi.PropertyList.Dialogs.CharInputDialog
Loading

Members

Properties

Public properties

Type Name Methods
string Description
Get or set the description text to display above the text box. This text should describe what the user should enter into the text box.
get, set
bool DialogResult
Get the result of the dialog when it is closed. "False" refers to the user cancelling the operation, while "True" refers to the user confirming, by clicking "OK" or pressing the Enter key.
get
bool EnterKeyConfirms
Get or set whether the Enter key can be used to confirm the dialog. If enabled, pressing down the Enter key will be treated as if the user pressed "OK".
get, set
bool EscapeKeyCancels
Get or set whether the Escape key can be used to cancel the dialog. If enabled, pressing down the Escape key will be treated as if the user pressed "Cancel".
get, set
char ValueAsChar
Get the Unicode character selected in this dialog, as a char.
get, set
Rune ValueAsRune
Get the Unicode character selected in this dialog, as a Rune.
get

Methods

Public methods

Returns Name
void EnterIntoRuneMode()
Enable rune mode for this dialog, which will allow the display of characters beyond what a single char can support. This is meant to be used in situations where a Rune, not a char, is needed.
void InitializeComponent()
InitializeComponent

Internal methods

Returns Name
Delegate _CreateDelegate(Type delegateType, string handler)

Details

Inheritance

Constructors

CharInputDialog [1/4]

public CharInputDialog()
Summary

Create a CharInputDialog.

CharInputDialog [2/4]

public CharInputDialog(ColorScheme cs)
Arguments
Type Name Description
ColorScheme cs The color scheme to use for the window.
Summary

Create a CharInputDialog with a color scheme.

CharInputDialog [3/4]

public CharInputDialog(ColorScheme cs, char value)
Arguments
Type Name Description
ColorScheme cs The color scheme to use for the window.
char value The value to preload into this dialog. The user is able to change the value though.
Summary

Create a CharInputDialog with prefilled values, with a char being entered in.

CharInputDialog [4/4]

public CharInputDialog(ColorScheme cs, Rune value)
Arguments
Type Name Description
ColorScheme cs The color scheme to use for the window.
Rune value The value to preload into this dialog. The user is able to change the value though.
Summary

Create a StringInputBox with prefilled values, with a Rune being entered in.

Remarks

Entering in a Rune value will put the dialog into "Rune mode", which can be used to enter in and display characters beyond what a single char can support.

Methods

EnterIntoRuneMode

public void EnterIntoRuneMode()
Summary

Enable rune mode for this dialog, which will allow the display of characters beyond what a single char can support. This is meant to be used in situations where a Rune, not a char, is needed.

Remarks

If you suppled a Rune in the constructor for this dialog, then the dialog is already in Rune mode. When using Rune mode, you should get the value entered in via using CharInputDialog.ValueAsRune .

InitializeComponent

public virtual void InitializeComponent()
Summary

InitializeComponent

_CreateDelegate

internal Delegate _CreateDelegate(Type delegateType, string handler)
Arguments
Type Name Description
Type delegateType
string handler

Properties

ValueAsChar

public char ValueAsChar { get; set; }
Summary

Get the Unicode character selected in this dialog, as a char.

Remarks

Note that chars are explicitly UTF-16. Many code points (especially multilingual, extended, or symbol/emoji characters) cannot be represented as a single UTF-16 char, and instead will require two. This dialog only returns one char, but you can check if it is such a char by using Char.IsSurrogate(System.Char) .

        If using .NET Core or .NET 5 or higher, you can use Runes instead.

ValueAsRune

public Rune ValueAsRune { get; }
Summary

Get the Unicode character selected in this dialog, as a Rune.

DialogResult

public bool DialogResult { get; }
Summary

Get the result of the dialog when it is closed. "False" refers to the user cancelling the operation, while "True" refers to the user confirming, by clicking "OK" or pressing the Enter key.

EnterKeyConfirms

public bool EnterKeyConfirms { get; set; }
Summary

Get or set whether the Enter key can be used to confirm the dialog. If enabled, pressing down the Enter key will be treated as if the user pressed "OK".

EscapeKeyCancels

public bool EscapeKeyCancels { get; set; }
Summary

Get or set whether the Escape key can be used to cancel the dialog. If enabled, pressing down the Escape key will be treated as if the user pressed "Cancel".

Description

public string Description { get; set; }
Summary

Get or set the description text to display above the text box. This text should describe what the user should enter into the text box.

Remarks

Try to keep the description to about a sentence long. Ideally, the overall design of the program should make it apparent what the user should enter into the text box without reading the description.

Generated with ModularDoc

Clone this wiki locally