Example #1
0
 private void OnGainedFocus(FocusInEvent evt)
 {
     hasFocus = true;
     UpdateOptionList();
     UpdateVisibility();
     UpdatePosition();
 }
Example #2
0
        void OnFocusInEvent(FocusInEvent evt)
        {
            m_TextElement.edition.SaveValueAndText();

            // When this input field receives focus, make sure the correct text editor is initialized
            // (i.e. hardware keyboard or touchscreen keyboard).
            if (touchScreenTextFieldChanged)
            {
                InitTextEditorEventHandler();
            }

            // When focused and the keyboard availability changes, make sure the correct text editor is
            // initialized under these new conditions and un-focus this input field.
            if (m_HardwareKeyboardPoller == null)
            {
                m_HardwareKeyboardPoller = m_TextElement.schedule.Execute(() =>
                {
                    if (touchScreenTextFieldChanged)
                    {
                        InitTextEditorEventHandler();
                        m_TextElement.Blur();
                    }
                }).Every(250);
            }
            else
            {
                m_HardwareKeyboardPoller.Resume();
            }
        }
Example #3
0
        void OnFocusIn(FocusInEvent e)
        {
            var gv = GetFirstAncestorOfType <VFXView>();

            if (!IsSelected(gv))
            {
                Select(gv, false);
            }
            e.StopPropagation();
        }
            protected override void ExecuteDefaultActionAtTarget(EventBase evt)
            {
                base.ExecuteDefaultActionAtTarget(evt);

                if (elementPanel != null && elementPanel.contextualMenuManager != null)
                {
                    elementPanel.contextualMenuManager.DisplayMenuIfEventMatches(evt, this);
                }

                if (evt?.eventTypeId == ContextualMenuPopulateEvent.TypeId())
                {
                    ContextualMenuPopulateEvent e = evt as ContextualMenuPopulateEvent;
                    int count = e.menu.MenuItems().Count;
                    BuildContextualMenu(e);

                    if (count > 0 && e.menu.MenuItems().Count > count)
                    {
                        e.menu.InsertSeparator(null, count);
                    }
                }
                else if (evt.eventTypeId == FocusInEvent.TypeId())
                {
                    SaveValueAndText();
                }
                else if (evt.eventTypeId == KeyDownEvent.TypeId())
                {
                    KeyDownEvent keyDownEvt = evt as KeyDownEvent;

                    if (keyDownEvt?.keyCode == KeyCode.Escape)
                    {
                        RestoreValueAndText();
                        parent.Focus();
                    }
                }

                editorEventHandler.ExecuteDefaultActionAtTarget(evt);
            }
Example #5
0
 private void OnAttributeValueFocus(FocusInEvent focusInEvent)
 {
     _valuesEditElement.SuggestOptions = _browser !.Query.AttributeValues(_nameEditElement.Value);
 }
Example #6
0
 void OnFocusIn(FocusInEvent evt)
 {
     DropDown();
 }