The '''TextEditor''' component takes in a reference to a [[Component:Text|Text]] or [[Component:TextRenderer|TextRenderer]], and then outputs the result into that reference along with the parameters given and by what actions it should do so.
<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Text|IText|
|Text|IText| The output of where the text is going to be placed at.
|Undo|Bool|
|Undo|Bool| If true, the setting of the text is undoable.
|UndoDescription|String|
|UndoDescription|String| This gets shown on the undo button on the [[Context menu]].
|FinishHandling|FinishAction|
|FinishHandling|'''[[#FinishAction|TextEditor.FinishAction]]'''|TypeAdv3=true| Lets the Text editor know what to do when the user leaves a text input.
|AutoCaretColorField|Bool|
|AutoCaretColorField|Bool| Automatically sets the color of the caret (based on text color).
|CaretColorField|Color|
|CaretColorField|ColorX| Sets the caret color.
|SelectionColorField|Color|
|SelectionColorField|ColorX| Sets the selection color for this caret.
|EditingStarted|WorldDelegate|
|EditingStarted|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]<[[Component:TextEditor|TextEditor]]>}}|TypeAdv7=true| Gives the TextEditor an action when the editing has started.
|EditingChanged|WorldDelegate|
|EditingChanged|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]<[[Component:TextEditor|TextEditor]]>}}|TypeAdv8=true| Gives the TextEditor an action when the editing has changed.
|EditingFinished|WorldDelegate|
|EditingFinished|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]<[[Component:TextEditor|TextEditor]]>}}|TypeAdv9=true| Gives the TextEditor an action when the editing has finished.
|SubmitPressed|WorldDelegate|
|SubmitPressed|{{RootFieldType|SyncDelegate`1|[[Type:Action`1|Action`1]]<[[Component:TextEditor|TextEditor]]>}}|TypeAdv10=true| Gives the TextEditor an action when the editing has been submitted.
}}
}}
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
This component is used in many places, including:
* [[Component:PrimitiveMemberEditor|Primitive Member Editor]] for directly editing [[Component:TextField|TextFields]] (and [[Ref Hacking]])
* [[UIX]] and [[Component:TextField|TextFields]]
* [[Component:FloatTextEditorParser|Parsing floats]] and [[Component:FloatTextEditorParser|parsing ints]]
The TextEditor component takes in a reference to a Text or TextRenderer, and then outputs the result into that reference along with the parameters given and by what actions it should do so.