Exemplo n.º 1
0
        public Panel(ScriptableObject ownerObject, ContextType contextType, IDataWatchService dataWatch = null, IEventDispatcher dispatcher = null)
        {
            this.ownerObject               = ownerObject;
            this.contextType               = contextType;
            m_DataWatch                    = dataWatch;
            this.dispatcher                = dispatcher;
            stylePainter                   = new StylePainter();
            cursorManager                  = new CursorManager();
            contextualMenuManager          = null;
            m_RootContainer                = new VisualElement();
            m_RootContainer.name           = VisualElementUtils.GetUniqueName("PanelContainer");
            m_RootContainer.persistenceKey = "PanelContainer"; // Required!
            visualTree.SetPanel(this);
            focusController = new FocusController(new VisualElementFocusRing(visualTree));
            m_StyleContext  = new StyleSheets.StyleContext(m_RootContainer);

            allowPixelCaching = true;
        }