예제 #1
0
    /*
     * Processes Events running through the component.
     *
     * note: Processes child events first.
     */
    public override void ProcessEvent(Event e)
    {
        // process control point events first
        inPoint.ProcessEvent(e);

        // process subcomponents if necessary
        if (outPoint != null)
        {
            outPoint.ProcessEvent(e);
        }
        if (childContainer != null)
        {
            childContainer.ProcessEvent(e);
        }
        if (splitter != null)
        {
            splitter.ProcessEvent(e);
        }
        if (localFlagDropdown != null)
        {
            localFlagDropdown.ProcessEvent(e);
        }
        if (globalItemDropdown != null)
        {
            globalItemDropdown.ProcessEvent(e);
        }
        if (globalVariableField != null)
        {
            globalVariableField.ProcessEvent(e);
        }

        base.ProcessEvent(e);

        switch (e.type)
        {
        case EventType.MouseDown:
            // handle the start of a drag
            if (SelectionManager.SelectedComponent() == this &&
                e.button == 0 && Contains(e.mousePosition))
            {
                HandleDragStart(e);
            }

            // handle context menu
            if (e.button == 1 && Selected && Contains(e.mousePosition))
            {
                ProcessContextMenu();
                e.Use();
            }
            break;

        case EventType.MouseUp:
            HandleDragEnd();
            break;

        case EventType.MouseDrag:
            // handle Node moving
            if (e.button == 0 && Selected)
            {
                HandleDrag(e);
            }
            break;
        }
    }
예제 #2
0
 public void ProcessEvent(Event e)
 {
     positiveOutpoint.ProcessEvent(e);
     negativeOutpoint.ProcessEvent(e);
 }