Ejemplo 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;
     }
 }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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;
     }
 }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 protected virtual void DoMouseOperation(TreeNodeAdvMouseEventArgs args)
 {
     Tree.SuspendSelectionEvent = true;
     try
     {
         Tree.ClearSelectionInternal();
         if (args.Node != null)
         {
             args.Node.IsSelected = true;
         }
         Tree.SelectionStart = args.Node;
     }
     finally
     {
         Tree.SuspendSelectionEvent = false;
     }
 }
Ejemplo n.º 7
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;
         }
     }
 }
Ejemplo n.º 8
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;
         }
     }
 }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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);
            }
        }
Ejemplo n.º 11
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);
        }
Ejemplo n.º 12
0
        protected override void OnMouseDoubleClick(MouseEventArgs e)
        {
            TreeNodeAdvMouseEventArgs args = CreateMouseArgs(e);

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

            if (!args.Handled)
            {
                if (args.Node != null && args.Button == MouseButtons.Left)
                {
                    args.Node.IsExpanded = !args.Node.IsExpanded;
                }

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

            base.OnMouseDoubleClick(e);
        }
Ejemplo n.º 13
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);
            }
        }
Ejemplo n.º 14
0
 public abstract void MouseUp(TreeNodeAdvMouseEventArgs args);
Ejemplo n.º 15
0
 protected virtual void DoMouseOperation(TreeNodeAdvMouseEventArgs args)
 {
     Tree.SuspendSelectionEvent = true;
     try
     {
         Tree.ClearSelectionInternal();
         if (args.Node != null)
             args.Node.IsSelected = true;
         Tree.SelectionStart = args.Node;
     }
     finally
     {
         Tree.SuspendSelectionEvent = false;
     }
 }
Ejemplo n.º 16
0
 private void OnNodeMouseDoubleClick(TreeNodeAdvMouseEventArgs args)
 {
     if (NodeMouseDoubleClick != null)
         NodeMouseDoubleClick(this, args);
 }
Ejemplo n.º 17
0
 protected virtual void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ClearSelectionInternal();
 }
Ejemplo n.º 18
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;
 }
Ejemplo n.º 19
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;
        }
Ejemplo n.º 20
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ChangeInput();
     Tree.UpdateView();
     Tree.OnColumnClicked(Column);
 }
Ejemplo n.º 21
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ChangeInput();
     Tree.UpdateView();
     Tree.OnColumnClicked(Column);
 }
Ejemplo n.º 22
0
 public override void MouseDown(TreeNodeAdvMouseEventArgs args)
 {
 }
Ejemplo n.º 23
0
 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;
 }
Ejemplo n.º 24
0
 public override void MouseDown(TreeNodeAdvMouseEventArgs args)
 {
 }
Ejemplo n.º 25
0
 protected override void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
 }
Ejemplo n.º 26
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     FinishResize();
 }
Ejemplo n.º 27
0
 public abstract void MouseUp(TreeNodeAdvMouseEventArgs args);
Ejemplo n.º 28
0
 protected override void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
 }
Ejemplo n.º 29
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     FinishResize();
 }
Ejemplo n.º 30
0
 protected virtual void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ClearSelectionInternal();
 }