Exemple #1
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            //TODO: Disable when click on plusminus icon
            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            if (args.Node != null)
            {
                OnNodeMouseClick(args);
            }

            base.OnMouseClick(e);
        }
Exemple #2
0
        private TreeNodeAdvMouseEventArgs CreateMouseArgs(MouseEventArgs e)
        {
            TreeNodeAdvMouseEventArgs args = new TreeNodeAdvMouseEventArgs(e);

            args.ViewLocation = new Point(e.X + OffsetX,
                                          e.Y + _rowLayout.GetRowBounds(FirstVisibleRow).Y - ColumnHeaderHeight);
            args.ModifierKeys = ModifierKeys;
            args.Node         = GetNodeAt(e.Location);
            NodeControlInfo info = GetNodeControlInfoAt(args.Node, e.Location);

            args.ControlBounds = info.Bounds;
            args.Control       = info.Control;
            return(args);
        }
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ItemDragMode = false;
     if (_mouseDownFlag)
     {
         if (args.Button == MouseButtons.Left)
         {
             DoMouseOperation(args);
         }
         else if (args.Button == MouseButtons.Right)
         {
             Tree.CurrentNode = args.Node;
         }
     }
     _mouseDownFlag = false;
 }
Exemple #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.ContextMenuStrip = _cms;
            }
            else
            {
                base.ContextMenuStrip = null;
            }

            base.OnMouseDown(e);
        }
 protected override void DoMouseOperation(TreeNodeAdvMouseEventArgs args)
 {
     if (Tree.SelectionMode == TreeSelectionMode.Single || Tree.SelectionStart == null)
     {
         base.DoMouseOperation(args);
     }
     else if (CanSelect(args.Node))
     {
         Tree.SuspendSelectionEvent = true;
         try
         {
             SelectAllFromStart(args.Node);
         }
         finally
         {
             Tree.SuspendSelectionEvent = false;
         }
     }
 }
        protected virtual void DoMouseOperation(TreeNodeAdvMouseEventArgs args)
        {
            if (Tree.SelectedNodes.Count == 1 && args.Node != null && args.Node.IsSelected)
            {
                return;
            }

            Tree.SuspendSelectionEvent = true;
            try
            {
                Tree.ClearSelectionInternal();
                if (args.Node != null)
                {
                    args.Node.IsSelected = true;
                }
                Tree.SelectionStart = args.Node;
            }
            finally
            {
                Tree.SuspendSelectionEvent = false;
            }
        }
Exemple #7
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

            if (Input is ResizeColumnState)
            {
                Input.MouseUp(args);
            }
            else
            {
                if (args.Node != null && args.Control != null)
                {
                    args.Control.MouseUp(args);
                }
                if (!args.Handled)
                {
                    Input.MouseUp(args);
                }

                base.OnMouseUp(e);
            }
        }
Exemple #8
0
        private string GetNodeToolTip(TreeNodeAdvMouseEventArgs args)
        {
            string msg = args.Control.GetToolTip(args.Node);

            BaseTextControl btc = args.Control as BaseTextControl;

            if (btc != null && btc.DisplayHiddenContentInToolTip && String.IsNullOrEmpty(msg))
            {
                Size ms = btc.GetActualSize(args.Node, _measureContext);
                if (ms.Width > args.ControlBounds.Size.Width || ms.Height > args.ControlBounds.Size.Height ||
                    args.ControlBounds.Right - OffsetX > DisplayRectangle.Width)
                {
                    msg = btc.GetLabel(args.Node);
                }
            }

            if (String.IsNullOrEmpty(msg) && DefaultToolTipProvider != null)
            {
                msg = DefaultToolTipProvider.GetToolTip(args.Node, args.Control);
            }

            return(msg);
        }
 protected virtual void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ClearSelection();
 }
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     FinishResize();
 }
 public override void MouseDown(TreeNodeAdvMouseEventArgs args)
 {
 }
 protected override void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
 }
 public abstract void MouseUp(TreeNodeAdvMouseEventArgs args);
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ChangeInput();
     Tree.UpdateView();
     Tree.OnColumnClicked(Column);
 }