public void ClearLogs()
 {
     m_selectedLogItem = null;
     TempLogManagerForUnityEditor.ClearLogs();
 }
        private void DrawUpperPanel()
        {
            m_upperPanel = new Rect(0, MENU_BAR_HEIGHT, this.position.width, (this.position.height - MENU_BAR_HEIGHT) * m_upperSizeRatio);
            GUILayout.BeginArea(m_upperPanel, m_panelStyle);
            // re-adjust scroller position
            if (m_prevCount < m_currentShowCount)
            {
                if (m_isAutoScroll)
                {
                    m_upperPanelScroll.y = (m_currentShowCount * m_boxItemStyle.fixedHeight) - m_upperPanel.height;
                    m_isAutoScroll       = false;
                }
                else
                {
                    float tempGap = (m_prevCount * m_boxItemStyle.fixedHeight) - m_upperPanel.height;
                    if (tempGap > 0)
                    {
                        if (tempGap - m_upperPanelScroll.y <= m_boxItemStyle.fixedHeight || m_isAutoScroll)
                        {
                            m_upperPanelScroll.y = (m_currentShowCount * m_boxItemStyle.fixedHeight) - m_upperPanel.height;
                        }
                    }
                }
            }
            else if (m_currentShowCount * m_boxItemStyle.fixedHeight < m_upperPanel.height)
            {
                m_isAutoScroll = true;
            }

            m_prevCount        = m_currentShowCount;
            m_upperPanelScroll = GUILayout.BeginScrollView(m_upperPanelScroll);

            // draw items
            for (int i = 0; i < m_currentShowingItems.Count; i++)
            {
                if (DrawLogBox(m_currentShowingItems[i], i % 2 == 0, m_currentShowingItems[i].IsSelected))
                {
                    if (null != m_selectedLogItem)
                    {
                        if (m_currentShowingItems[i] == m_selectedLogItem)
                        {
                            // click a some one, open code
                            JumpToStackTop();
                        }
                        else
                        {
                            m_selectedLogItem.IsSelected = false;
                            m_selectedLogItem            = m_currentShowingItems[i];
                            TempLogManagerForUnityEditor.SetSelectedItem(m_selectedLogItem);
                            m_selectedLogItem.IsSelected = true;
                        }
                    }
                    else
                    {
                        m_selectedLogItem = m_currentShowingItems[i];
                        TempLogManagerForUnityEditor.SetSelectedItem(m_selectedLogItem);
                        m_selectedLogItem.IsSelected = true;
                    }
                    GUI.changed = true;
                }
            }

            GUILayout.EndScrollView();
            GUILayout.EndArea();
        }