Class TextEditor

Definition

Namespace:
Tizen.NUI.BaseComponents
Assembly:
Tizen.NUI.dll
API Level:
3

A control which provides a multi-line editable text editor.

C#
Copy
public class TextEditor : View, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable, IResourcesProvider
Inheritance
System.Object
Tizen.NUI.Binding.Element
TextEditor
Implements
System.ComponentModel.INotifyPropertyChanged
System.IDisposable

Constructors

View Source

TextEditor()

Creates the TextEditor control.

Declaration
C#
Copy
public TextEditor()
API Level: 3

Properties

View Source

CursorBlinkDuration

The CursorBlinkDuration property.
The cursor will stop blinking after this number of seconds (if non-zero).

Declaration
C#
Copy
public float CursorBlinkDuration { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

CursorBlinkInterval

The CursorBlinkInterval property.
The time interval in seconds between cursor on/off states.

Declaration
C#
Copy
public float CursorBlinkInterval { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

CursorWidth

The CursorWidth property.

Declaration
C#
Copy
public int CursorWidth { get; set; }
Property Value
Type Description
Int32
API Level: 3
View Source

DecorationBoundingBox

The DecorationBoundingBox property.
The decorations (handles etc) will positioned within this area on-screen.

Declaration
C#
Copy
public Rectangle DecorationBoundingBox { get; set; }
Property Value
Type Description
Rectangle
Remarks

The property cascade chaining set is possible. For example, this (textEditor.DecorationBoundingBox.X = 1;) is possible.

API Level: 3
View Source

Ellipsis

The Ellipsis property.
Enable or disable the ellipsis.

Declaration
C#
Copy
public bool Ellipsis { get; set; }
Property Value
Type Description
Boolean
API Level: 9
View Source

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
C#
Copy
public EllipsisPosition EllipsisPosition { get; set; }
Property Value
Type Description
EllipsisPosition
API Level: 9
View Source

Emboss

The Emboss property.
The default emboss parameters.

Declaration
C#
Copy
public string Emboss { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

The EnableCursorBlink property.
Whether the cursor should blink or not.

Declaration
C#
Copy
public bool EnableCursorBlink { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

EnableMarkup

The EnableMarkup property.
Whether the mark-up processing is enabled.

Declaration
C#
Copy
public bool EnableMarkup { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

EnableScrollBar

The EnableScrollBar property.
Enable or disable the scroll bar.

Declaration
C#
Copy
public bool EnableScrollBar { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

EnableSelection

The Enable selection property.
Enables Text selection, such as the cursor, handle, clipboard, and highlight color.

Declaration
C#
Copy
public bool EnableSelection { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

FontFamily

The FontFamily property.
The requested font family to use.

Declaration
C#
Copy
public string FontFamily { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

FontSizeScale

The FontSizeScale property.
The default value is 1.0.
The given font size scale value is used for multiplying the specified font size before querying fonts.
If FontSizeScale.UseSystemSetting, will use the SystemSettings.FontSize internally.

Declaration
C#
Copy
public float FontSizeScale { get; set; }
Property Value
Type Description
System.Single
API Level: 9
View Source

FontStyle

The FontStyle property.
The requested font style to use.
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
C#
Copy
public PropertyMap FontStyle { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

GrabHandleImage

The GrabHandleImage property.
The image to display for the grab handle.

Declaration
C#
Copy
public string GrabHandleImage { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

GrabHandlePressedImage

The GrabHandlePressedImage property.
The image to display when the grab handle is pressed.

Declaration
C#
Copy
public string GrabHandlePressedImage { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

HorizontalAlignment

The HorizontalAlignment property.
The line horizontal alignment.

Declaration
C#
Copy
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Type Description
HorizontalAlignment
API Level: 3
View Source

InputColor

The InputColor property.
The color of the new input text.

Declaration
C#
Copy
public Vector4 InputColor { get; set; }
Property Value
Type Description
Vector4
Remarks

The property cascade chaining set is possible. For example, this (textEditor.InputColor.X = 0.1f;) is possible.

API Level: 3
View Source

InputEmboss

The InputEmboss property.
The emboss parameters of the new input text.

Declaration
C#
Copy
public string InputEmboss { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

InputFontFamily

The InputFontFamily property.
The font's family of the new input text.

Declaration
C#
Copy
public string InputFontFamily { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

InputFontStyle

The InputFontStyle property.
The font's style of the new input text.
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
C#
Copy
public PropertyMap InputFontStyle { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

InputLineSpacing

The InputLineSpacing property.
The extra space between lines in points.

Declaration
C#
Copy
public float InputLineSpacing { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

InputOutline

The InputOutline property.
The outline parameters of the new input text.

Declaration
C#
Copy
public string InputOutline { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

InputPointSize

The InputPointSize property.
The font's size of the new input text in points.

Declaration
C#
Copy
public float InputPointSize { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

InputShadow

The InputShadow property.
The shadow parameters of the new input text.

Declaration
C#
Copy
public string InputShadow { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

InputUnderline

The InputUnderline property.
The underline parameters of the new input text.

Declaration
C#
Copy
public string InputUnderline { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

LineCount

The line count of the text.

Declaration
C#
Copy
public int LineCount { get; }
Property Value
Type Description
Int32
API Level: 3
View Source

LineSpacing

The LineSpacing property.
The default extra space between lines in points.

Declaration
C#
Copy
public float LineSpacing { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

LineWrapMode

The LineWrapMode property.
The line wrap mode when the text lines over the layout width.

Declaration
C#
Copy
public LineWrapMode LineWrapMode { get; set; }
Property Value
Type Description
LineWrapMode
API Level: 4
View Source

MatchSystemLanguageDirection

The text alignment to match the direction of the system language.

Declaration
C#
Copy
public bool MatchSystemLanguageDirection { get; set; }
Property Value
Type Description
Boolean
API Level: 6
View Source

Outline

The Outline property.
The default outline parameters.
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
C#
Copy
public PropertyMap Outline { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

PixelSize

The PixelSize property.
The size of font in pixels.

Declaration
C#
Copy
public float PixelSize { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

Placeholder

The Placeholder property. The placeholder map contains the following keys :

text (string)The text to display when the TextEditor 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
C#
Copy
public PropertyMap Placeholder { get; set; }
Property Value
Type Description
PropertyMap
Examples

The following example demonstrates how to set the placeholder property.

Copy
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)); TextEditor editor = new TextEditor(); editor.Placeholder = propertyMap;
API Level: 3
View Source

PlaceholderText

The text to display when the TextEditor is empty and inactive.

Declaration
C#
Copy
public string PlaceholderText { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

PlaceholderTextColor

The Placeholder text color.

Declaration
C#
Copy
public Color PlaceholderTextColor { get; set; }
Property Value
Type Description
Color
Remarks

The property cascade chaining set is possible. For example, this (textEditor.PlaceholderTextColor.X = 0.1f;) is possible.

API Level: 3
View Source

PointSize

The PointSize property.
The size of font in points.

Declaration
C#
Copy
public float PointSize { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

PrimaryCursorColor

The PrimaryCursorColor property.
The color to apply to the primary cursor.

Declaration
C#
Copy
public Vector4 PrimaryCursorColor { get; set; }
Property Value
Type Description
Vector4
Remarks

The property cascade chaining set is possible. For example, this (textEditor.PrimaryCursorColor.X = 0.1f;) is possible.

API Level: 3
View Source

PrimaryCursorPosition

PrimaryCursorPosition property.
Specify the position of the primary cursor (caret) in text control.

Declaration
C#
Copy
public int PrimaryCursorPosition { get; set; }
Property Value
Type Description
Int32
Remarks

If the value set is out of range (negative or greater than or equal the number of characters in Text) then the PrimaryCursorPosition is moved to the end of Text (the number of characters in Text).

API Level: 10
View Source

ScrollBarFadeDuration

The ScrollBarFadeDuration property.
Sets the duration of scroll bar to fade out.

Declaration
C#
Copy
public float ScrollBarFadeDuration { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

ScrollBarShowDuration

The ScrollBarShowDuration property.
Sets the duration of scroll bar to show.

Declaration
C#
Copy
public float ScrollBarShowDuration { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

ScrollSpeed

The ScrollSpeed property.
The scroll speed in pixels per second.

Declaration
C#
Copy
public float ScrollSpeed { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

ScrollThreshold

The ScrollThreshold property.
Horizontal scrolling will occur if the cursor is this close to the control border.

Declaration
C#
Copy
public float ScrollThreshold { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

SecondaryCursorColor

The SecondaryCursorColor property.
The color to apply to the secondary cursor.

Declaration
C#
Copy
public Vector4 SecondaryCursorColor { get; set; }
Property Value
Type Description
Vector4
Remarks

The property cascade chaining set is possible. For example, this (textEditor.SecondaryCursorColor.X = 0.1f;) is possible.

API Level: 3
View Source

SelectedText

The portion of the text that has been selected by the user.

Declaration
C#
Copy
public string SelectedText { get; }
Property Value
Type Description
System.String
Remarks

Empty string when nothing is selected.

API Level: 9
View Source

SelectedTextEnd

The end index for selection.

Declaration
C#
Copy
public int SelectedTextEnd { get; }
Property Value
Type Description
Int32
Remarks

When there is no selection, the index is current cursor position.

API Level: 9
View Source

SelectedTextStart

The start index for selection.

Declaration
C#
Copy
public int SelectedTextStart { get; }
Property Value
Type Description
Int32
Remarks

When there is no selection, the index is current cursor position.

API Level: 9
View Source

SelectionHandleImageLeft

The SelectionHandleImageLeft property.
The image to display for the left selection handle.
The selectionHandleImageLeft map contains the following key :

filename (string)The path of image file

Declaration
C#
Copy
public PropertyMap SelectionHandleImageLeft { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

SelectionHandleImageRight

The SelectionHandleImageRight property.
The image to display for the right selection handle.
The selectionHandleImageRight map contains the following key :

filename (string)The path of image file

Declaration
C#
Copy
public PropertyMap SelectionHandleImageRight { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

SelectionHandleMarkerImageLeft

The SelectionHandleMarkerImageLeft property.
The image to display for the left selection handle marker.
The selectionHandleMarkerImageLeft map contains the following key :

filename (string)The path of image file

Declaration
C#
Copy
public PropertyMap SelectionHandleMarkerImageLeft { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

SelectionHandleMarkerImageRight

The SelectionHandleMarkerImageRight property.
The image to display for the right selection handle marker.
The selectionHandleMarkerImageRight map contains the following key :

filename (string)The path of image file

Declaration
C#
Copy
public PropertyMap SelectionHandleMarkerImageRight { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

SelectionHandlePressedImageLeft

The SelectionHandlePressedImageLeft property.
The image to display when the left selection handle is pressed.
The selectionHandlePressedImageLeft map contains the following key :

filename (string)The path of image file

Declaration
C#
Copy
public PropertyMap SelectionHandlePressedImageLeft { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

SelectionHandlePressedImageRight

The SelectionHandlePressedImageRight property.
The image to display when the right selection handle is pressed.
The selectionHandlePressedImageRight map contains the following key :

filename (string)The path of image file

Declaration
C#
Copy
public PropertyMap SelectionHandlePressedImageRight { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

SelectionHighlightColor

The SelectionHighlightColor property.
The color of the selection highlight.

Declaration
C#
Copy
public Vector4 SelectionHighlightColor { get; set; }
Property Value
Type Description
Vector4
Remarks

The property cascade chaining set is possible. For example, this (textEditor.SelectionHighlightColor.X = 0.1f;) is possible.

API Level: 3
View Source

Shadow

The Shadow property.
The default shadow parameters.
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
C#
Copy
public PropertyMap Shadow { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3
View Source

SmoothScroll

The SmoothScroll property.
Enable or disable the smooth scroll animation.

Declaration
C#
Copy
public bool SmoothScroll { get; set; }
Property Value
Type Description
Boolean
API Level: 3
View Source

SmoothScrollDuration

The SmoothScrollDuration property.
Sets the duration of smooth scroll animation.

Declaration
C#
Copy
public float SmoothScrollDuration { get; set; }
Property Value
Type Description
System.Single
API Level: 3
View Source

Text

The Text property.
The text to display in the UTF-8 format.

Declaration
C#
Copy
public string Text { get; set; }
Property Value
Type Description
System.String
API Level: 3
View Source

TextColor

The TextColor property.
The color of the text.

Declaration
C#
Copy
public Vector4 TextColor { get; set; }
Property Value
Type Description
Vector4
Remarks

The property cascade chaining set is possible. For example, this (textEditor.TextColor.X = 0.1f;) is possible.

API Level: 3
View Source

TranslatablePlaceholderText

The TranslatablePlaceholderText property.
The text can set the SID value.

Declaration
C#
Copy
public string TranslatablePlaceholderText { get; set; }
Property Value
Type Description
System.String
Exceptions
Type Condition
System.ArgumentNullException

ResourceManager about multilingual is null.

API Level: 4
View Source

TranslatableText

The TranslatableText property.
The text can set the SID value.

Declaration
C#
Copy
public string TranslatableText { get; set; }
Property Value
Type Description
System.String
Exceptions
Type Condition
System.ArgumentNullException

ResourceManager about multilingual is null.

API Level: 4
View Source

Underline

The Underline property.
The default underline parameters.
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
C#
Copy
public PropertyMap Underline { get; set; }
Property Value
Type Description
PropertyMap
API Level: 3

Methods

View Source

Dispose(DisposeTypes)

Dispose.

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type
Overrides
API Level: 3
View Source

GetInputFilter()

Get InputFilter from TextEditor.

Declaration
C#
Copy
public InputFilter GetInputFilter()
Returns
Type Description
InputFilter

The InputFilter

Remarks
API Level: 9
View Source

GetInputMethodContext()

Get the InputMethodContext instance.

Declaration
C#
Copy
public InputMethodContext GetInputMethodContext()
Returns
Type Description
InputMethodContext

The InputMethodContext instance.

API Level: 5
View Source

SelectNone()

Clear selection of the text.
Valid when selection is activate.

Declaration
C#
Copy
public void SelectNone()
API Level: 9
View Source

SelectText(Int32, Int32)

Select text from start to end index.
The index is valid when 0 or positive.

Declaration
C#
Copy
public void SelectText(int start, int end)
Parameters
Type Name Description
Int32 start

The start index for selection.

Int32 end

The end index for selection.

Remarks

If the end index exceeds the maximum value, it is set to the length of the text.

API Level: 9
View Source

SelectWholeText()

Select the whole text.

Declaration
C#
Copy
public void SelectWholeText()
API Level: 9
View Source

SetInputFilter(InputFilter)

Set InputFilter to TextEditor.

Declaration
C#
Copy
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.

Copy
var inputFilter = new Tizen.NUI.Text.InputFilter(); inputFilter.Accepted = @"[\d]"; // accept whole digits inputFilter.Rejected = "[0-3]"; // reject 0, 1, 2, 3 editor.SetInputFilter(inputFilter); // acceptable inputs are 4, 5, 6, 7, 8, 9
API Level: 9

Events

View Source

AnchorClicked

The AnchorClicked signal is emitted when the anchor is clicked.

Declaration
C#
Copy
public event EventHandler<AnchorClickedEventArgs> AnchorClicked
Event Type
Type Description
System.EventHandler<AnchorClickedEventArgs>
API Level: 9
View Source

CursorPositionChanged

The CursorPositionChanged event is emitted whenever the primary cursor position changed.

Declaration
C#
Copy
public event EventHandler CursorPositionChanged
Event Type
Type Description
System.EventHandler
API Level: 9
View Source

InputFiltered

The InputFiltered signal is emitted when the input is filtered by InputFilter.

Declaration
C#
Copy
public event EventHandler<InputFilteredEventArgs> InputFiltered
Event Type
Type Description
System.EventHandler<InputFilteredEventArgs>
Remarks

See InputFilterType and InputFilteredEventArgs for a detailed description.

Examples

The following example demonstrates how to use the InputFiltered event.

Copy
editor.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. } };
API Level: 9
View Source

ScrollStateChanged

Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.

Declaration
C#
Copy
public event EventHandler<TextEditor.ScrollStateChangedEventArgs> ScrollStateChanged
Event Type
Type Description
System.EventHandler<TextEditor.ScrollStateChangedEventArgs>
API Level: 3
View Source

SelectionChanged

The SelectionChanged event is emitted whenever the selected text is changed.

Declaration
C#
Copy
public event EventHandler SelectionChanged
Event Type
Type Description
System.EventHandler
API Level: 9
View Source

SelectionCleared

The SelectionCleared signal is emitted when selection is cleared.

Declaration
C#
Copy
public event EventHandler SelectionCleared
Event Type
Type Description
System.EventHandler
API Level: 9
View Source

SelectionStarted

The SelectionStarted event is emitted when the selection has been started.

Declaration
C#
Copy
public event EventHandler SelectionStarted
Event Type
Type Description
System.EventHandler
API Level: 10
View Source

TextChanged

An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler provided by the user. The TextChanged signal is emitted when the text changes.

Declaration
C#
Copy
public event EventHandler<TextEditor.TextChangedEventArgs> TextChanged
Event Type
Type Description
System.EventHandler<TextEditor.TextChangedEventArgs>
API Level: 3

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable