protected override void OnMouseDown(MouseEventArgs e)
        {
            if (!Focused)
            {
                Focus();
            }

            Search.EndSearch();
            if (e.Button == MouseButtons.Left)
            {
                TreeColumn c;
                c = GetColumnAt(e.Location, true);
                if (c != null)
                {
                    Input = new ResizeColumnState(this, c, e.Location);
                    return;
                }
                c = GetColumnAt(e.Location, false);
                if (c != null)
                {
                    Input = new ClickColumnState(this, c, e.Location);
                    UpdateView();
                    return;
                }
            }

            ChangeInput();
            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            if (args.Node != null && args.Control != null)
            {
                args.Control.MouseDown(args);
            }

            // [xiperware] toggle on single click
            if (!args.Handled)
            {
                if (args.Node != null && args.Button == MouseButtons.Left)
                {
                    args.Node.IsExpanded = !args.Node.IsExpanded;
                }
            }

            if (!args.Handled)
            {
                Input.MouseDown(args);
            }

            base.OnMouseDown(e);
        }
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (CurrentEditorOwner != null)
            {
                CurrentEditorOwner.EndEdit(true);
                return;
            }

            if (!Focused)
            {
                Focus();
            }

            _search.EndSearch();
            if (e.Button == MouseButtons.Left)
            {
                TreeColumn c;
                c = GetColumnDividerAt(e.Location);
                if (c != null)
                {
                    Input = new ResizeColumnState(this, c, e.Location);
                    return;
                }
                c = GetColumnAt(e.Location);
                if (c != null)
                {
                    Input = new ClickColumnState(this, c, e.Location);
                    UpdateView();
                    return;
                }
            }

            ChangeInput();
            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            if (args.Node != null && args.Control != null)
            {
                args.Control.MouseDown(args);
            }

            if (!args.Handled)
            {
                Input.MouseDown(args);
            }

            base.OnMouseDown(e);
        }
示例#3
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            _dragEscaped = false;

            if (CurrentEditorOwner != null)
            {
                CurrentEditorOwner.EndEdit(true);
                return;
            }

            if (!Focused && this.GetStyle(ControlStyles.Selectable))
            {
                Focus();
            }

            //_search?.EndSearch();
            if (e.Button == MouseButtons.Left)
            {
                TreeColumn c;
                c = GetColumnDividerAt(e.Location);
                if (c != null)
                {
                    Input = new ResizeColumnState(this, c, e.Location);
                    return;
                }
                c = GetColumnAt(e.Location);
                if (c != null)
                {
                    Input = new ClickColumnState(this, c, e.Location);
                    UpdateView();
                    return;
                }
            }

            ChangeInput();
            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            args.Control?.MouseDown(args);

            if (!args.Handled)
            {
                Input.MouseDown(args);
            }

            base.OnMouseDown(e);
        }
示例#4
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (!Focused)
                Focus();

            _search.EndSearch();
            if (e.Button == MouseButtons.Left)
            {
                TreeColumn c;
                c = GetColumnDividerAt(e.Location);
                if (c != null)
                {
                    Input = new ResizeColumnState(this, c, e.Location);
                    return;
                }
                c = GetColumnAt(e.Location);
                if (c != null)
                {
                    Input = new ClickColumnState(this, c, e.Location);
                    UpdateView();
                    return;
                }
            }

            ChangeInput();
            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            if (args.Node != null && args.Control != null)
                args.Control.MouseDown(args);

            if (!args.Handled)
                Input.MouseDown(args);

            base.OnMouseDown(e);
        }
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (!Focused)
                Focus();

            _search.EndSearch();

            TreeColumn c = null;

            // ml: added support for right button.
            switch (e.Button)
            {
                case MouseButtons.Left:
                {
                    c = GetColumnDividerAt(e.Location);
                    if (c != null)
                        Input = new ResizeColumnState(this, c, e.Location);
                    else
                    {
                        c = GetColumnAt(e.Location);
                        if (c != null)
                        {
                            Input = new ClickColumnState(this, c, e.Location);
                            UpdateView();
                        }
                    }
                    break;
                }

                case MouseButtons.Right:
                {
                    c = GetColumnAt(e.Location);
                    if (c != null)
                        Input = new ClickColumnState(this, c, e.Location);
                    break;
                }
            }

            if (c == null)
                ChangeInput();

            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            if (args.Node != null && args.Control != null)
                args.Control.MouseDown(args);

            if (!args.Handled)
                Input.MouseDown(args);

            base.OnMouseDown(e);
        }
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (!Focused)
            {
                Focus();
            }

            _search.EndSearch();


            TreeColumn c = null;

            // ml: added support for right button.
            switch (e.Button)
            {
            case MouseButtons.Left:
            {
                c = GetColumnDividerAt(e.Location);
                if (c != null)
                {
                    Input = new ResizeColumnState(this, c, e.Location);
                }
                else
                {
                    c = GetColumnAt(e.Location);
                    if (c != null)
                    {
                        Input = new ClickColumnState(this, c, e.Location);
                        UpdateView();
                    }
                }
                break;
            }

            case MouseButtons.Right:
            {
                c = GetColumnAt(e.Location);
                if (c != null)
                {
                    Input = new ClickColumnState(this, c, e.Location);
                }
                break;
            }
            }

            if (c == null)
            {
                ChangeInput();
            }

            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            if (args.Node != null && args.Control != null)
            {
                args.Control.MouseDown(args);
            }

            if (!args.Handled)
            {
                Input.MouseDown(args);
            }

            base.OnMouseDown(e);
        }