SetCaretPos() public method

public SetCaretPos ( int x, int y ) : void
x int
y int
return void
Ejemplo n.º 1
0
        public void HandleMouseDown(UIMouseEventArgs e)
        {
            if (e.Button == UIMouseButtons.Left)
            {
                InvalidateGraphicOfCurrentLineArea();

                if (!e.Shift)
                {
                    internalTextLayerController.SetCaretPos(e.X, e.Y);
                    if (internalTextLayerController.SelectionRange != null)
                    {
                        Rectangle r = GetSelectionUpdateArea();
                        internalTextLayerController.CancelSelect();
                        InvalidateGraphicLocalArea(this, r);
                    }
                    else
                    {
                        InvalidateGraphicOfCurrentLineArea();
                    }
                }
                else
                {
                    internalTextLayerController.StartSelectIfNoSelection();
                    internalTextLayerController.SetCaretPos(e.X, e.Y);
                    internalTextLayerController.EndSelect();
                    InvalidateGraphicOfCurrentLineArea();
                }
            }
        }