Class MultiTextBox
A multi-control with text boxes for entering multiple values in the same line. Can also be used to draw text boxes in a row/column table.
Inherited Members
Namespace: DaggerfallWorkshop.Game.UserInterface
Assembly: Assembly-CSharp.dll
Syntax
public class MultiTextBox : Panel, IDisposable
Constructors
| Improve this Doc View SourceMultiTextBox()
Make a multi-control with text boxes with default settings.
Declaration
public MultiTextBox()
MultiTextBox(Action<TextBox>)
Make a multi-control with text boxes with a callback to init individual textboxes.
Declaration
public MultiTextBox(Action<TextBox> onAddTextBoxCallback)
Parameters
Type | Name | Description |
---|---|---|
Action<TextBox> | onAddTextBoxCallback |
Properties
| Improve this Doc View SourceEnableOutline
Enable outline on all textboxes.
Declaration
public bool EnableOutline { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
HorizontalSpace
Space between textboxes based on total length (range 0-1).
Declaration
public float HorizontalSpace { get; set; }
Property Value
Type | Description |
---|---|
Single |
MaxItemsPerRow
Go to next row when this amount is exceeded. Set to -1 to use a single line.
Declaration
public int MaxItemsPerRow { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
OnAddTextBoxCallback
Set properties to all textboxes.
Declaration
public Action<TextBox> OnAddTextBoxCallback { set; }
Property Value
Type | Description |
---|---|
Action<TextBox> |
Rect
Full rect of control.
Declaration
public Rect Rect { get; set; }
Property Value
Type | Description |
---|---|
Rect |
TextBoxes
All the texboxes used by this control.
Declaration
public TextBox[] TextBoxes { get; }
Property Value
Type | Description |
---|---|
TextBox[] |
VerticalSpace
Space between lines based on total height (range 0-1).
Declaration
public float VerticalSpace { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
| Improve this Doc View SourceDoLayout(Int32, Boolean, NumericMode)
Setup a multi-control with empty text boxes.
Declaration
public void DoLayout(int size, bool isNumeric = false, NumericMode numericMode = NumericMode.Natural)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | Number of textboxes. |
Boolean | isNumeric | Accept only numeric chars. |
NumericMode | numericMode |
DoLayout(Int32[])
Setup a multi-control with text boxes for entering multiple int values.
Declaration
public void DoLayout(params int[] defaultValues)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | defaultValues | Default values in the requested order. |
DoLayout(Single[])
Setup a multi-control with text boxes for entering multiple float values.
Declaration
public void DoLayout(params float[] defaultValues)
Parameters
Type | Name | Description |
---|---|---|
Single[] | defaultValues | Default values in the requested order. |
DoLayout(String[])
Setup a multi-control with text boxes for entering multiple strings.
Declaration
public void DoLayout(params string[] defaultText)
Parameters
Type | Name | Description |
---|---|---|
String[] | defaultText | Default strings in the requested order. |
GetFloatTuple(Int32)
Gets result values from a row of size 2.
Declaration
public Tuple<float, float> GetFloatTuple(int row = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | row |
Returns
Type | Description |
---|---|
Tuple<Single, Single> |
GetFloatValue(Int32)
Gets result value at given index.
Declaration
public float GetFloatValue(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Single |
GetFloatValue(Int32, Int32)
Gets result value at given layout position.
Declaration
public float GetFloatValue(int row, int column)
Parameters
Type | Name | Description |
---|---|---|
Int32 | row | |
Int32 | column |
Returns
Type | Description |
---|---|
Single |
GetFloatValues()
Gets all result values in the layout order.
Declaration
public IEnumerable<float> GetFloatValues()
Returns
Type | Description |
---|---|
IEnumerable<Single> |
GetInput()
Gets all result strings in the layout order.
Declaration
public IEnumerable<string> GetInput()
Returns
Type | Description |
---|---|
IEnumerable<String> |
GetIntTuple(Int32)
Gets result values from a row of size 2.
Declaration
public Tuple<int, int> GetIntTuple(int row = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | row |
Returns
Type | Description |
---|---|
Tuple<Int32, Int32> |
GetIntValue(Int32)
Gets result value at given index.
Declaration
public int GetIntValue(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Int32 |
GetIntValue(Int32, Int32)
Gets result value at given layout position.
Declaration
public int GetIntValue(int row, int column)
Parameters
Type | Name | Description |
---|---|---|
Int32 | row | |
Int32 | column |
Returns
Type | Description |
---|---|
Int32 |
GetIntValues()
Gets all result values in the layout order.
Declaration
public IEnumerable<int> GetIntValues()
Returns
Type | Description |
---|---|
IEnumerable<Int32> |
Make(Rect, Action<MultiTextBox>, Int32, Action<TextBox>)
Helper which makes a multi-control with text boxes using callbacks.
Declaration
public static MultiTextBox Make(Rect rect, Action<MultiTextBox> doLayout, int maxItemsPerRow = -1, Action<TextBox> onAddTextBoxCallback = null)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | Full rect of control. |
Action<MultiTextBox> | doLayout | Call an overload of DoLayout() to set default values and make the layout. |
Int32 | maxItemsPerRow | Number of colums, or -1 to use a single row. |
Action<TextBox> | onAddTextBoxCallback | Set properties to all textboxes. |
Returns
Type | Description |
---|---|
MultiTextBox | A new instance of MultiTextBox |