Пример #1
0
        public override void OnDoubleClick(MouseButtonEventArgs e)
        {
            base.OnDoubleClick(e);

            Paragraph para = RowManager.CurrentParagraph;

            if (para == null)
            {
                return;
            }
            if (Environment.TickCount - lastDoubleClickTicks < 500)
            {
                // Select Paragraph
                SelStart  = para.PositionOffset;
                SelLength = para.Length - 1;
                RowManager.SetCursorAbsPosition(para.PositionOffset + para.Length - 1);
            }
            else
            {
                // Select Word
                RowManager.MovePrevWord();
                SelStart = para.PositionOffset + RowManager.CursorPosition;
                RowManager.MoveEndOfWord();
                SelLength = (para.PositionOffset + RowManager.CursorPosition) - SelStart;

                Invalidate();
                lastDoubleClickTicks = Environment.TickCount;
            }
        }
Пример #2
0
 public void DeleteSelection()
 {
     if (CanDelete)
     {
         RowManager.DeleteRange(SelStart, SelLength);
         RowManager.SetCursorAbsPosition(SelStart);
         ResetSelection();
         Modified = true;
     }
 }
Пример #3
0
 public void SetCursorPosition(int pos)
 {
     RowManager.SetCursorAbsPosition(pos);
 }