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; }
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; }
/// <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; }
private void NodeDragEndEventHandler(object sender, EventArgs args) { _action = NodeViewAction.None; ((Widget)sender).Parent.QueueDraw(); }
private void NodeDragBeginEventHandler(object sender, NodeSocketDragEventArgs args) { _action = NodeViewAction.DragConnection; _x0 = args.X; _y0 = args.Y; }
// ---- 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; }