Class TextField
Definition
- Namespace:
- Tizen.NUI.BaseComponents
- Assembly:
- Tizen.NUI.dll
A control which provides a single line editable text field.
public class TextField : View, INotifyPropertyChanged, IDisposable
- Inheritance
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
Constructors
View SourceTextField()
Creates the TextField control.
Declaration
public TextField()
Properties
View SourceCursorBlinkDuration
The CursorBlinkDuration property.
Declaration
public float CursorBlinkDuration { get; set; }
Property Value
Type | Description |
---|---|
float |
CursorBlinkInterval
The CursorBlinkInterval property.
Declaration
public float CursorBlinkInterval { get; set; }
Property Value
Type | Description |
---|---|
float |
CursorWidth
The CursorWidth property.
Declaration
public int CursorWidth { get; set; }
Property Value
Type | Description |
---|---|
int |
DecorationBoundingBox
The DecorationBoundingBox property.
Declaration
public Rectangle DecorationBoundingBox { get; set; }
Property Value
Type | Description |
---|---|
Rectangle |
Remarks
The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
Ellipsis
The Ellipsis property.
Enable or disable the ellipsis.
Placeholder PropertyMap is used to add ellipsis to placeholder text.
Declaration
public bool Ellipsis { get; set; }
Property Value
Type | Description |
---|---|
bool |
EllipsisPosition
The ellipsis position of the text.
Specifies which portion of the text should be replaced with an ellipsis when the text size exceeds the layout size.
Declaration
public EllipsisPosition EllipsisPosition { get; set; }
Property Value
Type | Description |
---|---|
EllipsisPosition |
Emboss
The Emboss property.
Declaration
public string Emboss { get; set; }
Property Value
Type | Description |
---|---|
string |
EnableCursorBlink
The EnableCursorBlink property.
Declaration
public bool EnableCursorBlink { get; set; }
Property Value
Type | Description |
---|---|
bool |
EnableMarkup
The EnableMarkup property.
Declaration
public bool EnableMarkup { get; set; }
Property Value
Type | Description |
---|---|
bool |
EnableSelection
The Enable selection property.
Declaration
public bool EnableSelection { get; set; }
Property Value
Type | Description |
---|---|
bool |
ExceedPolicy
The ExceedPolicy property.
Declaration
public int ExceedPolicy { get; set; }
Property Value
Type | Description |
---|---|
int |
FontFamily
The FontFamily property.
Declaration
public string FontFamily { get; set; }
Property Value
Type | Description |
---|---|
string |
FontSizeScale
The FontSizeScale property.
The default value is 1.0.
If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally.
Declaration
public float FontSizeScale { get; set; }
Property Value
Type | Description |
---|---|
float |
FontStyle
The FontStyle property.
The fontStyle map contains the following keys :
width (string) | The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded) |
weight (string) | The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack) |
slant (string) | The slant key defines whether to use italics. (values: normal, roman, italic, oblique) |
Declaration
public PropertyMap FontStyle { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
GrabHandleImage
The GrabHandleImage property.
Declaration
public string GrabHandleImage { get; set; }
Property Value
Type | Description |
---|---|
string |
GrabHandlePressedImage
The GrabHandlePressedImage property.
Declaration
public string GrabHandlePressedImage { get; set; }
Property Value
Type | Description |
---|---|
string |
HiddenInputSettings
The HiddenInputSettings property.
The hiddenInputSettings map contains the following keys :
HiddenInputProperty.Mode (int) | The mode for input text display (Use HiddenInputModeType) |
HiddenInputProperty.SubstituteCharacter (int) | All input characters are substituted by this character |
HiddenInputProperty.SubstituteCount (int) | Length of text to show or hide, available when HideCount/ShowCount mode is used |
HiddenInputProperty.ShowLastCharacterDuration (int) | Hide last character after this duration, available when ShowLastCharacter mode |
Declaration
public PropertyMap HiddenInputSettings { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
Remarks
See HiddenInputProperty and HiddenInputModeType for a detailed description.
Examples
The following example demonstrates how to set the HiddenInputSettings property.
PropertyMap map = new PropertyMap();
map.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter));
map.Add(HiddenInputProperty.ShowLastCharacterDuration, new PropertyValue(500));
map.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x2A));
textField.HiddenInputSettings = map;
View Source
HorizontalAlignment
The HorizontalAlignment property.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Type | Description |
---|---|
HorizontalAlignment |
InputColor
The InputColor property.
Declaration
public Vector4 InputColor { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
Remarks
The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
InputEmboss
The InputEmboss property.
Declaration
public string InputEmboss { get; set; }
Property Value
Type | Description |
---|---|
string |
InputFontFamily
The InputFontFamily property.
Declaration
public string InputFontFamily { get; set; }
Property Value
Type | Description |
---|---|
string |
InputFontStyle
The InputFontStyle property.
The inputFontStyle map contains the following keys :
width (string) | The width key defines occupied by each glyph. (values: ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded) |
weight (string) | The weight key defines the thickness or darkness of the glyphs. (values: thin, ultraLight, extraLight, light, demiLight, semiLight, book, normal, regular, medium, demiBold, semiBold, bold, ultraBold, extraBold, black, heavy, extraBlack) |
slant (string) | The slant key defines whether to use italics. (values: normal, roman, italic, oblique) |
Declaration
public PropertyMap InputFontStyle { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
InputMethodSettings
The InputMethodSettings property.
Declaration
public PropertyMap InputMethodSettings { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
Remarks
InputMethod is a class encapsulating the input method map. Use the InputMethod class for this property.
Examples
The following example demonstrates how to set the InputMethodSettings property.
InputMethod method = new InputMethod();
method.PanelLayout = InputMethod.PanelLayoutType.Normal;
method.ActionButton = InputMethod.ActionButtonTitleType.Default;
method.AutoCapital = InputMethod.AutoCapitalType.Word;
method.Variation = 1;
textField.InputMethodSettings = method.OutputMap;
View Source
InputOutline
The InputOutline property.
Declaration
public string InputOutline { get; set; }
Property Value
Type | Description |
---|---|
string |
InputPointSize
The InputPointSize property.
Declaration
public float InputPointSize { get; set; }
Property Value
Type | Description |
---|---|
float |
InputShadow
The InputShadow property.
Declaration
public string InputShadow { get; set; }
Property Value
Type | Description |
---|---|
string |
InputUnderline
The InputUnderline property.
Declaration
public string InputUnderline { get; set; }
Property Value
Type | Description |
---|---|
string |
MatchSystemLanguageDirection
The text alignment to match the direction of the system language.
Declaration
public bool MatchSystemLanguageDirection { get; set; }
Property Value
Type | Description |
---|---|
bool |
MaxLength
The MaxLength property.
Declaration
public int MaxLength { get; set; }
Property Value
Type | Description |
---|---|
int |
Outline
The Outline property.
The outline map contains the following keys :
color (Color) | The color of the outline (the default color is Color.White) |
width (float) | The width in pixels of the outline (If not provided then the outline is not enabled) |
Declaration
public PropertyMap Outline { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
PixelSize
The PixelSize property.
Declaration
public float PixelSize { get; set; }
Property Value
Type | Description |
---|---|
float |
Placeholder
The Placeholder property.
The placeholder map contains the following keys :
text (string) | The text to display when the TextField is empty and inactive |
textFocused (string) | The text to display when the placeholder has focus |
color (Color) | The color of the placeholder text |
fontFamily (string) | The fontFamily of the placeholder text |
fontStyle (PropertyMap) | The fontStyle of the placeholder text |
pointSize (float) | The pointSize of the placeholder text |
pixelSize (float) | The pixelSize of the placeholder text |
ellipsis (bool) | The ellipsis of the placeholder text |
Declaration
public PropertyMap Placeholder { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
Examples
The following example demonstrates how to set the Placeholder property.
PropertyMap propertyMap = new PropertyMap();
propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
propertyMap.Add("color", new PropertyValue(Color.Red));
propertyMap.Add("fontFamily", new PropertyValue("Arial"));
propertyMap.Add("pointSize", new PropertyValue(12.0f));
PropertyMap fontStyleMap = new PropertyMap();
fontStyleMap.Add("weight", new PropertyValue("bold"));
fontStyleMap.Add("width", new PropertyValue("condensed"));
fontStyleMap.Add("slant", new PropertyValue("italic"));
propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
TextField field = new TextField();
field.Placeholder = propertyMap;
View Source
PlaceholderText
The PlaceholderText property.
Declaration
public string PlaceholderText { get; set; }
Property Value
Type | Description |
---|---|
string |
PlaceholderTextColor
The PlaceholderTextColor property.
Declaration
public Vector4 PlaceholderTextColor { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
Remarks
The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
PlaceholderTextFocused
The PlaceholderTextFocused property.
Declaration
public string PlaceholderTextFocused { get; set; }
Property Value
Type | Description |
---|---|
string |
PointSize
The PointSize property.
Declaration
public float PointSize { get; set; }
Property Value
Type | Description |
---|---|
float |
PrimaryCursorColor
The PrimaryCursorColor property.
Declaration
public Vector4 PrimaryCursorColor { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
Remarks
The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
ScrollSpeed
The ScrollSpeed property.
Declaration
public float ScrollSpeed { get; set; }
Property Value
Type | Description |
---|---|
float |
ScrollThreshold
The ScrollThreshold property.
Declaration
public float ScrollThreshold { get; set; }
Property Value
Type | Description |
---|---|
float |
SecondaryCursorColor
The SecondaryCursorColor property.
Declaration
public Vector4 SecondaryCursorColor { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
Remarks
The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
SelectedText
The portion of the text that has been selected by the user.
Declaration
public string SelectedText { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
Empty string when nothing is selected.
SelectedTextEnd
The end index for selection.
Declaration
public int SelectedTextEnd { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
When there is no selection, the index is current cursor position.
SelectedTextStart
The start index for selection.
Declaration
public int SelectedTextStart { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
When there is no selection, the index is current cursor position.
SelectionHandleImageLeft
The SelectionHandleImageLeft property.
The selectionHandleImageLeft map contains the following key :
filename (string) | The path of image file |
Declaration
public PropertyMap SelectionHandleImageLeft { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
SelectionHandleImageRight
The SelectionHandleImageRight property.
The selectionHandleImageRight map contains the following key :
filename (string) | The path of image file |
Declaration
public PropertyMap SelectionHandleImageRight { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
SelectionHandleMarkerImageLeft
The SelectionHandleMarkerImageLeft property.
The selectionHandleMarkerImageLeft map contains the following key :
filename (string) | The path of image file |
Declaration
public PropertyMap SelectionHandleMarkerImageLeft { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
SelectionHandleMarkerImageRight
The SelectionHandleMarkerImageRight property.
The selectionHandleMarkerImageRight map contains the following key :
filename (string) | The path of image file |
Declaration
public PropertyMap SelectionHandleMarkerImageRight { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
SelectionHandlePressedImageLeft
The SelectionHandlePressedImageLeft property.
The selectionHandlePressedImageLeft map contains the following key :
filename (string) | The path of image file |
Declaration
public PropertyMap SelectionHandlePressedImageLeft { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
SelectionHandlePressedImageRight
The SelectionHandlePressedImageRight property.
The selectionHandlePressedImageRight map contains the following key :
filename (string) | The path of image file |
Declaration
public PropertyMap SelectionHandlePressedImageRight { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
SelectionHighlightColor
The SelectionHighlightColor property.
Declaration
public Vector4 SelectionHighlightColor { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
Remarks
The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
Shadow
The Shadow property.
The shadow map contains the following keys :
color (Color) | The color of the shadow (the default color is Color.Black) |
offset (Vector2) | The offset in pixels of the shadow (If not provided then the shadow is not enabled) |
blurRadius (float) | The radius of the Gaussian blur for the soft shadow (If not provided then the soft shadow is not enabled) |
Declaration
public PropertyMap Shadow { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
ShadowColor
The ShadowColor property.
Declaration
[Obsolete("Do not use this ShadowColor(Deprecated). Use Shadow instead.")]
public Vector4 ShadowColor { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
Remarks
Deprecated.(API Level 6) Use Shadow instead. The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
ShadowOffset
The ShadowOffset property.
Declaration
[Obsolete("Do not use this ShadowOffset(Deprecated). Use Shadow instead.")]
public Vector2 ShadowOffset { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
Remarks
Deprecated.(API Level 6) Use Shadow instead. The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
Text
The Text property.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
string |
TextColor
The TextColor property.
Declaration
public Color TextColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Remarks
The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
TranslatablePlaceholderText
The TranslatablePlaceholderText property.
The text can set the SID value.
Declaration
public string TranslatablePlaceholderText { get; set; }
Property Value
Type | Description |
---|---|
string |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | ResourceManager about multilingual is null. |
TranslatableText
The TranslatableText property.
The text can set the SID value.
Declaration
public string TranslatableText { get; set; }
Property Value
Type | Description |
---|---|
string |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | ResourceManager about multilingual is null. |
Underline
The Underline property.
The underline map contains the following keys :
enable (bool) | Whether the underline is enabled (the default value is false) |
color (Color) | The color of the underline (If not provided then the color of the text is used) |
height (float) | The height in pixels of the underline (the default value is 1.f) |
Declaration
public PropertyMap Underline { get; set; }
Property Value
Type | Description |
---|---|
PropertyMap |
VerticalAlignment
The VerticalAlignment property.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
VerticalAlignment |
Methods
View SourceDispose(DisposeTypes)
Dispose.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type |
Overrides
View SourceGetInputFilter()
Get InputFilter from TextField.
Declaration
public InputFilter GetInputFilter()
Returns
Type | Description |
---|---|
InputFilter | The InputFilter |
Remarks
View SourceGetInputMethodContext()
Get the InputMethodContext instance.
Declaration
public InputMethodContext GetInputMethodContext()
Returns
Type | Description |
---|---|
InputMethodContext | The InputMethodContext instance. |
SelectNone()
Clear selection of the text.
Valid when selection is activate.
Declaration
public void SelectNone()
SelectText(int, int)
Select text from start to end index.
The index is valid when 0 or positive.
Declaration
public void SelectText(int start, int end)
Parameters
Type | Name | Description |
---|---|---|
int | start | The start index for selection. |
int | end | The end index for selection. |
Remarks
If the end index exceeds the maximum value, it is set to the length of the text.
SelectWholeText()
Select the whole text.
Declaration
public void SelectWholeText()
SetInputFilter(InputFilter)
Set InputFilter to TextField.
Declaration
public void SetInputFilter(InputFilter inputFilter)
Parameters
Type | Name | Description |
---|---|---|
InputFilter | inputFilter | The InputFilter |
Remarks
InputFilter filters input based on regular expressions.
InputFiltered signal is emitted when the input is filtered by InputFilter
See InputFiltered, InputFilterType and InputFilteredEventArgs for a detailed description.
Examples
The following example demonstrates how to use the SetInputFilter method.
var inputFilter = new Tizen.NUI.Text.InputFilter();
inputFilter.Accepted = @"[\d]"; // accept whole digits
inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3
field.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
Events
View SourceAnchorClicked
The AnchorClicked signal is emitted when the anchor is clicked.
Declaration
public event EventHandler<AnchorClickedEventArgs> AnchorClicked
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><AnchorClickedEventArgs> |
CursorPositionChanged
The CursorPositionChanged event is emitted whenever the primary cursor position changed.
Declaration
public event EventHandler CursorPositionChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
InputFiltered
The InputFiltered signal is emitted when the input is filtered by InputFilter.
Declaration
public event EventHandler<InputFilteredEventArgs> InputFiltered
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><InputFilteredEventArgs> |
Remarks
See InputFilterType and InputFilteredEventArgs for a detailed description.
Examples
The following example demonstrates how to use the InputFiltered event.
field.InputFiltered += (s, e) =>
{
if (e.Type == InputFilterType.Accept)
{
// If input is filtered by InputFilter of Accept type.
}
else if (e.Type == InputFilterType.Reject)
{
// If input is filtered by InputFilter of Reject type.
}
};
View Source
MaxLengthReached
The MaxLengthReached event.
Declaration
public event EventHandler<TextField.MaxLengthReachedEventArgs> MaxLengthReached
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><TextField.MaxLengthReachedEventArgs> |
SelectionChanged
The SelectionChanged signal is emitted whenever the selected text changed.
Declaration
public event EventHandler SelectionChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
SelectionCleared
The SelectionCleared signal is emitted when selection is cleared.
Declaration
public event EventHandler SelectionCleared
Event Type
Type | Description |
---|---|
System.EventHandler |
TextChanged
The TextChanged event.
Declaration
public event EventHandler<TextField.TextChangedEventArgs> TextChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><TextField.TextChangedEventArgs> |