Ejemplo n.º 1
0
        /// <summary>
        /// MouseDoubleClickイベントを発生させます
        /// </summary>
        /// <param name="e">インベントデータ</param>
        protected override void OnMouseDoubleClick(MouseEventArgs e)
        {
            TextPoint tp = this.View.GetTextPointFromPostion(e.Location);

            if (tp == TextPoint.Null)
            {
                return;
            }
            int index = this.View.LayoutLines.GetIndexFromTextPoint(tp);

            FooMouseEventArgs mouseEvent = new FooMouseEventArgs(index, e.Button, e.Clicks, e.X, e.Y, e.Delta);

            base.OnMouseDoubleClick(mouseEvent);

            if (mouseEvent.Handled)
            {
                return;
            }

            if (e.X < this.render.TextArea.X)
            {
                this.Document.SelectLine(index);
            }
            else
            {
                this.Document.SelectWord(index);
            }

            this.Refresh();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// MouseClickイベントを発生させます
        /// </summary>
        /// <param name="e">インベントデータ</param>
        protected override void OnMouseClick(MouseEventArgs e)
        {
            int index = this.GetIndexFromPostion(e.Location);

            FooMouseEventArgs mouseEvent = new FooMouseEventArgs(index, e.Button, e.Clicks, e.X, e.Y, e.Delta);

            base.OnMouseClick(mouseEvent);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// MouseDownイベントを発生させます
        /// </summary>
        /// <param name="e">インベントデータ</param>
        protected override void OnMouseDown(MouseEventArgs e)
        {
            TextPoint tp = this.View.GetTextPointFromPostion(e.Location);

            if (tp == TextPoint.Null)
            {
                return;
            }
            int index = this.View.LayoutLines.GetIndexFromTextPoint(tp);

            FooMouseEventArgs mouseEvent = new FooMouseEventArgs(index, e.Button, e.Clicks, e.X, e.Y, e.Delta);

            base.OnMouseDown(mouseEvent);

            if (mouseEvent.Handled)
            {
                return;
            }

            if (e.Button == MouseButtons.Left)
            {
                FoldingItem foldingData = this.View.HitFoldingData(e.Location.X, tp.row);
                if (foldingData != null)
                {
                    if (foldingData.Expand)
                    {
                        this.View.LayoutLines.FoldingCollection.Collapse(foldingData);
                    }
                    else
                    {
                        this.View.LayoutLines.FoldingCollection.Expand(foldingData);
                    }
                    this.Controller.JumpCaret(foldingData.Start, false);
                }
                else
                {
                    this.Controller.JumpCaret(tp.row, tp.col, false);
                }
                this.View.IsFocused = true;
                this.Focus();
                this.Refresh();
            }
        }