void OnGUISpreadsheet(Rect r)
        {
            int currentTableView = (int)CurrentTableView;

            GUILayout.BeginArea(r);

            EditorGUILayout.BeginHorizontal(Styles.MemoryMap.ContentToolbar);


            if (r.width > 200)
            {
                GUILayout.Space(r.width - 200);
            }

            var popupRect = GUILayoutUtility.GetRect(Content.TableModesList[currentTableView], EditorStyles.toolbarPopup);

            if (EditorGUI.DropdownButton(popupRect, Content.TableModesList[currentTableView], FocusType.Passive, EditorStyles.toolbarPopup))
            {
                GenericMenu menu = new GenericMenu();
                for (int i = 0; i < Content.TableModesList.Length; i++)
                {
                    menu.AddItem(Content.TableModesList[i], (int)currentTableView == i, (object data) => { CurrentTableView = (TableDisplayMode)data; m_MemoryMap.Reselect(); }, i);
                }
                menu.DropDown(popupRect);
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            if (m_Spreadsheet != null)
            {
                EditorGUILayout.BeginVertical();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(2);
                m_Spreadsheet.OnGUI(r.width - 4);
                GUILayout.Space(2);
                EditorGUILayout.EndHorizontal();

                GUILayout.Space(2);
                EditorGUILayout.EndVertical();
            }

            EditorGUILayout.EndHorizontal();

            GUILayout.EndArea();
        }
예제 #2
0
        void OnGUISpreadsheet(Rect r)
        {
            if (m_Spreadsheet != null)
            {
                GUILayout.BeginArea(r);
                EditorGUILayout.BeginVertical();
                EditorGUILayout.BeginHorizontal();
                GUILayout.Label("Filters:");

                m_Spreadsheet.OnGui_Filters();
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(2);
                m_Spreadsheet.OnGUI(r.width);
                GUILayout.Space(2);
                EditorGUILayout.EndHorizontal();

                GUILayout.Space(2);
                EditorGUILayout.EndVertical();
                GUILayout.EndArea();
            }

            if (m_EventToOpenNextDraw != null)
            {
                //this must be done after at least one call of m_TreeMap.OnGUI(rectMap)
                //so that m_TreeMap is initialized with the appropriate rect.
                //otherwise the zoom area will generate NaNs.
                OpenHistoryEventImmediate(m_EventToOpenNextDraw);
                m_EventToOpenNextDraw = null;
                m_EventListener.OnRepaint();
            }
            else if (m_TreeMap != null && m_TreeMap.IsAnimated())
            {
                m_EventListener.OnRepaint();
            }
        }
예제 #3
0
        public override void OnGUI(Rect r)
        {
            if (Event.current.type == EventType.Layout)
            {
                if (m_NeedRefresh)
                {
                    m_Spreadsheet.UpdateTable();
                    m_NeedRefresh = false;
                }
            }
            m_UIState.FormattingOptions.ObjectDataFormatter.forceLinkAllObject = false;
            if (m_Spreadsheet != null)
            {
                GUILayout.BeginArea(r);
                EditorGUILayout.BeginVertical();
                EditorGUILayout.BeginHorizontal();
                GUILayout.Label("Filters:");

                m_Spreadsheet.OnGui_Filters();
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(2);
                m_Spreadsheet.OnGUI(r.width);
                GUILayout.Space(2);
                EditorGUILayout.EndHorizontal();

                OnGUI_OptionBar();
                GUILayout.Space(2);
                EditorGUILayout.EndVertical();
                GUILayout.EndArea();
                if (m_NeedRefresh)
                {
                    m_EventListener.OnRepaint();
                }
            }
        }
예제 #4
0
        void OnGUISpreadsheet(Rect r)
        {
            GUILayout.BeginArea(r);

            int currentTableView = (int)CurrentTableView;

            EditorGUILayout.BeginHorizontal(MemoryMapBase.Styles.ContentToolbar);

            if (GUILayout.Toggle(m_ActiveMode == m_UIState.FirstMode, "Snapshot A", EditorStyles.radioButton))
            {
                if (m_ActiveMode != m_UIState.FirstMode)
                {
                    m_ActiveMode = m_UIState.FirstMode as UIState.SnapshotMode;
                    m_MemoryMap.Reselect();
                }
            }

            if (GUILayout.Toggle(m_ActiveMode == m_UIState.SecondMode, "Snapshot B", EditorStyles.radioButton))
            {
                if (m_ActiveMode != m_UIState.SecondMode)
                {
                    m_ActiveMode = m_UIState.SecondMode as UIState.SnapshotMode;
                    m_MemoryMap.Reselect();
                }
            }

            if (r.width > 500)
            {
                GUILayout.Space(r.width - 500);
            }

            var popupRect = GUILayoutUtility.GetRect(Content.TableModesList[currentTableView], EditorStyles.toolbarPopup);

            if (EditorGUI.DropdownButton(popupRect, Content.TableModesList[currentTableView], FocusType.Passive, EditorStyles.toolbarPopup))
            {
                GenericMenu menu = new GenericMenu();
                for (int i = 0; i < Content.TableModesList.Length; i++)
                {
                    menu.AddItem(Content.TableModesList[i], (int)currentTableView == i, (object data) => { CurrentTableView = (TableDisplayMode)data; m_MemoryMap.Reselect(); }, i);
                }
                menu.DropDown(popupRect);
            }

            EditorGUILayout.EndHorizontal();

            if (m_Spreadsheet != null)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.BeginVertical();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(2);
                m_Spreadsheet.OnGUI(r.width - 4);
                GUILayout.Space(2);
                EditorGUILayout.EndHorizontal();

                GUILayout.Space(2);
                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }

            GUILayout.EndArea();
        }