Пример #1
0
        public override void OnGUI(Rect rect)
        {
            base.OnGUI(rect);
            if (!m_Init)
            {
                m_Init = true;
                m_TreeView.Init(rect, m_DataSource, m_TreeViewGUI, m_TreeViewDragging);
                m_TreeView.ReloadData();
            }

            if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
            {
                m_TreeView.EndPing();
            }

            m_TreeView.OnEvent();
            var controllId = GUIUtility.GetControlID(FocusType.Keyboard);

            m_TreeView.OnGUI(rect, controllId);

            if (GUIUtility.keyboardControl == controllId)
            {
                HandleCommandEventsForTreeView();
            }
        }
Пример #2
0
        public override void OnGUI(Rect rect)
        {
            base.OnGUI(rect);
            if (!m_Init)
            {
                m_Init = true;
                m_TreeView.Init(rect, dataSource, m_TreeViewGUI, m_TreeViewDragging);
                m_TreeView.ReloadData();
                if (OnGUIInitAction != null)
                {
                    OnGUIInitAction();
                }
            }

            if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
            {
                m_TreeView.EndNameEditing(true);
                m_TreeView.EndPing();
            }

            m_TreeView.OnEvent();
            m_TreeView.OnGUI(rect, GUIUtility.GetControlID(FocusType.Keyboard));
            HandleCommandEventsForTreeView();
        }