コード例 #1
0
        public void OnGui(Rect rect, SA_InputEvent e)
        {
            StylesInit();

            using (new SA_GuiBeginArea(rect)) {
                if (m_log != null)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.TextArea(m_log.LogString, m_entryDetailedView);
                    EditorGUILayout.Space();

                    if (Event.current.type == EventType.Repaint)
                    {
                        var lastRect = GUILayoutUtility.GetLastRect();
                        m_treeViewRect.x      = rect.x;
                        m_treeViewRect.width  = rect.width;
                        m_treeViewRect.y      = lastRect.y + lastRect.height;
                        m_treeViewRect.height = rect.height - m_treeViewRect.y;
                    }
                }
            }



            m_treeView.OnGUI(m_treeViewRect);
        }
コード例 #2
0
        public void OnGui(Rect rect, SA_InputEvent e)
        {
            Rect treeRect = new Rect(rect);

            treeRect.y      += 15;
            treeRect.height -= 15;

            if (m_treeView.ContentHeight < rect.height)
            {
                treeRect.height = m_treeView.ContentHeight;
            }

            GUI.SetNextControlName(TREE_VIEW_CONTROL_NAME);
            m_treeView.OnGUI(treeRect);
        }
コード例 #3
0
        //--------------------------------------
        // GUI
        //--------------------------------------

        private void OnGUI()
        {
            SetupUI();
            DrawToolbar();

            m_rootViewRect.width  = position.width;
            m_rootViewRect.height = position.height;

            //Stealing focus when mouse inside the window

            if (m_rootViewRect.Contains(Event.current.mousePosition) && focusedWindow != this && GUIUtility.hotControl == 0)
            {
                //No window is focused, so look like Unity Editor is in background
                //Stealing focus in this case maybe pretty harmful. And cause whole application to be expanded from background,
                //without any user action.
                if (focusedWindow == null)
                {
                    return;
                }
                FocusWindowIfItsOpen <UCL_ConsoleWindow>();
            }

            if (m_logsView.SelectedLogs.Count > 0)
            {
                m_stackView.SetLog(m_logsView.SelectedLogs[0]);
            }
            else
            {
                m_stackView.SetLog(null);
            }

            BeginWindows();
            SA_InputEvent e = new SA_InputEvent(Event.current);

            m_rootView.OnGui(m_rootViewRect, e);

            EndWindows();

            Repaint();
        }