Esempio n. 1
0
        protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow view)
        {
            if (menu.GetItemCount() != 0)
            {
                menu.AddSeparator(string.Empty);
            }
            if (this.parent.window.showMode == ShowMode.MainWindow)
            {
                menu.AddItem(EditorGUIUtility.TextContent("Maximize"), !(this.parent is SplitView), new GenericMenu.MenuFunction2(this.Maximize), (object)view);
            }
            else
            {
                menu.AddDisabledItem(EditorGUIUtility.TextContent("Maximize"));
            }
            menu.AddItem(EditorGUIUtility.TextContent("Close Tab"), false, new GenericMenu.MenuFunction2(this.Close), (object)view);
            menu.AddSeparator(string.Empty);
            System.Type[] paneTypes  = this.GetPaneTypes();
            GUIContent    guiContent = EditorGUIUtility.TextContent("Add Tab");

            foreach (System.Type t in paneTypes)
            {
                if (t != null)
                {
                    GUIContent content = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(t));
                    content.text = guiContent.text + "/" + content.text;
                    menu.AddItem(content, false, new GenericMenu.MenuFunction2(this.AddTabToHere), (object)t);
                }
            }
        }
Esempio n. 2
0
        protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow window)
        {
            base.AddDefaultItemsToMenu(menu, window);

            menu.AddItem(EditorGUIUtility.TrTextContent("Maximize"), !(parent is SplitView), Unmaximize, window);
            menu.AddDisabledItem(EditorGUIUtility.TrTextContent("Close Tab"));
            menu.AddSeparator("");
            IEnumerable <Type> types = GetPaneTypes();

            GUIContent baseContent = EditorGUIUtility.TrTextContent("Add Tab");

            foreach (Type t in types)
            {
                if (t == null)
                {
                    menu.AddSeparator(baseContent.text + "/");
                    continue;
                }

                GUIContent entry = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(t)); // make a copy since we modify the text below
                entry.text = baseContent.text + "/" + entry.text;
                menu.AddDisabledItem(entry);
            }

            menu.AddSeparator("");
            editorWindowBackend?.OnDisplayWindowMenu(menu);
        }
Esempio n. 3
0
        protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow view)
        {
            if (menu.GetItemCount() != 0)
            {
                menu.AddSeparator(string.Empty);
            }
            if (base.parent.window.showMode == ShowMode.MainWindow)
            {
                menu.AddItem(EditorGUIUtility.TextContent("Maximize"), !(base.parent is SplitView), new GenericMenu.MenuFunction2(this.Maximize), view);
            }
            else
            {
                menu.AddDisabledItem(EditorGUIUtility.TextContent("Maximize"));
            }
            menu.AddItem(EditorGUIUtility.TextContent("Close Tab"), false, new GenericMenu.MenuFunction2(this.Close), view);
            menu.AddSeparator(string.Empty);
            Type[]     paneTypes  = base.GetPaneTypes();
            GUIContent gUIContent = EditorGUIUtility.TextContent("Add Tab");

            Type[] array = paneTypes;
            for (int i = 0; i < array.Length; i++)
            {
                Type type = array[i];
                if (type != null)
                {
                    GUIContent gUIContent2 = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(type));
                    gUIContent2.text = gUIContent.text + "/" + gUIContent2.text;
                    menu.AddItem(gUIContent2, false, new GenericMenu.MenuFunction2(this.AddTabToHere), type);
                }
            }
        }
Esempio n. 4
0
        protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow window)
        {
            base.AddDefaultItemsToMenu(menu, window);

            menu.AddItem(EditorGUIUtility.TrTextContent("Maximize"), !(parent is SplitView), Unmaximize, window);
            menu.AddDisabledItem(EditorGUIUtility.TrTextContent("Close Tab"));
            menu.AddSeparator("");
            System.Type[] types = GetPaneTypes();

            GUIContent baseContent = EditorGUIUtility.TrTextContent("Add Tab");

            foreach (System.Type t in types)
            {
                if (t == null)
                {
                    continue;
                }

                GUIContent entry = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(t)); // make a copy since we modify the text below
                entry.text = baseContent.text + "/" + entry.text;
                menu.AddDisabledItem(entry);
            }

            menu.AddSeparator("");
            menu.AddItem(EditorGUIUtility.TextContent("UIElements Debugger _%f5"), false, DebugWindow, window);
        }
        protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow view)
        {
            if (menu.GetItemCount() != 0)
            {
                menu.AddSeparator(string.Empty);
            }
            menu.AddItem(EditorGUIUtility.TextContent("Maximize"), !(base.parent is SplitView), new GenericMenu.MenuFunction2(this.Unmaximize), view);
            menu.AddDisabledItem(EditorGUIUtility.TextContent("Close Tab"));
            menu.AddSeparator(string.Empty);
            Type[]     paneTypes = base.GetPaneTypes();
            GUIContent content   = EditorGUIUtility.TextContent("Add Tab");

            foreach (Type type in paneTypes)
            {
                if (type != null)
                {
                    GUIContent content2;
                    content2 = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(type))
                    {
                        text = content.text + "/" + content2.text
                    };
                    menu.AddDisabledItem(content2);
                }
            }
        }
Esempio n. 6
0
        protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow view)
        {
            base.AddDefaultItemsToMenu(menu, view);

            if (view)
            {
                if (parent.window.showMode == ShowMode.MainWindow)
                {
                    menu.AddItem(EditorGUIUtility.TrTextContent("Maximize"), !(parent is SplitView), Maximize, view);
                }
                else
                {
                    menu.AddDisabledItem(EditorGUIUtility.TrTextContent("Maximize"));
                }
            }

            bool closeAllowed = (window.showMode != ShowMode.MainWindow || AllowTabAction());

            if (closeAllowed)
            {
                menu.AddItem(EditorGUIUtility.TrTextContent("Close Tab"), false, Close, view);
            }
            else
            {
                menu.AddDisabledItem(EditorGUIUtility.TrTextContent("Close Tab"));
            }
            menu.AddSeparator("");

            IEnumerable <Type> types       = GetPaneTypes();
            GUIContent         baseContent = EditorGUIUtility.TrTextContent("Add Tab");

            foreach (Type t in types)
            {
                if (t == null)
                {
                    menu.AddSeparator(baseContent.text + "/");
                    continue;
                }

                GUIContent entry = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(t)); // make a copy since we modify the text below
                entry.text = baseContent.text + "/" + entry.text;
                menu.AddItem(entry, false, AddTabToHere, t);
            }

            menu.AddSeparator("");

            editorWindowBackend?.OnDisplayWindowMenu(menu);
        }
Esempio n. 7
0
        protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow window)
        {
            base.AddDefaultItemsToMenu(menu, window);
            menu.AddItem(EditorGUIUtility.TrTextContent("Maximize", null, null), !(base.parent is SplitView), new GenericMenu.MenuFunction2(this.Unmaximize), window);
            menu.AddDisabledItem(EditorGUIUtility.TrTextContent("Close Tab", null, null));
            menu.AddSeparator("");
            Type[]     paneTypes  = base.GetPaneTypes();
            GUIContent gUIContent = EditorGUIUtility.TrTextContent("Add Tab", null, null);

            Type[] array = paneTypes;
            for (int i = 0; i < array.Length; i++)
            {
                Type type = array[i];
                if (type != null)
                {
                    GUIContent gUIContent2 = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(type));
                    gUIContent2.text = gUIContent.text + "/" + gUIContent2.text;
                    menu.AddDisabledItem(gUIContent2);
                }
            }
        }
Esempio n. 8
0
        protected override void AddDefaultItemsToMenu(GenericMenu menu, EditorWindow view)
        {
            if (menu.GetItemCount() != 0)
            {
                menu.AddSeparator("");
            }
            if (base.parent.window.showMode == ShowMode.MainWindow)
            {
                menu.AddItem(EditorGUIUtility.TextContent("Maximize"), !(base.parent is SplitView), new GenericMenu.MenuFunction2(this.Maximize), view);
            }
            else
            {
                menu.AddDisabledItem(EditorGUIUtility.TextContent("Maximize"));
            }
            if ((base.window.showMode != ShowMode.MainWindow) || (this.GetMainWindowPaneCount() > 1))
            {
                menu.AddItem(EditorGUIUtility.TextContent("Close Tab"), false, new GenericMenu.MenuFunction2(this.Close), view);
            }
            else
            {
                menu.AddDisabledItem(EditorGUIUtility.TextContent("Close Tab"));
            }
            menu.AddSeparator("");
            System.Type[] paneTypes = base.GetPaneTypes();
            GUIContent    content   = EditorGUIUtility.TextContent("Add Tab");

            foreach (System.Type type in paneTypes)
            {
                if (type != null)
                {
                    GUIContent content2 = new GUIContent(EditorWindow.GetLocalizedTitleContentFromType(type));
                    content2.text = content.text + "/" + content2.text;
                    menu.AddItem(content2, false, new GenericMenu.MenuFunction2(this.AddTabToHere), type);
                }
            }
        }
Esempio n. 9
0
 internal GUIContent GetLocalizedTitleContent()
 {
     return(EditorWindow.GetLocalizedTitleContentFromType(base.GetType()));
 }