SetDesiredColumn() public method

public SetDesiredColumn ( ) : void
return void
        protected void OnDragOver(object sender, DragEventArgs e)
        {
            if (!textArea.Focused)
            {
                textArea.Focus();
            }

            Point p = textArea.PointToClient(new Point(e.X, e.Y));

            if (textArea.TextView.DrawingPosition.Contains(p.X, p.Y))
            {
                TextLocation realmousepos = textArea.TextView.GetLogicalPosition(p.X - textArea.TextView.DrawingPosition.X, p.Y - textArea.TextView.DrawingPosition.Y); int lineNr = Math.Min(textArea.Document.TotalNumberOfLines - 1, Math.Max(0, realmousepos.Y));

                textArea.Caret.Position = new TextLocation(realmousepos.X, lineNr);
                textArea.SetDesiredColumn();

                if (e.Data.GetDataPresent(typeof(string)) && !textArea.IsReadOnly(textArea.Caret.Offset))
                {
                    e.Effect = GetDragDropEffect(e);
                }
                else
                {
                    e.Effect = DragDropEffects.None;
                }
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }
Beispiel #2
0
 public void JumpTo(int line, int column)
 {
     textArea.Focus();
     textArea.SelectionManager.ClearSelection();
     textArea.Caret.Position = new TextLocation(column, line);
     textArea.SetDesiredColumn();
     ScrollToCaret();
 }
        void TextAreaClick(object sender, EventArgs e)
        {
            if (dodragdrop)
            {
                return;
            }

            if (clickedOnSelectedText && textArea.TextView.DrawingPosition.Contains(mousepos.X, mousepos.Y))
            {
                textArea.SelectionManager.ClearSelection();

                Point clickPosition = textArea.TextView.GetLogicalPosition(mousepos.X - textArea.TextView.DrawingPosition.X,
                                                                           mousepos.Y - textArea.TextView.DrawingPosition.Y);
                textArea.Caret.Position = clickPosition;
                textArea.SetDesiredColumn();
            }
        }
        public override void Execute(TextArea textArea)
        {
            TextLocation position = textArea.Caret.Position;
            position.Line = _line;

            textArea.Caret.Position = position;
            textArea.SelectionManager.ClearSelection();
            textArea.SetDesiredColumn();
            
        }
Beispiel #5
0
        public override void Execute(SD.TextArea textArea)
        {
            TextLocation newPos = textArea.Caret.Position;

            newPos.X = 0;
            if (newPos != textArea.Caret.Position)
            {
                textArea.Caret.Position = newPos;
                textArea.SetDesiredColumn();
            }
        }
        void TextAreaClick(object sender, EventArgs e)
        {
            Point mousepos;

            mousepos = _textArea.MousePos;

            if (!_dodragdrop)
            {
                if (_clickedOnSelectedText && _textArea.TextView.DrawingPosition.Contains(mousepos.X, mousepos.Y))
                {
                    _textArea.SelectionManager.ClearSelection();
                    TextLocation clickPosition = _textArea.TextView.GetLogicalPosition(mousepos.X - _textArea.TextView.DrawingPosition.X, mousepos.Y - _textArea.TextView.DrawingPosition.Y);
                    _textArea.Caret.Position = clickPosition;
                    _textArea.SetDesiredColumn();
                }
            }
        }