MoveTextEnd() public method

public MoveTextEnd ( ) : void
return void
Esempio n. 1
0
	/// <summary>
	/// Notification of the input field gaining selection.
	/// </summary>

	protected void OnSelectEvent ()
	{
		selection = this;

		if (mDoInit) Init();

		if (label != null && NGUITools.GetActive(this))
		{
			label.color = activeTextColor;
#if MOBILE
			if (Application.platform == RuntimePlatform.IPhonePlayer ||
				Application.platform == RuntimePlatform.Android
#if UNITY_WP8
				|| Application.platform == RuntimePlatform.WP8Player
#endif
#if UNITY_BLACKBERRY
				|| Application.platform == RuntimePlatform.BB10Player
#endif
			)
			{
				mKeyboard = (inputType == InputType.Password) ?
					TouchScreenKeyboard.Open(mValue, TouchScreenKeyboardType.Default, false, false, true) :
					TouchScreenKeyboard.Open(mValue, (TouchScreenKeyboardType)((int)keyboardType), inputType == InputType.AutoCorrect, label.multiLine);
			}
			else
#endif
			{
				Input.imeCompositionMode = IMECompositionMode.On;
				Input.compositionCursorPos = (UICamera.current != null && UICamera.current.cachedCamera != null) ?
					UICamera.current.cachedCamera.WorldToScreenPoint(label.worldCorners[0]) :
					label.worldCorners[0];
#if !MOBILE
				mEditor = new TextEditor();
				mEditor.content = new GUIContent(mValue);
				mEditor.OnFocus();
				mEditor.MoveTextEnd();
#endif
				mDrawStart = 0;
				mDrawEnd = 0;
			}
			UpdateLabel();
		}
	}
Esempio n. 2
0
 private static bool PerformOperation(TextEditor te, UIUnityEvents.TextEditOp operation)
 {
     switch (operation)
     {
         case UIUnityEvents.TextEditOp.MoveLeft:
         {
             te.MoveLeft();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveRight:
         {
             te.MoveRight();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveUp:
         {
             te.MoveUp();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveDown:
         {
             te.MoveDown();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveLineStart:
         {
             te.MoveLineStart();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveLineEnd:
         {
             te.MoveLineEnd();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveTextStart:
         {
             te.MoveTextStart();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveTextEnd:
         {
             te.MoveTextEnd();
             break;
         }
         case UIUnityEvents.TextEditOp.MovePageUp:
         case UIUnityEvents.TextEditOp.MovePageDown:
         case UIUnityEvents.TextEditOp.SelectPageUp:
         case UIUnityEvents.TextEditOp.SelectPageDown:
         {
             Debug.Log(string.Concat("Unimplemented: ", operation));
             break;
         }
         case UIUnityEvents.TextEditOp.MoveGraphicalLineStart:
         {
             te.MoveGraphicalLineStart();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveGraphicalLineEnd:
         {
             te.MoveGraphicalLineEnd();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveWordLeft:
         {
             te.MoveWordLeft();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveWordRight:
         {
             te.MoveWordRight();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveParagraphForward:
         {
             te.MoveParagraphForward();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveParagraphBackward:
         {
             te.MoveParagraphBackward();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveToStartOfNextWord:
         {
             te.MoveToStartOfNextWord();
             break;
         }
         case UIUnityEvents.TextEditOp.MoveToEndOfPreviousWord:
         {
             te.MoveToEndOfPreviousWord();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectLeft:
         {
             te.SelectLeft();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectRight:
         {
             te.SelectRight();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectUp:
         {
             te.SelectUp();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectDown:
         {
             te.SelectDown();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectTextStart:
         {
             te.SelectTextStart();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectTextEnd:
         {
             te.SelectTextEnd();
             break;
         }
         case UIUnityEvents.TextEditOp.ExpandSelectGraphicalLineStart:
         {
             te.ExpandSelectGraphicalLineStart();
             break;
         }
         case UIUnityEvents.TextEditOp.ExpandSelectGraphicalLineEnd:
         {
             te.ExpandSelectGraphicalLineEnd();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectGraphicalLineStart:
         {
             te.SelectGraphicalLineStart();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectGraphicalLineEnd:
         {
             te.SelectGraphicalLineEnd();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectWordLeft:
         {
             te.SelectWordLeft();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectWordRight:
         {
             te.SelectWordRight();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectToEndOfPreviousWord:
         {
             te.SelectToEndOfPreviousWord();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectToStartOfNextWord:
         {
             te.SelectToStartOfNextWord();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectParagraphBackward:
         {
             te.SelectParagraphBackward();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectParagraphForward:
         {
             te.SelectParagraphForward();
             break;
         }
         case UIUnityEvents.TextEditOp.Delete:
         {
             return te.Delete();
         }
         case UIUnityEvents.TextEditOp.Backspace:
         {
             return te.Backspace();
         }
         case UIUnityEvents.TextEditOp.DeleteWordBack:
         {
             return te.DeleteWordBack();
         }
         case UIUnityEvents.TextEditOp.DeleteWordForward:
         {
             return te.DeleteWordForward();
         }
         case UIUnityEvents.TextEditOp.Cut:
         {
             return te.Cut();
         }
         case UIUnityEvents.TextEditOp.Copy:
         {
             te.Copy();
             break;
         }
         case UIUnityEvents.TextEditOp.Paste:
         {
             return te.Paste();
         }
         case UIUnityEvents.TextEditOp.SelectAll:
         {
             te.SelectAll();
             break;
         }
         case UIUnityEvents.TextEditOp.SelectNone:
         {
             te.SelectNone();
             break;
         }
         default:
         {
             goto case UIUnityEvents.TextEditOp.SelectPageDown;
         }
     }
     return false;
 }