private void OnEnterPressed(object e)
 {
     if (m_selectedNode != null)
     {
         NodeSelected?.Invoke(m_selectedNode);
     }
 }
Example #2
0
        protected override void OnNodeMouseClick(TreeNodeMouseClickEventArgs e)
        {
            base.OnNodeMouseClick(e);

            TreeViewHitTestInfo hitTest = HitTest(e.Location);

            if (hitTest.Node != e.Node)
            {
                return;
            }

            if (e.Button == MouseButtons.Right)
            {
                if (hitTest.Location == TreeViewHitTestLocations.Label)
                {
                    this.SelectedNode = e.Node;
                    NodeContextMenuRequested.Invoke(this, e);
                }
            }
            else if (e.Button == MouseButtons.Left)
            {
                if (hitTest.Location == TreeViewHitTestLocations.Label)
                {
                    NodeSelected.Invoke(this, new TreeViewExEventArgs(e.Node, e));
                }
            }
        }
    private void MapNodeVm_Select(object sender, EventArgs e)
    {
        var nodeViewModel = (MapNodeVM)sender;
        var eventArgs     = new NodeInteractEventArgs(nodeViewModel);

        NodeSelected?.Invoke(this, eventArgs);
    }
Example #4
0
 void AnaylyzeLeftButtonClick(IViewerObject obj)
 {
     if (obj is DNode dNode)
     {
         NodeSelected?.Invoke(this, new NodeEventArgs(dNode.DrawingNode, new GeometryPoint(0, 0)));
     }
 }
Example #5
0
 public void FireNodeSelected()
 {
     if (NodeSelected != null)
     {
         NodeSelected.Invoke(this);
     }
 }
Example #6
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            Point mousePoint = e.Location;

            mousePoint.X -= GraphicalMidpoint.X;
            mousePoint.Y -= GraphicalMidpoint.Y;

            double scaledMousePointX = mousePoint.X / graphicalScalar;
            double scaledMousePointY = mousePoint.Y / graphicalScalar;

            //;

            if (Math.Abs(mousePoint.X) < GraphicalRadius && Math.Abs(mousePoint.Y) < GraphicalRadius)
            {
                double height = GetHeight(scaledMousePointX, scaledMousePointY);
                GridClicked?.Invoke(scaledMousePointX, scaledMousePointY, height);
            }

            RingPoint closestPoint            = null;
            double    shortestSquaredDistance = 0;

            SelectedRingPoint = null;

            for (int i = 0; i < Rings; i++)
            {
                for (int j = 0; j < PerimeterPoints; j++)
                {
                    //Console.WriteLine(mousePoint.X + ", " + mousePoint.Y + " : " + (RingArray[i].ringPoints[j].X * graphicalScalar) + ", " + (RingArray[i].ringPoints[j].Y * graphicalScalar));
                    double distanceSquared = ((scaledMousePointX - RingArray[i].ringPoints[j].X) * (scaledMousePointX - RingArray[i].ringPoints[j].X) +
                                              (scaledMousePointY - RingArray[i].ringPoints[j].Y) * (scaledMousePointY - RingArray[i].ringPoints[j].Y));
                    if (closestPoint == null || distanceSquared < shortestSquaredDistance)
                    {
                        closestPoint            = RingArray[i].ringPoints[j];
                        shortestSquaredDistance = distanceSquared;
                    }
                }
            }

            double shortestDistance = Math.Sqrt(shortestSquaredDistance);

            if (shortestDistance <= 8)
            {
                // clicked on closestPoint
                SelectedRingPoint = closestPoint;

                NodeSelected?.Invoke(closestPoint, e);
            }
            else
            {
                NodeUnselected?.Invoke(closestPoint, e);
            }

            this.Refresh();

            base.OnMouseClick(e);
        }
Example #7
0
        private void TvExplorer_AfterSelect(object sender, TreeViewEventArgs e)
        {
            var selectedNode = e.Node.Tag as Node;

            foreach (var node in tvExplorer.Nodes.OfType <TreeNode>())
            {
                HighlightNodesByTag(node, selectedNode);
            }
            NodeSelected?.Invoke(this, selectedNode);
        }
Example #8
0
    void CheckIfNodeMouseHover()
    {
        NodeDeselected?.Invoke();

        RaycastHit hit;
        Ray        ray = Camera.main.ScreenPointToRay(mouse.position.ReadValue());

        if (Physics.Raycast(ray, out hit, Mathf.Infinity, nodeLayer))
        {
            NodeSelected?.Invoke(hit.transform.position);
        }
    }
Example #9
0
 public void SelectNode(XNode.Node node, bool add)
 {
     if (add)
     {
         List <Object> selection = new List <Object>(Selection.objects);
         selection.Add(node);
         Selection.objects = selection.ToArray();
     }
     else
     {
         Selection.objects = new Object[] { node };
         NodeSelected?.Invoke(node);
     }
 }
        private async Task SetCurrentNodeWithAnimationAsync(UICollectionView collectionView, TreeNode <T, TKey> selectedNode)
        {
            var diffResult = TreeMenuDiff.Calculate(_currentNode, selectedNode);

            diffResult
            .ChangedIndexes
            .Select(x => (cell: collectionView.CellForItem(NSIndexPath.FromRowSection(x.Index, 0)), relation: x.Relation))
            .Where(x => x.cell != null)
            .ForEach((_, x) => _itemStateChanged(x.cell, x.relation));

            _currentNode = selectedNode;
            _itemCollection.CurrentNode = selectedNode;

            await AnimateDiffAsync(collectionView, diffResult);

            NodeSelected?.Invoke(this, selectedNode);
        }
        private async Task SetCurrentNodeWithAnimationAsync(TreeNode <T, TKey> selectedNode)
        {
            var diffResult = TreeMenuDiff.Calculate(_currentNode, selectedNode);

            diffResult
            .ChangedIndexes
            .Select(x => (cell: _recyclerView.FindViewHolderForLayoutPosition(x.Index), relation: x.Relation))
            .Where(x => x.cell != null)
            .ForEach((_, x) => _itemStateChanged(x.cell, x.relation));

            _currentNode = selectedNode;
            _itemCollection.CurrentNode = selectedNode;

            _itemAnimator.DiffResult = diffResult;
            await AnimateDiffAsync(diffResult);

            NodeSelected?.Invoke(this, selectedNode);
        }
Example #12
0
        public TreeViewForm()
        {
            if (BodyImg == null)
            {
                BodyImg = new Texture.Texture2D("data/nxUI/bg/winBody4.png", Texture.LoadMethod.Single, true);
            }


            Draw = () =>
            {
                GL.Enable(EnableCap.ScissorTest);
                GL.Scissor(GX, GY, W, H);

                DrawForm(BodyImg);
                int y = 5;
                Over = OverNode(Root, ref y, 5);
                y    = 5;
                DrawNode(Root, ref y, 5);
                if (ActNode != null)
                {
                    DrawText(ActNode.Name, UI.MX - GX, UI.MY - GY);
                }
                ;

                GL.Disable(EnableCap.ScissorTest);
            };

            DoubleClick = (b) =>
            {
                if (Selected != null && Selected.Click != null)
                {
                    Selected.Click(b);
                }
                if (Selected != null)
                {
                    Console.WriteLine("Double:" + Selected.Name);
                }
            };

            MouseDown = (b) =>
            {
                Console.WriteLine("TreeClick");
                int y = 5;
                ClickNode(Root, ref y, 5);
                y        = 5;
                ActNode  = OverNode(Root, ref y, 5);
                Selected = ActNode;
                Select?.Invoke(Selected);
            };
            MouseUp = (b) =>
            {
                if (Over != null && ActNode != null)
                {
                    if (ActNode != Over)
                    {
                        if (ActNode.Root != null && ActNode.Root != Over && Over.Root != ActNode)
                        {
                            ActNode.Root.Nodes.Remove(ActNode);
                            Over.Nodes.Add(ActNode);
                            ActNode.Root = Over;
                        }
                    }
                }
                ActNode = null;
            };
        }
 protected virtual void OnNodeSelected(DbNavigationNodeType nodeType, string instanceId)
 {
     NodeSelected?.Invoke(this, new ElementNodeEventArgs(nodeType, instanceId));
 }
Example #14
0
 public void OnSelected()
 {
     NodeSelected?.Invoke(this, EventArgs.Empty);
 }
 public void ConfirmNode(CNodeEntryViewModel confirmedNode)
 {
     NodeSelected?.Invoke(confirmedNode);
 }
Example #16
0
 protected void OnNodeSelected(EventArgs e)
 {
     NodeSelected?.Invoke(this, e);
 }
Example #17
0
 private void OnNodeSelected(NodeBase node)
 {
     NodeSelected?.Invoke(this, new NodeEventArgs(node));
 }
Example #18
0
 void OnMouseUpAsButton()
 {
     NodeSelected?.Invoke(Node);
 }
Example #19
0
 void OnNodeSelected(Node node)
 {
     NodeSelected?.Invoke(node);
 }