-
Notifications
You must be signed in to change notification settings - Fork 3
StringInputDialog
Back to home | Back to Reference | View raw text
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph SolidShineUi
SolidShineUi.StringInputDialog[[StringInputDialog]]
SolidShineUi.FlatWindow[[FlatWindow]]
end
subgraph System.Windows.Markup
System.Windows.Markup.IComponentConnector[[IComponentConnector]]
end
System.Windows.Markup.IComponentConnector --> SolidShineUi.StringInputDialog
SolidShineUi.FlatWindow --> SolidShineUi.StringInputDialog
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 |
bool |
SelectTextOnFocus Get or set whether all of the text in the text box should be selected when the text box receives focus. |
get, set |
string |
ValidationFailureString Get or set the string to display in the UI when the validation returns false (a failure), indicating an invalid or unusable string. |
get, set |
Func <string , bool > |
ValidationFunction Get or set the data validation function that should be used to make sure the inputted string matches an expected format. |
get, set |
string |
ValidationSuccessString Get or set the string to display in the UI when the validation returns true (a success), indicating a good and valid string. |
get, set |
string |
Value Get or set the text value of the input dialog's text box. |
get, set |
Returns | Name |
---|---|
void |
InitializeComponent ()InitializeComponent |
Returns | Name |
---|---|
Delegate |
_CreateDelegate (Type delegateType, string handler) |
IComponentConnector
-
FlatWindow
public StringInputDialog()
Create a StringInputDialog with nothing preset.
public StringInputDialog(ColorScheme cs)
Type | Name | Description |
---|---|---|
ColorScheme |
cs | The color scheme to use for the window. |
Create a StringInputDialog with a color scheme.
public StringInputDialog(ColorScheme cs, string title, string desc, string value)
Type | Name | Description |
---|---|---|
ColorScheme |
cs | The color scheme to use for the window. |
string |
title | The title of the window. |
string |
desc | The description to give to the user. |
string |
value | The value to place in the text box. By default, the text box is empty. |
Create a StringInputBox with prefilled values.
public virtual void InitializeComponent()
InitializeComponent
internal Delegate _CreateDelegate(Type delegateType, string handler)
Type | Name | Description |
---|---|---|
Type |
delegateType | |
string |
handler |
public string Value { get; set; }
Get or set the text value of the input dialog's text box.
public string Description { get; set; }
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.
Try to keep the description to about a sentence long. If you do have a lengthier description, you may need to resize the window to make it fit properly. Ideally, the overall design of the program should make it apparent what the user should enter into the text box without reading the description. However, the description is helpful to remind the user what is being asked of them here, and also to potentially clarify the types of values that are valid or invalid.
public bool DialogResult { get; }
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.
public bool EnterKeyConfirms { get; set; }
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".
public bool EscapeKeyCancels { get; set; }
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".
public bool SelectTextOnFocus { get; set; }
Get or set whether all of the text in the text box should be selected when the text box receives focus.
public Func<string, bool> ValidationFunction { get; set; }
Get or set the data validation function that should be used to make sure the inputted string matches an expected format.
Set this to null
if you want to disable data validation.
This function is called every time that the text in the text box is changed, so it's important to have a function that is relatively fast, so as
to avoid blocking the UI thread.
The function will be given the current text in the text box, and is asked to return a bool if it matches the expected validation
( true
for a good match, false
for an invalid string).
public string ValidationSuccessString { get; set; }
Get or set the string to display in the UI when the validation returns true (a success), indicating a good and valid string.
public string ValidationFailureString { get; set; }
Get or set the string to display in the UI when the validation returns false (a failure), indicating an invalid or unusable string.
Generated with ModularDoc