Exemple #1
0
        public TextInputFieldBase(int maxLength, char maskChar)
        {
            this.maxLength = maxLength;
            this.maskChar  = maskChar;

            editorEngine = new TextEditorEngine(this);

            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);

            // TextField are focusable by default.
            focusIndex = 0;
        }
Exemple #2
0
        public TextInputFieldBase(int maxLength, char maskChar)
        {
            requireMeasureFunction = true;

            m_Text         = "";
            this.maxLength = maxLength;
            this.maskChar  = maskChar;

            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);
        }
Exemple #3
0
 protected TextEditorEventHandler(TextEditorEngine editorEngine, TextInputFieldBase textInputField)
 {
     this.editorEngine   = editorEngine;
     this.textInputField = textInputField;
     this.textInputField.SyncTextEngine();
 }
Exemple #4
0
 public TouchScreenTextEditorEventHandler(TextEditorEngine editorEngine, TextInputFieldBase textInputField) : base(editorEngine, textInputField)
 {
     this.secureText = string.Empty;
 }
Exemple #5
0
 public KeyboardTextEditorEventHandler(TextEditorEngine editorEngine, ITextInputField textInputField)
     : base(editorEngine, textInputField)
 {
 }