Exemplo n.º 1
0
            protected internal override void ExecuteDefaultActionAtTarget(EventBase evt)
            {
                base.ExecuteDefaultActionAtTarget(evt);

                if ((evt as MouseDownEvent)?.button == (int)MouseButton.LeftMouse)
                {
                    OnMouseDown(evt as MouseDownEvent);
                }
                else if ((evt as KeyDownEvent)?.character == '\n')
                {
                    OnKeyboardEnter();
                }
                else if (evt.GetEventTypeId() == DragUpdatedEvent.TypeId())
                {
                    OnDragUpdated(evt);
                }
                else if (evt.GetEventTypeId() == DragPerformEvent.TypeId())
                {
                    OnDragPerform(evt);
                }
                else if (evt.GetEventTypeId() == DragLeaveEvent.TypeId())
                {
                    OnDragLeave();
                }
            }
Exemplo n.º 2
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            if (evt.GetEventTypeId() == GeometryChangedEvent.TypeId())
            {
                if (m_Attacher != null)
                {
                    PerformTipLayout();
                }
            }
            else if (evt.GetEventTypeId() == DetachFromPanelEvent.TypeId())
            {
                if (m_Attacher != null)
                {
                    m_Attacher.Detach();
                    m_Attacher = null;
                }
            }
            else if (evt.GetEventTypeId() == MouseEnterEvent.TypeId())
            {
                //we make sure we sit on top of whatever siblings we have
                BringToFront();
                ShowText();
            }
            else if (evt.GetEventTypeId() == MouseLeaveEvent.TypeId())
            {
                HideText();
            }


            base.ExecuteDefaultAction(evt);
        }
Exemplo n.º 3
0
 protected internal override void ExecuteDefaultAction(EventBase evt)
 {
     if (evt.GetEventTypeId() == EventBase <PostLayoutEvent> .TypeId())
     {
         if (this.m_Attacher != null)
         {
             this.PerformTipLayout();
         }
     }
     else if (evt.GetEventTypeId() == EventBase <DetachFromPanelEvent> .TypeId())
     {
         if (this.m_Attacher != null)
         {
             this.m_Attacher.Detach();
             this.m_Attacher = null;
         }
     }
     else if (evt.GetEventTypeId() == EventBase <MouseEnterEvent> .TypeId())
     {
         this.ShowText();
     }
     else if (evt.GetEventTypeId() == EventBase <MouseLeaveEvent> .TypeId())
     {
         this.HideText();
     }
     base.ExecuteDefaultAction(evt);
 }
Exemplo n.º 4
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            if (evt.GetEventTypeId() == PostLayoutEvent.TypeId())
            {
                if (m_Attacher != null)
                {
                    PerformTipLayout();
                }
            }
            else if (evt.GetEventTypeId() == DetachFromPanelEvent.TypeId())
            {
                if (m_Attacher != null)
                {
                    m_Attacher.Detach();
                    m_Attacher = null;
                }
            }
            else if (evt.GetEventTypeId() == MouseEnterEvent.TypeId())
            {
                ShowText();
            }
            else if (evt.GetEventTypeId() == MouseLeaveEvent.TypeId())
            {
                HideText();
            }


            base.ExecuteDefaultAction(evt);
        }
Exemplo n.º 5
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            if (m_ConnectorBox == null || m_ConnectorBoxCap == null)
            {
                return;
            }

            if (evt.GetEventTypeId() == MouseEnterEvent.TypeId())
            {
                m_ConnectorBoxCap.style.backgroundColor = portColor;
            }
            else if (evt.GetEventTypeId() == MouseLeaveEvent.TypeId())
            {
                UpdateCapColor();
            }
            else if (evt.GetEventTypeId() == MouseUpEvent.TypeId())
            {
                // When an edge connect ends, we need to clear out the hover states
                var mouseUp = (MouseUpEvent)evt;
                if (!layout.Contains(mouseUp.localMousePosition))
                {
                    UpdateCapColor();
                }
            }
        }
Exemplo n.º 6
0
 protected internal override void ExecuteDefaultAction(EventBase evt)
 {
     base.ExecuteDefaultAction(evt);
     if (evt.GetEventTypeId() == EventBase <AttachToPanelEvent> .TypeId())
     {
         this.AddWatch();
     }
     else if (evt.GetEventTypeId() == EventBase <DetachFromPanelEvent> .TypeId())
     {
         this.RemoveWatch();
     }
 }
Exemplo n.º 7
0
 protected internal override void ExecuteDefaultAction(EventBase evt)
 {
     base.ExecuteDefaultAction(evt);
     if (evt.GetEventTypeId() == EventBase <MouseDownEvent> .TypeId())
     {
         this.OnCurveClick();
     }
     else if (evt.GetEventTypeId() == EventBase <DetachFromPanelEvent> .TypeId())
     {
         this.OnDetach();
     }
 }
Exemplo n.º 8
0
 public virtual void ExecuteDefaultAction(EventBase evt)
 {
     if (evt.GetEventTypeId() == FocusEvent.TypeId())
     {
         editorEngine.OnFocus();
     }
     else if (evt.GetEventTypeId() == BlurEvent.TypeId())
     {
         editorEngine.OnLostFocus();
         editorEngine.SelectNone();
     }
 }
Exemplo n.º 9
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            if (evt.GetEventTypeId() == FocusEvent.TypeId())
            {
                m_SetKbControl = true;
            }
            if (evt.GetEventTypeId() == BlurEvent.TypeId())
            {
                m_ResetKbControl = true;
            }
        }
Exemplo n.º 10
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            if (evt.GetEventTypeId() == FocusEvent.TypeId())
            {
                m_SetKbControl = true;
                // Make sure the inner IMGUIContainer is receiving the focus
                m_ColorField.Focus();
            }

            if (evt.GetEventTypeId() == BlurEvent.TypeId())
            {
                m_ResetKbControl = true;
            }
        }
Exemplo n.º 11
0
        public virtual void ExecuteDefaultAction(EventBase evt)
        {
            if (evt.GetEventTypeId() == FocusEvent.TypeId())
            {
                editorEngine.OnFocus();

                // Make sure to select all text, OnFocus() does not call SelectAll for multiline text field.
                // However, in IMGUI it will be call later by the OnMouseUp event.
                editorEngine.SelectAll();
            }
            else if (evt.GetEventTypeId() == BlurEvent.TypeId())
            {
                editorEngine.OnLostFocus();
                editorEngine.SelectNone();
            }
        }
Exemplo n.º 12
0
 protected internal override void ExecuteDefaultAction(EventBase evt)
 {
     base.ExecuteDefaultAction(evt);
     if (evt.GetEventTypeId() == EventBase <MouseDownEvent> .TypeId())
     {
         this.OnMouseDown();
     }
     else if (evt.GetEventTypeId() == EventBase <IMGUIEvent> .TypeId())
     {
         this.OnIMGUI(evt);
     }
     else if (evt.GetEventTypeId() == EventBase <MouseLeaveEvent> .TypeId())
     {
         this.OnMouseLeave();
     }
 }
Exemplo n.º 13
0
 protected internal override void ExecuteDefaultActionAtTarget(EventBase evt)
 {
     if (evt.GetEventTypeId() == KeyDownEvent.TypeId())
     {
         m_ColorField.HandleEvent(evt);
     }
 }
Exemplo n.º 14
0
        void OnMouseHover(EventBase evt)
        {
            VFXView view = GetFirstAncestorOfType <VFXView>();

            if (view == null)
            {
                return;
            }
            VFXBlackboard blackboard = view.blackboard;

            if (blackboard == null)
            {
                return;
            }
            VFXBlackboardRow row = blackboard.GetRowFromController(controller.parentController);

            if (row == null)
            {
                return;
            }

            if (evt.GetEventTypeId() == MouseEnterEvent.TypeId())
            {
                row.AddToClassList("hovered");
            }
            else
            {
                row.RemoveFromClassList("hovered");
            }
        }
Exemplo n.º 15
0
            protected internal override void ExecuteDefaultActionAtTarget(EventBase evt)
            {
                base.ExecuteDefaultActionAtTarget(evt);

                if (evt.GetEventTypeId() == MouseDownEvent.TypeId())
                {
                    OnMouseDown();
                }
                else if (evt.GetEventTypeId() == IMGUIEvent.TypeId())
                {
                    OnIMGUI(evt);
                }
                else if (evt.GetEventTypeId() == MouseLeaveEvent.TypeId())
                {
                    OnMouseLeave();
                }
            }
Exemplo n.º 16
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            if ((evt as MouseDownEvent)?.button == (int)MouseButton.LeftMouse || (evt as KeyDownEvent)?.character == '\n')
            {
                ShowGradientPicker();
            }
            else if (evt.GetEventTypeId() == DetachFromPanelEvent.TypeId())
            {
                OnDetach();
            }
            else if (evt.GetEventTypeId() == AttachToPanelEvent.TypeId())
            {
                OnAttach();
            }
        }
Exemplo n.º 17
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            if (evt.GetEventTypeId() == MouseDownEvent.TypeId())
            {
                OnClick();
            }
            else if (evt.GetEventTypeId() == DetachFromPanelEvent.TypeId())
            {
                OnDetach();
            }
            else if (evt.GetEventTypeId() == AttachToPanelEvent.TypeId())
            {
                OnAttach();
            }
        }
Exemplo n.º 18
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            if ((evt as MouseDownEvent)?.button == (int)MouseButton.LeftMouse || (evt as KeyDownEvent)?.character == '\n')
            {
                ShowCurveEditor();
            }
            else if (evt.GetEventTypeId() == DetachFromPanelEvent.TypeId())
            {
                OnDetach();
            }
            if (evt.GetEventTypeId() == GeometryChangedEvent.TypeId())
            {
                m_TextureDirty = true;
            }
        }
Exemplo n.º 19
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            if (evt.GetEventTypeId() == GeometryChangedEvent.TypeId())
            {
                UpdateSeparators();
            }
            else if (evt.GetEventTypeId() == DetachFromPanelEvent.TypeId())
            {
                graphView = null;
            }
            else if (evt.GetEventTypeId() == AttachToPanelEvent.TypeId())
            {
                graphView = GetFirstAncestorOfType <GraphView>();
            }
        }
Exemplo n.º 20
0
 protected internal override void ExecuteDefaultAction(EventBase evt)
 {
     base.ExecuteDefaultAction(evt);
     if (evt.GetEventTypeId() == EventBase <BlurEvent> .TypeId())
     {
         this.UpdateValueFromText();
     }
 }
Exemplo n.º 21
0
 protected internal override void ExecuteDefaultAction(EventBase evt)
 {
     base.ExecuteDefaultAction(evt);
     if (evt.GetEventTypeId() == EventBase <FocusEvent> .TypeId())
     {
         this.m_SetKbControl = true;
     }
 }
Exemplo n.º 22
0
 protected internal override void ExecuteDefaultAction(EventBase evt)
 {
     base.ExecuteDefaultAction(evt);
     if (evt.GetEventTypeId() == EventBase <FocusEvent> .TypeId())
     {
         this.m_ObjectFieldDisplay.Focus();
     }
 }
Exemplo n.º 23
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            if (evt.GetEventTypeId() == GeometryChangedEvent.TypeId())
            {
                UpdateSeparators();
            }
        }
Exemplo n.º 24
0
            protected internal override void ExecuteDefaultAction(EventBase evt)
            {
                base.ExecuteDefaultAction(evt);

                if (evt.GetEventTypeId() == MouseDownEvent.TypeId())
                {
                    OnMouseDown();
                }
            }
Exemplo n.º 25
0
            protected internal override void ExecuteDefaultAction(EventBase evt)
            {
                base.ExecuteDefaultAction(evt);

                if (evt.GetEventTypeId() == DetachFromPanelEvent.TypeId())
                {
                    OnDetach();
                }
            }
Exemplo n.º 26
0
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            // Focus first field if any
            if (evt.GetEventTypeId() == FocusEvent.TypeId() && m_Fields.Count > 0)
            {
                m_Fields[0].Focus();
            }
        }
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            // Focus first field if any
            if (evt.GetEventTypeId() == FocusEvent.TypeId())
            {
                m_PositionField.Focus();
            }
        }
        protected internal override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);

            // Delegate focus to the control
            if (evt.GetEventTypeId() == FocusEvent.TypeId())
            {
                m_Control.Focus();
            }
        }
Exemplo n.º 29
0
        protected internal override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);

            bool hasChanged = false;

            if (evt.GetEventTypeId() == KeyDownEvent.TypeId())
            {
                KeyDownEvent kde = evt as KeyDownEvent;
                if (kde.character == '\n')
                {
                    UpdateValueFromText();
                }
                else
                {
                    hasChanged = true;
                }
            }
            else if (evt.GetEventTypeId() == ExecuteCommandEvent.TypeId())
            {
                ExecuteCommandEvent commandEvt = evt as ExecuteCommandEvent;
                string cmdName = commandEvt.commandName;
                if (cmdName == EventCommandNames.Paste || cmdName == EventCommandNames.Cut)
                {
                    hasChanged = true;
                }
            }

            if (!isDelayed && hasChanged)
            {
                // Prevent text from changing when the value change
                // This allow expression (2+2) or string like 00123 to remain as typed in the TextField until enter is pressed
                m_UpdateTextFromValue = false;
                try
                {
                    UpdateValueFromText();
                }
                finally
                {
                    m_UpdateTextFromValue = true;
                }
            }
        }
        protected internal override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);

            if (((evt as MouseDownEvent)?.button == (int)MouseButton.LeftMouse) ||
                ((evt.GetEventTypeId() == KeyDownEvent.TypeId()) && ((evt as KeyDownEvent)?.character == '\n') || ((evt as KeyDownEvent)?.character == ' ')))
            {
                ShowMenu();
                evt.StopPropagation();
            }
        }