internal TextInputBase()
            {
                isReadOnly = false;
                focusable  = true;

                AddToClassList(inputUssClassName);
                m_Text = string.Empty;
                name   = TextField.textInputUssName;

                requireMeasureFunction = true;

                editorEngine = new TextEditorEngine(OnDetectFocusChange, OnCursorIndexChange);

                if (touchScreenTextField)
                {
                    editorEventHandler = new TouchScreenTextEditorEventHandler(editorEngine, this);
                }
                else
                {
                    // TODO: Default values should come from GUI.skin.settings
                    doubleClickSelectsWord = true;
                    tripleClickSelectsLine = true;

                    editorEventHandler = new KeyboardTextEditorEventHandler(editorEngine, this);
                }

                // Make the editor style unique across all textfields
                editorEngine.style = new GUIStyle(editorEngine.style);

                RegisterCallback <CustomStyleResolvedEvent>(OnCustomStyleResolved);
                RegisterCallback <AttachToPanelEvent>(OnAttachToPanel);
                this.generateVisualContent += OnGenerateVisualContent;
            }
            internal void SelectNone()
            {
                TextEditorEngine expr_07 = this.editorEngine;

                if (expr_07 != null)
                {
                    expr_07.SelectNone();
                }
            }
            public void SelectAll()
            {
                TextEditorEngine expr_07 = this.editorEngine;

                if (expr_07 != null)
                {
                    expr_07.SelectAll();
                }
            }
示例#4
0
 public KeyboardTextEditorEventHandler(TextEditorEngine editorEngine, ITextInputField textInputField)
     : base(editorEngine, textInputField)
 {
 }
示例#5
0
 public TouchScreenTextEditorEventHandler(TextEditorEngine editorEngine, ITextInputField textInputField) : base(editorEngine, textInputField)
 {
 }
示例#6
0
 protected TextEditorEventHandler(TextEditorEngine editorEngine, ITextInputField textInputField)
 {
     this.editorEngine   = editorEngine;
     this.textInputField = textInputField;
     this.textInputField.SyncTextEngine();
 }