Exemple #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public SimpleNode()
        {
            InitializeComponent();
            Node = new Node(this);

            Inputs  = stack_input;
            Outputs = stack_output;

            Pause = 1;

            this.PreviewMouseLeftButtonDown += (sender, args) => NodePreviewMouseLeftButtonDown?.Invoke(sender, args);
            this.MouseDown += (sender, args) => NodeMouseDown?.Invoke(sender, args);
            this.MouseMove += (sender, args) => NodeMouseMove?.Invoke(sender, args);
            this.MouseUp   += (sender, args) => NodeMouseUp?.Invoke(sender, args);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public DisplayNode()
        {
            InitializeComponent();
            Properties = new Dictionary <string, object>();
            Node       = new Node(this);

            Inputs  = stack_input;
            Outputs = stack_output;

            Pause = 1;

            this.PreviewMouseLeftButtonDown += (sender, args) => NodePreviewMouseLeftButtonDown?.Invoke(sender, args);
            this.MouseDown += (sender, args) => NodeMouseDown?.Invoke(sender, args);
            this.MouseMove += (sender, args) => NodeMouseMove?.Invoke(sender, args);
            this.MouseUp   += (sender, args) => NodeMouseUp?.Invoke(sender, args);
        }
Exemple #3
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            if (IgnoreNextMouseMove)
            {
                IgnoreNextMouseMove = false;
                return;
            }

            if (e.Button != System.Windows.Forms.MouseButtons.None && !MapView.NodeTextEditor.IsTextEditing)
            {
                DragDropHandler.OnMouseDrag(e);
            }
            else
            {
                MapNode node = MapView.GetMapNodeFromPoint(e.Location);

                if (node != null)
                {
                    NodeMouseMove?.Invoke(node, new NodeMouseEventArgs(node.NodeView, e));
                    if (node != mouseOverNode)
                    {
                        if (mouseOverNode != null)
                        {
                            NodeMouseExit(mouseOverNode, e);
                        }
                        mouseOverNode = node;
                        NodeMouseEnter(node, e);
                    }
                }
                else if (mouseOverNode != null)
                {
                    NodeMouseExit(mouseOverNode, e);
                    mouseOverNode = null;
                }

                if (resetHoverEvent)
                {
                    const uint      HOVER_TIME      = 200; // miliseconds
                    TRACKMOUSEEVENT trackMouseEvent = new TRACKMOUSEEVENT(TMEFlags.TME_HOVER, this.Handle, HOVER_TIME);
                    TrackMouseEvent(ref trackMouseEvent);
                    resetHoverEvent = false;
                }
            }

            base.OnMouseMove(e);
        }