コード例 #1
0
        internal override void ApplyTo(FocusController focusController, Focusable f)
        {
            // Unselect selected TextElement on pointer down.
            focusController.selectedTextElement = null;

            f.Focus(); // Call Focus() virtual method when an element is clicked or otherwise focused explicitly.
        }
コード例 #2
0
        public Panel(ScriptableObject ownerObject, ContextType contextType, EventDispatcher dispatcher = null)
        {
            m_VisualTreeUpdater = new VisualTreeUpdater(this);

            this.ownerObject      = ownerObject;
            this.contextType      = contextType;
            this.dispatcher       = dispatcher ?? EventDispatcher.instance;
            repaintData           = new RepaintData();
            cursorManager         = new CursorManager();
            contextualMenuManager = null;
            m_RootContainer       = new VisualElement
            {
                name        = VisualElementUtils.GetUniqueName("unity-panel-container"),
                viewDataKey = "PanelContainer"
            };

            // Required!
            visualTree.SetPanel(this);
            focusController       = new FocusController(new VisualElementFocusRing(visualTree));
            m_ProfileUpdateName   = "PanelUpdate";
            m_ProfileLayoutName   = "PanelLayout";
            m_ProfileBindingsName = "PanelBindings";

            allowPixelCaching = true;
            InvokeHierarchyChanged(visualTree, HierarchyChangeType.Add);
        }
コード例 #3
0
        internal void Blur()
        {
            FocusController expr_07 = this.focusController;

            if (expr_07 != null)
            {
                expr_07.BlurLastFocusedElement();
            }
        }
コード例 #4
0
        internal void Focus()
        {
            FocusController expr_07 = this.focusController;

            if (expr_07 != null)
            {
                expr_07.SetFocusToLastFocusedElement();
            }
        }
コード例 #5
0
        protected override void ExecuteDefaultAction(EventBase evt)
        {
            base.ExecuteDefaultAction(evt);
            bool flag = evt != null && evt.target == evt.leafTarget;

            if (flag)
            {
                FocusController expr_28 = this.focusController;
                if (expr_28 != null)
                {
                    expr_28.SwitchFocusOnEvent(evt);
                }
            }
        }
コード例 #6
0
        public EventDebuggerTrace(IPanel panel, EventBase evt, long duration, IEventHandler mouseCapture)
        {
            this.< eventBase > k__BackingField = new EventDebuggerEventRecord(evt);
            IEventHandler arg_2D_1;

            if (panel == null)
            {
                arg_2D_1 = null;
            }
            else
            {
                FocusController expr_21 = panel.focusController;
                arg_2D_1 = ((expr_21 != null) ? expr_21.focusedElement : null);
            }
            this.< focusedElement > k__BackingField = arg_2D_1;
            this.< mouseCapture > k__BackingField   = mouseCapture;
            this.duration = duration;
        }
コード例 #7
0
        public Panel(ScriptableObject ownerObject, ContextType contextType, EventDispatcher dispatcher)
        {
            this.ownerObject      = ownerObject;
            this.contextType      = contextType;
            this.dispatcher       = dispatcher;
            repaintData           = new RepaintData();
            cursorManager         = new CursorManager();
            contextualMenuManager = null;
            m_VisualTreeUpdater   = new VisualTreeUpdater(this);
            m_RootContainer       = new VisualElement
            {
                name        = VisualElementUtils.GetUniqueName("unity-panel-container"),
                viewDataKey = "PanelContainer"
            };

            // Required!
            visualTree.SetPanel(this);
            focusController = new FocusController(new VisualElementFocusRing(visualTree));

            CreateMarkers();

            InvokeHierarchyChanged(visualTree, HierarchyChangeType.Add);
        }
コード例 #8
0
 internal override void ApplyTo(FocusController focusController, Focusable f)
 {
     f.Focus();
 }
コード例 #9
0
 internal virtual void ApplyTo(FocusController focusController, Focusable f)
 {
     focusController.SwitchFocus(f, this);
 }
コード例 #10
0
        public static T GetPooled(IEventHandler target, Focusable relatedTarget, FocusChangeDirection direction, FocusController focusController, bool bIsFocusDelegated = false)
        {
            T pooled = EventBase <T> .GetPooled();

            pooled.target           = target;
            pooled.relatedTarget    = relatedTarget;
            pooled.direction        = direction;
            pooled.focusController  = focusController;
            pooled.IsFocusDelegated = bIsFocusDelegated;
            return(pooled);
        }
コード例 #11
0
 internal override void ApplyTo(FocusController focusController, Focusable f)
 {
     f.Focus(); // Call Focus() virtual method when an element is clicked or otherwise focused explicitly.
 }