Esempio n. 1
0
 protected override void DoMouseOperation(TreeNodeAdvMouseEventArgs args)
 {
     if (Tree.SelectionMode == TreeSelectionMode.Single)
     {
         base.DoMouseOperation(args);
     }
     else if (CanSelect(args.Node))
     {
         args.Node.IsSelected = !args.Node.IsSelected;
         Tree.SelectionStart = args.Node;
     }
 }
Esempio n. 2
0
 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;
         }
     }
 }
Esempio n. 3
0
 public abstract void MouseUp(TreeNodeAdvMouseEventArgs args);
Esempio n. 4
0
 public virtual void MouseDoubleClick(TreeNodeAdvMouseEventArgs args)
 {
 }
Esempio n. 5
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     FinishResize();
 }
Esempio n. 6
0
 public override void MouseDown(TreeNodeAdvMouseEventArgs args)
 {
 }
Esempio n. 7
0
 public override void MouseDoubleClick(TreeNodeAdvMouseEventArgs args)
 {
     Tree.AutoSizeColumn(Column);
 }
Esempio n. 8
0
 protected override void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
 }
Esempio n. 9
0
        public override void MouseDown(TreeNodeAdvMouseEventArgs args)
        {
            if (args.Node != null)
            {
                Tree.ItemDragMode = true;
                Tree.ItemDragStart = args.Location;

                if (args.Button == MouseButtons.Left || args.Button == MouseButtons.Right)
                {
                    Tree.BeginUpdate();
                    try
                    {
                        Tree.CurrentNode = args.Node;
                        if (args.Node.IsSelected)
                            _mouseDownFlag = true;
                        else
                        {
                            _mouseDownFlag = false;
                            DoMouseOperation(args);
                        }
                    }
                    finally
                    {
                        Tree.EndUpdate();
                    }
                }

            }
            else
            {
                Tree.ItemDragMode = false;
                MouseDownAtEmptySpace(args);
            }
        }
Esempio n. 10
0
 protected virtual void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ClearSelection();
 }
Esempio n. 11
0
        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;
            }
        }
Esempio n. 12
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ItemDragMode = false;
     if (_mouseDownFlag && args.Node != null)
     {
         if (args.Button == MouseButtons.Left)
             DoMouseOperation(args);
         else if (args.Button == MouseButtons.Right)
             Tree.CurrentNode = args.Node;
     }
     _mouseDownFlag = false;
 }
Esempio n. 13
0
 private void OnNodeMouseDoubleClick(TreeNodeAdvMouseEventArgs args)
 {
     if (NodeMouseDoubleClick != null)
         NodeMouseDoubleClick(this, args);
 }
Esempio n. 14
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;
        }
Esempio n. 15
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;
 }
Esempio n. 16
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ChangeInput();
     Tree.UpdateView();
     Tree.OnColumnClicked(Column);
 }