Exemplo n.º 1
0
        private void ChildButtonReleaseEvent(object sender, ButtonReleaseEventArgs args)
        {
            NodeViewChild child = GetChild((Widget)sender);

            Debug.Assert(child != null);

            if (args.Event.Button == 1) // GDK_BUTTON_PRIMARY
            {
                ((Node)child.Child).UnblockExpander();
            }

            _action = NodeViewAction.None;

            args.RetVal = false;
        }
Exemplo n.º 2
0
        private void ChildButtonPressEventHandler(object sender, ButtonPressEventArgs args)
        {
            NodeViewChild child = GetChild((Widget)sender);

            Debug.Assert(child != null);

            if (args.Event.Button == 1) // GDK_BUTTON_PRIMARY
            {
                int x = (int)args.Event.X;
                int y = (int)args.Event.Y;

                bool inside = PointInRectangle(child.SouthEast, x, y);
                _action = inside ? NodeViewAction.Resize : NodeViewAction.DragChild;

                child.DragStart = new Point(x, y);

                Rectangle childAlloc = child.Child.Allocation;
                child.DragDelta = new Point(x - (childAlloc.X + childAlloc.Width), y - (childAlloc.Y + childAlloc.Height));
            }

            args.RetVal = false;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeViewEventArgs"/> class for the specified tree node and with
 /// the specified type of action that raised the event.
 /// </summary>
 /// <param name="node">The <see cref="Node"/> that the event is responding to.</param>
 /// <param name="action">The type of <see cref="NodeViewAction"/> that raised the event.</param>
 public NodeViewEventArgs(Node node, NodeViewAction action)
 {
     Node   = node;
     Action = action;
 }
Exemplo n.º 4
0
 private void NodeDragEndEventHandler(object sender, EventArgs args)
 {
     _action = NodeViewAction.None;
     ((Widget)sender).Parent.QueueDraw();
 }
Exemplo n.º 5
0
 private void NodeDragBeginEventHandler(object sender, NodeSocketDragEventArgs args)
 {
     _action = NodeViewAction.DragConnection;
     _x0     = args.X;
     _y0     = args.Y;
 }
Exemplo n.º 6
0
        // ---- CONSTRUCTORS & DESTRUCTOR ------------------------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="NodeViewCancelEventArgs"/> class with the specified tree node,
        /// a value specifying whether the event is to be canceled, and the type of tree view action that raised the
        /// event.
        /// </summary>
        /// <param name="node">The <see cref="Node"/> that the event is responding to.</param>
        /// <param name="cancel"><c>true</c> to cancel the event; otherwise, <c>false</c>.</param>
        /// <param name="action">One of the <see cref="NodeViewAction"/> values indicating the type of action that
        /// raised the event.</param>
        public NodeViewCancelEventArgs(Node node, bool cancel, NodeViewAction action)
            : base(cancel)
        {
            Node   = node;
            Action = action;
        }