MoveRight() public method

public MoveRight ( ) : void
return void
Esempio n. 1
0
        protected void DoPageDown()
        {
            UnityEngine.TextEditor editor = GetWidgetController();

            // Seems to be no way to move more than one line at
            // a time - so have to do this:
            int pos  = Math.Min(editor.pos, contents.Length - 1);
            int rows = ((int)innerCoords.height) / FONT_HEIGHT;

            while (rows > 0 && pos < contents.Length)
            {
                if (contents[pos] == '\n')
                {
                    rows--;
                }
                pos++;
                editor.MoveRight(); // there is a MoveDown but it doesn't work.
            }
        }
Esempio n. 2
0
 public TextEditor moveNextLine(TextEditor te, string s)
 {
     char[] a = s.ToCharArray();
     while (a[te.pos] != '\n')
         te.MoveRight();
     return te;
 }
Esempio n. 3
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;
 }