private void RunEvent(Event e)
        {
            if (focusedWindow != this)
            {
                _isFocus = false;
                return;
            }

            _baseRoot.Size = Size;
            if (!_isFocus)
            {
                _isFocus = true;
                foreach (var act in OnWindowFocus)
                {
                    act(this);
                }
            }
            Vector2                 mouse   = e.mousePosition;
            EditorEvent             eEvent  = new EditorEvent(e);
            List <IEditorSeletable> curList = new List <IEditorSeletable>();

            for (int i = FirstChildrenList.Count - 1; i >= 0; --i)
            {
                SelectableCreate(mouse, FirstChildrenList[i] as EditorControl, curList);
            }

            EditorControlDragEventManager.Instance.FilterCtrl(curList, e);
        }
Пример #2
0
 public void StopDrog(EditorControl arg1, EditorEvent arg2, IEditorSeletable arg3)
 {
     if (arg3 == this)
     {
         ReCalculateNode();
         _dragingNode = null;
         arg2.Use();
     }
 }
Пример #3
0
        public void ShowNodeDetial(EditorControl arg1, EditorEvent arg2)
        {
            if (_dragingNode != null)
            {
                return;
            }
            BeTreeNode node = arg1 as BeTreeNode;

            OnNodeClick?.Invoke(node);
            arg2.Use();
        }
Пример #4
0
        private void RunEvent(List <IEditorSeletable> selectable, Event e, Action <IEditorSeletable, EditorEvent> act)
        {
            EditorEvent ev = new EditorEvent(e);

            foreach (IEditorSeletable ies in selectable)
            {
                if (ev.IsUsed())
                {
                    return;
                }

                act(ies, ev);
            }
        }
Пример #5
0
 public void StartDrag(EditorControl ec, EditorEvent e)
 {
     if (e.Event.button != 0)
     {
         return;
     }
     if (e.Event.control)
     {
         _mouseOffset = e.Event.mousePosition - NodePanels.LocalPosition - ec.LocalPosition;
         EditorControlDragEventManager.Instance.StartDragEvent(ec);
         e.Use();
         _isChildDrag = NodeDragType.CtrlDrag;
         _dragingNode = ec;
     }
     else if (e.Event.shift)
     {
         _mouseOffset = e.Event.mousePosition - NodePanels.LocalPosition - ec.LocalPosition;
         EditorControlDragEventManager.Instance.StartDragEvent(ec);
         _isChildDrag = NodeDragType.ShiftDrag;
         _dragingNode = ec;
         e.Use();
     }
 }
Пример #6
0
        public void DropIn(EditorControl root1, EditorEvent e, IEditorSeletable node1)
        {
            BeTreeNode node = node1 as BeTreeNode;
            BeTreeNode root = root1 as BeTreeNode;

            if (node == null || root == null || node == root)
            {
                return;
            }
            switch (_isChildDrag)
            {
            case NodeDragType.CtrlDrag:
                NodeSetToChild?.Invoke(root, node);
                break;

            case NodeDragType.ShiftDrag:
                NodeInsert?.Invoke(root, node);
                break;
            }
            _isChildDrag = NodeDragType.None;
            _dragingNode = null;
            ReCalculateNode();
            e.Use();
        }
Пример #7
0
 private void MouseClick(EditorControl arg1, EditorEvent arg2)
 {
     DetialPanel.Hide();
     NodeSelectedPanel.Active = false;
 }
 private void UseEvent(EditorControl ec, EditorEvent ee)
 {
     ee.Use();
 }