Пример #1
0
 internal override void DoRepaint(IStylePainter painter)
 {
     if (this.touchScreenTextField)
     {
         TouchScreenTextEditor touchScreenTextEditor = this.editor as TouchScreenTextEditor;
         if (touchScreenTextEditor != null && touchScreenTextEditor.keyboardOnScreen != null)
         {
             base.text = touchScreenTextEditor.keyboardOnScreen.text;
             if (this.editor.maxLength >= 0 && base.text != null && base.text.Length > this.editor.maxLength)
             {
                 base.text = base.text.Substring(0, this.editor.maxLength);
             }
             if (touchScreenTextEditor.keyboardOnScreen.done)
             {
                 touchScreenTextEditor.keyboardOnScreen = null;
                 GUI.changed = true;
             }
         }
         string text = base.text;
         if (touchScreenTextEditor != null && !string.IsNullOrEmpty(touchScreenTextEditor.secureText))
         {
             text = "".PadRight(touchScreenTextEditor.secureText.Length, this.maskChar);
         }
         base.DoRepaint(painter);
         base.text = text;
     }
     else if (this.isPasswordField)
     {
         string text2 = base.text;
         base.text = "".PadRight(base.text.Length, this.maskChar);
         if (!this.hasFocus)
         {
             base.DoRepaint(painter);
         }
         else
         {
             this.DrawWithTextSelectionAndCursor(painter, base.text);
         }
         base.text = text2;
     }
     else if (!this.hasFocus)
     {
         base.DoRepaint(painter);
     }
     else
     {
         this.DrawWithTextSelectionAndCursor(painter, base.text);
     }
 }
Пример #2
0
 internal override void DoRepaint(IStylePainter painter)
 {
     if (this.touchScreenTextField)
     {
         TouchScreenTextEditor touchScreenTextEditor = this.editor as TouchScreenTextEditor;
         if (touchScreenTextEditor != null && touchScreenTextEditor.keyboardOnScreen != null)
         {
             base.text = touchScreenTextEditor.keyboardOnScreen.text;
             if (this.editor.maxLength >= 0 && base.text != null && base.text.Length > this.editor.maxLength)
             {
                 base.text = base.text.Substring(0, this.editor.maxLength);
             }
             if (touchScreenTextEditor.keyboardOnScreen.done)
             {
                 touchScreenTextEditor.keyboardOnScreen = null;
                 GUI.changed = true;
             }
         }
         string t = base.text;
         if (touchScreenTextEditor != null && !string.IsNullOrEmpty(touchScreenTextEditor.secureText))
         {
             t = "".PadRight(touchScreenTextEditor.secureText.Length, this.maskChar);
         }
         this.style.Draw(base.position, GUIContent.Temp(t), 0, false);
     }
     else if (this.isPasswordField)
     {
         string text = "".PadRight(base.text.Length, this.maskChar);
         if (!this.hasFocus)
         {
             this.style.Draw(base.position, GUIContent.Temp(text), 0, false);
         }
         else
         {
             this.DrawCursor(text);
         }
     }
     else if (!this.hasFocus)
     {
         this.style.Draw(base.position, GUIContent.Temp(base.text), 0, false);
     }
     else
     {
         this.DrawCursor(base.text);
     }
 }