4 # Text Editor {#text-editor}
8 The Dali::Toolkit::TextEditor is a control which provides a multi-line editable text.
12 Add the text-editor to the stage.
17 TextEditor editor = TextEditor::New();
19 Stage::GetCurrent().Add( editor );
25 var editor = new dali.TextEditor();
27 dali.stage.add( editor );
30 When the TextEditor is tapped, it will automatically gain the keyboard focus. Key events will then result in text being inserted.
31 After text has been entered, it can be retrieved from the TEXT property.
36 Property::Value editorText = editor.GetProperty( TextEditor::Property::TEXT );
37 std::cout << "Received text: " << editorText.Get< std::string >() << std::endl;
43 console.log( editor.text );
48 By default TextEditor will automatically select a suitable font from the platform. However, a different font could be selected. See the [Font Selection](@ref font-selection) section for more details.
52 Mark-up tags can be used to change the style of the text. See the [Mark-up Style](@ref markup-style) section for more details.
56 The input style can be changed through the control properties.See the [Input Style](@ref input-style) section for more details.
60 TextEditor displays a multi-line of text, which will scroll if there is not enough room for the text displayed.
61 If there is enough room, then the text can be aligned horizontally to the beginning, end, or center of the available area:
66 editor.SetProperty( TextEditor::Property::HORIZONTAL_ALIGNMENT, "BEGIN" ); // "CENTER" or "END"
72 editor.HorizontalAlignment = "BEGIN"; // "CENTER" or "END"
75 ### Copy and Paste (Selection)
77 Text can be selected by a long press or double tapping it. See the [Copy and Paste](@ref copy-n-paste) section for more details.
79 ### TextEditor Decorations
83 To change the color of the text, the recommended way is to use the TEXT_COLOR property.
87 editor.SetProperty( TextEditor::Property::TEXT_COLOR, Color::CYAN );
93 editor.textColor = dali.COLOR_CYAN;
96 ### TextEditor Properties
98 Name (JavaScript) | Name (C++) | Type | Writable | Animatable
99 -----------------------------------|--------------------------------------|--------------|--------------|-----------
100 renderingBackend | RENDERING_BACKEND | INTEGER | O | X
101 text | TEXT | STRING | O | X
102 textColor | TEXT_COLOR | VECTOR4 | O | X
103 fontFamily | FONT_FAMILY | STRING | O | X
104 fontStyle | FONT_STYLE | STRING | O | X
105 pointSize | POINT_SIZE | FLOAT | O | X
106 horizontalAlignment | HORIZONTAL_ALIGNMENT | STRING | O | X
107 verticalAlignment | VERTICAL_ALIGNMENT | STRING | O | X
108 scrollThreshold | SCROLL_THRESHOLD | FLOAT | O | X
109 scrollSpeed | SCROLL_SPEED | FLOAT | O | X
110 primaryCursorColor | PRIMARY_CURSOR_COLOR | VECTOR4 | O | X
111 secondaryCursorColor | SECONDARY_CURSOR_COLOR | VECTOR4 | O | X
112 enableCursorBlink | ENABLE_CURSOR_BLINK | BOOLEAN | O | X
113 cursorBlinkInterval | CURSOR_BLINK_INTERVAL | FLOAT | O | X
114 cursorBlinkDuration | CURSOR_BLINK_DURATION | FLOAT | O | X
115 cursorWidth | CURSOR_WIDTH | INTEGER | O | X
116 grabHandleImage | GRAB_HANDLE_IMAGE | STRING | O | X
117 grabHandlePressedImage | GRAB_HANDLE_PRESSED_IMAGE | STRING | O | X
118 selectionHandleImageLeft | SELECTION_HANDLE_IMAGE_LEFT | STRING | O | X
119 selectionHandleImageRight | SELECTION_HANDLE_IMAGE_RIGHT | STRING | O | X
120 selectionHandlePressedImageLeft | SELECTION_HANDLE_PRESSED_IMAGE_LEFT | STRING | O | X
121 selectionHandlePressedImageRight | SELECTION_HANDLE_PRESSED_IMAGE_RIGHT | STRING | O | X
122 selectionHandleMarkerImageLeft | SELECTION_HANDLE_MARKER_IMAGE_LEFT | MAP | O | X
123 selectionHandleMarkerImageRight | SELECTION_HANDLE_MARKER_IMAGE_RIGHT | MAP | O | X
124 selectionHighlightColor | SELECTION_HIGHLIGHT_COLOR | VECTOR4 | O | X
125 decorationBoundingBox | DECORATION_BOUNDING_BOX | RECTANGLE | O | X
126 enableMarkup | ENABLE_MARKUP | BOOLEAN | O | X
127 inputColor | INPUT_COLOR | VECTOR4 | O | X
128 inputFontFamily | INPUT_FONT_FAMILY | STRING | O | X
129 inputFontStyle | INPUT_FONT_STYLE | STRING | O | X
130 inputPointSize | INPUT_POINT_SIZE | FLOAT | O | X
131 lineSpacing | LINE_SPACING | FLOAT | O | X
132 inputLineSpacing | INPUT_LINE_SPACING | FLOAT | O | X
133 underline | UNDERLINE | STRING | O | X
134 inputUnderline | INPUT_UNDERLINE | STRING | O | X
135 shadow | SHADOW | STRING | O | X
136 inputShadow | INPUT_SHADOW | STRING | O | X
137 emboss | EMBOSS | STRING | O | X
138 inputEmboss | INPUT_EMBOSS | STRING | O | X
139 outline | OUTLINE | STRING | O | X
140 inputOutline | INPUT_OUTLINE | STRING | O | X