Exemplo n.º 1
0
        protected override void OnAutoHideViewCore(ViewElement autoHidingElement, bool autoHideOnlyActiveView)
        {
            TabGroup tabGroup = autoHidingElement as TabGroup;

            if (tabGroup != null)
            {
                if (autoHideOnlyActiveView)
                {
                    ExpressionView expressionView = tabGroup.SelectedElement as ExpressionView;
                    if (expressionView != null)
                    {
                        expressionView.WasSelectedBeforeAutoHide = false;
                    }
                }
                else
                {
                    foreach (ViewElement viewElement in (IEnumerable <ViewElement>)tabGroup.Children)
                    {
                        ExpressionView expressionView = viewElement as ExpressionView;
                        if (expressionView != null)
                        {
                            expressionView.WasSelectedBeforeAutoHide = expressionView.IsSelected;
                        }
                    }
                }
            }
            base.OnAutoHideViewCore(autoHidingElement, autoHideOnlyActiveView);
        }
Exemplo n.º 2
0
    private void Start()
    {
        activeTabGroup = this;


        OnTabSelected(tabButtons[0]);
    }
Exemplo n.º 3
0
        public BlogWindowContents()
        {
            Urls = new BlogRoutes();

            Tabs = new TabGroup("BlogTabs");
            Tabs.Add(new Tab
            {
                Name           = "Blog",
                CreateFunction = "ep.blog.createBlogTab",
                IconCssClass   = "blog",
                BodyCssClass   = "blog-tab"
            });

            Tabs.Add(new Tab
            {
                Name           = "Drafts",
                CreateFunction = "ep.blog.createDraftsTab",
                IconCssClass   = "drafts",
                BodyCssClass   = "drafts-tab"
            });
            Tabs.Add(new Tab
            {
                Name           = "Published",
                CreateFunction = "ep.blog.createPublishedTab",
                IconCssClass   = "published",
                BodyCssClass   = "published-tab"
            });
        }
Exemplo n.º 4
0
        public void DrawLayer(Layer layer, GameObject parent)
        {
            TabGroup tabGroup = PSDImportUtility.LoadAndInstant <TabGroup>(PSDImporterConst.ASSET_PATH_TABGROUP, layer.name, parent);

            if (layer.layers == null)
            {
                Debug.LogError("error! bad tabgroup layers.");
                return;
            }

            for (int index = 0; index < layer.layers.Length; index++)
            {
                Layer  subLayer  = layer.layers[index];
                string layerName = subLayer.name;           //Shop_Tab:Shop
                if (layerName.ToLower().Contains("_tab"))
                {
                    Tab tab = ImportTabLayer(subLayer, tabGroup.gameObject);
                    tab.group = tabGroup;
                }
                else
                {
                    ctrl.DrawLayer(subLayer, tabGroup.gameObject);
                }
            }
        }
Exemplo n.º 5
0
    private static Dictionary <Type, UiBehaviour> allUis       = null; // idea: use the name of Type not Type

    private static void CheckAndInit()
    {
        if (!isInited)
        {
            //create TabGroups
            tabGroups = new Dictionary <UiTabGroup, TabGroup>();

            // create the enum vals
            Array enumValues  = Enum.GetValues(typeof(UiTabGroup));
            int   groupsCount = enumValues.Length;

            // fill groups by default
            foreach (UiTabGroup currVal in enumValues)
            {
                var group = new TabGroup();
                group.id         = currVal;
                group.currUi     = null;
                group.posibleUis = null;
                tabGroups.Add(currVal, group);
            }
            isInited = true;
        }

        string currSceneName = SceneManager.GetActiveScene().name; // todo paralel scenes support and DontDestoroyOnLoad windows

        if (initedSceneName != currSceneName)
        {
            ReInitUis();
            initedSceneName = currSceneName;
        }
    }
Exemplo n.º 6
0
        public void SetupTabs()
        {
            // Create tab manager instance
            var tabManager = TabManagerFactory.GetTabManager(this.dbConnectionString);

            // Create parent tab
            var tabGroup = new TabGroup
            {
                Name         = RelativityApplicationConstants.ApplicationName,
                Guid         = new Guid(RelativityApplicationConstants.TabGroupGuid),
                DisplayOrder = 10000,
                ExternalLink = null,
                TabDisplay   = TabDisplay.Vertical
            };

            // Create child tabs
            var scheduledJobTab = new Tab
            {
                Name         = RelativityApplicationConstants.ScheduleJobsTabName,
                Guid         = new Guid(RelativityApplicationConstants.TabGuid),
                DisplayOrder = 10001,
                ExternalLink = $"%ApplicationPath%/custompages/{RelativityApplicationConstants.ApplicationGuid}/",
                TabDisplay   = TabDisplay.Vertical
            };

            tabGroup.ChildTabs.Add(scheduledJobTab);

            // Configure tabs
            tabManager.ConfigureTabGroup(tabGroup);
        }
Exemplo n.º 7
0
    protected override void OnAlloyShaderEnable()
    {
        m_openCloseAnim = new Dictionary <string, AnimBool>();
        m_propInfo      = new Dictionary <MaterialProperty, AlloyFieldDrawer>();

        foreach (var property in MaterialProperties)
        {
            var drawer = AlloyFieldDrawerFactory.GetFieldDrawer(this, property);
            m_propInfo.Add(property, drawer);
        }

        var allTabs = new List <string>();

        foreach (var drawerProp in m_propInfo)
        {
            var drawer = drawerProp.Value;

            if (drawer is AlloyTabDrawer)
            {
                bool isOpenCur = TabGroup.IsOpen(drawer.DisplayName + MatInst);

                var anim = new AnimBool(isOpenCur)
                {
                    speed = 6.0f, value = isOpenCur
                };
                m_openCloseAnim.Add(drawerProp.Key.name, anim);

                allTabs.Add(drawer.DisplayName);
            }
        }

        m_allTabs = allTabs.ToArray();
        //m_menu = new GenericMenu();
        Undo.undoRedoPerformed += OnUndo;
    }
Exemplo n.º 8
0
    private static void ReInitUis()
    {
        // todo prevent adding copies of ui

        allUis = new Dictionary <Type, UiBehaviour>();

        UiBehaviour[] findedUis = Resources.FindObjectsOfTypeAll <UiBehaviour>();

        Debug.Log($"findedUis.Length {findedUis.Length}");

        // clear posible of groups for writing it by new values (old DontDestoroyable will be re added)
        foreach (var kvp in tabGroups)
        {
            TabGroup tabGroup = kvp.Value;
            tabGroup.posibleUis = new List <UiBehaviour>();
        }

        foreach (UiBehaviour ui in findedUis)
        {
            UiTabGroup groupId = ui.TabGroup;
            TabGroup   group   = tabGroups[groupId];
            group.posibleUis.Add(ui);

            allUis.Add(ui.GetType(), ui);
        }

        foreach (UiBehaviour ui in findedUis)
        {
            if (!ui.isInited)
            {
                ui.ForceHide();
                ui.InitUi();
            }
        }
    }
Exemplo n.º 9
0
    public static void HideCurrentIn(UiTabGroup groupId)
    {
        CheckAndInit();

        TabGroup group = tabGroups[groupId];

        group.SwitchTo(null);
    }
Exemplo n.º 10
0
        /// <summary>
        /// 获取结果
        /// </summary>
        private string GetResult(TabGroup component)
        {
            component.Begin();
            var result = component.ToString();

            _output.WriteLine(result);
            return(result);
        }
 // Start is called before the first frame update
 void Start()
 {
     if (tabGroup == null)
     {
         tabGroup = transform.parent.GetComponent <TabGroup>();
     }
     tabGroup.Subscribe(this);
 }
Exemplo n.º 12
0
    private TabGroup FindTabGroup()
    {
        // The TabGroup is expected to be on the same object as the ToggleGroup.
        ToggleGroup toggleGroup = toggle.group;
        TabGroup    tabGroup    = toggleGroup.GetComponent <TabGroup>();

        return(tabGroup);
    }
Exemplo n.º 13
0
    public override void Init()
    {
        base.Init();
        _backImage = Helper.Find <Image>(transform, "Back");
        TabGroup tabs = GetComponentInChildren <TabGroup>();

        tabs.Init();
    }
Exemplo n.º 14
0
    public void DisableTab(string tab, MaterialProperty prop, int matInst)
    {
        prop.floatValue = 0.0f;
        MaterialEditor.ApplyMaterialPropertyDrawers(Targets);
        RepaintScene();

        m_openCloseAnim[prop.name].target = false;
        TabGroup.SetOpen(tab + matInst, false);
    }
Exemplo n.º 15
0
    public UIInventoryState(UIHandler uiHandler, GameObject parentNode) : base(uiHandler, parentNode)
    {
        this.tabGroup  = parentNode.GetComponentInChildren <TabGroup>();
        this.viewGroup = parentNode.transform.Find("Views").GetComponent <ViewGroup>();
        Transform description = parentNode.transform.Find("Description");

        title   = description.Find("Title").GetComponent <PFontText>();
        content = description.Find("Content").GetComponent <PFontText>();
    }
Exemplo n.º 16
0
 private void RegisterTabListener()
 {
     if (tabGroup.IsActive() && !isRegisterTabEvent)
     {
         tabGroup = tabGroup.GetComponent <TabGroup>();
         tabGroup.AddTabsClickEvent(OnTabClick);
         isRegisterTabEvent = true;
     }
 }
Exemplo n.º 17
0
        protected override int Compare(TabGroup child1, TabGroup child2)
        {
            var xComparision = child1.transform.position.x.CompareTo(child2.transform.position.x);

            if (xComparision != 0)
            {
                return(xComparision);
            }
            return(-child1.transform.position.y.CompareTo(child2.transform.position.y));
        }
Exemplo n.º 18
0
    // other name candidates ToggleOn, Show, SwitchTo
    public static void Show <T>() where T : UiBehaviour
    {
        CheckAndInit();

        UiBehaviour newUi = Get <T>();

        TabGroup group = tabGroups[newUi.TabGroup];

        group.SwitchTo(newUi);
    }
Exemplo n.º 19
0
    public void EnableTab(string tab, string toggleName, int matInst)
    {
        m_openCloseAnim[toggleName].value = false;
        TabGroup.SetOpen(tab + matInst, true);

        GetProperty(MaterialProperty.PropType.Float, toggleName).floatValue = 1.0f;
        SerializedObject.ApplyModifiedProperties();
        MaterialEditor.ApplyMaterialPropertyDrawers(Targets);

        SceneView.lastActiveSceneView.Repaint();
    }
Exemplo n.º 20
0
        public void Berecne()
        {
            var TabGroupAst = this.TabGroupAst;

            if (null == TabGroupAst)
            {
                return;
            }

            if (!(true == TabGroupAst.VisibleIncludingInheritance))
            {
                return;
            }

            MengeTabAst =
                Optimat.EveOnline.AuswertGbs.Extension.MatchingNodesFromSubtreeBreadthFirst(
                    TabGroupAst, (kandidaat) =>
                    "Tab".EqualsIgnoreCase(kandidaat.PyObjTypName),
                    null, 2, 1, true);

            MengeTabAuswert =
                MengeTabAst?.Select(
                    (tabAst) =>
            {
                var TabAuswert = new SictAuswertGbsTab(tabAst);
                TabAuswert.Berecne();
                return(TabAuswert);
            })
                ?.ToArray();

            var MengeTab =
                MengeTabAuswert
                ?.Select((tabAuswert) => tabAuswert.Ergeebnis)
                ?.Where((tab) => null != tab)
                ?.ToArray();

            var ListeTab =
                MengeTab
                ?.OrderBy(tab => tab.Region.Center().A)
                ?.ToArray();

            var TabSelected =
                (null == MengeTab) ? null :
                MengeTab.FirstOrDefault((kandidaatTab) =>
                                        MengeTab.All((kandidaatKonkurent) => kandidaatKonkurent == kandidaatTab ||
                                                     (kandidaatKonkurent.LabelColorOpacityMilli ?? 0) < kandidaatTab.LabelColorOpacityMilli - 100));

            var Ergeebnis = new TabGroup(TabGroupAst.AsUIElementIfVisible())
            {
                ListTab = ListeTab
            };

            this.Ergeebnis = Ergeebnis;
        }
Exemplo n.º 21
0
    public void DisableTab(string tab, string toggleName, int matInst)
    {
        if (TabGroup.IsOpen(tab + matInst))
        {
            EditorApplication.delayCall += () => CloseTabNow(toggleName);
        }
        else
        {
            CloseTabNow(toggleName);
        }

        m_openCloseAnim[toggleName].target = false;
        TabGroup.SetOpen(tab + matInst, false);
    }
Exemplo n.º 22
0
 private void EnablePage()
 {
     // If the page already exists, just activate it,
     // otherwise create it.
     if (Page != null)
     {
         Page.SetActive(true);
     }
     else
     {
         Page = GameObject.Instantiate(pagePrefab);
         TabGroup tabGroup = FindTabGroup();
         Page.transform.SetParent(tabGroup.TabPageParent, false);
     }
 }
Exemplo n.º 23
0
        public void Close(IToolWindowContent content)
        {
            if (content == null)
            {
                throw new ArgumentNullException(nameof(content));
            }
            var impl = GetTabContentImpl(content);

            Debug.Assert(impl != null);
            if (impl == null)
            {
                return;
            }
            TabGroup.Close(impl);
        }
Exemplo n.º 24
0
        private RibbonBar CreateGroupBar(TabGroup groupConfig)
        {
            var ribbonBar = new RibbonBar
            {
                Text = groupConfig.Name,
                HorizontalItemAlignment = eHorizontalItemsAlignment.Center,
                VerticalItemAlignment   = eVerticalItemsAlignment.Middle,
                AutoOverflowEnabled     = false
            };

            ribbonBar.TitleStyle.TextColor          = AppManager.Instance.Settings.Config.RibbonBarTextColor;
            ribbonBar.TitleStyleMouseOver.TextColor = AppManager.Instance.Settings.Config.RibbonBarTextHoverColor;
            ribbonBar.TitleStyle.TextAlignment      = ribbonBar.TitleStyleMouseOver.TextAlignment = eStyleTextAlignment.Center;
            ribbonBar.Items.Add(CreateBarItem(groupConfig.Items));
            return(ribbonBar);
        }
Exemplo n.º 25
0
 void Awake()
 {
     if (container == null)
     {
         container = transform.FindChild("ListPanel").FindChild("Panel").GetComponent <RectTransform>();
     }
     if (itemPrefab == null)
     {
         itemPrefab = container.FindChild("Item").gameObject;
     }
     if (group == null)
     {
         group = container.GetComponentInChildren <TabGroup>();
     }
     itemPrefab.SetActive(false);
 }
Exemplo n.º 26
0
        private RibbonBar CreateBrowserBar(TabGroup groupConfig)
        {
            var ribbonBar = new RibbonBar
            {
                Text = groupConfig.Name,
                HorizontalItemAlignment = eHorizontalItemsAlignment.Center,
                VerticalItemAlignment   = eVerticalItemsAlignment.Middle,
                AutoOverflowEnabled     = false
            };

            foreach (BaseItem buttonItem in ribbonBarBrowsers.Items)
            {
                ribbonBar.Items.Add((BaseItem)buttonItem.Clone());
            }
            return(ribbonBar);
        }
Exemplo n.º 27
0
        static TabGroup BuildTabGroup(Package package, PackageService service)
        {
            var tabGroup = new TabGroup();

            var tabs = new List <TabGroupTab>();

            tabs.Add(new TabGroupTab
            {
                Name    = "General",
                Content = RenderGeneralTab(package, service)
            });
            tabs.Add(new TabGroupTab
            {
                Name    = "Startup",
                Content = RenderStartup(service)
            });

            if (service.Android != null)
            {
                tabs.Add(new TabGroupTab
                {
                    Name    = "Android",
                    Content = RenderAndroid(service.Android)
                });
            }

            if (service.iOS != null)
            {
                tabs.Add(new TabGroupTab
                {
                    Name    = "iOS",
                    Content = RenderIosTab(service.iOS)
                });
            }
            if (service.Uwp != null)
            {
                tabs.Add(new TabGroupTab
                {
                    Name    = "Windows",
                    Content = RenderUwp(service.Uwp)
                });
            }
            tabGroup.Tabs = tabs.ToArray();
            return(tabGroup);
        }
        private void OnControlPageChanged(Crownwood.DotNetMagic.Controls.TabbedGroups tg, Crownwood.DotNetMagic.Controls.TabPage selectedPage)
        {
            if (selectedPage != null)
            {
                TabPage tabPage = selectedPage.Tag as TabPage;

                if (tabPage.Component.IsStarted == false)
                {
                    tabPage.Component.Start();
                }

                if (selectedPage.Control == null)
                {
                    TabGroup tabGroup = _component.GetTabGroup(tabPage);
                    selectedPage.Control = (Control)tabGroup.Component.GetPageView(tabPage).GuiElement;
                }
            }
        }
Exemplo n.º 29
0
    void OnValidate()
    {
        // Awake probably hasn't been called yet, so set this here.
        toggle = GetComponent <Toggle>();

        // Make sure that this tab is part of a ToggleGroup.
        if (toggle.group == null)
        {
            Debug.LogError("Tab (" + gameObject.name + ") must be part of a ToggleGroup.");
        }

        // Make sure that the ToggleGroup has a TabGroup.
        TabGroup tabGroup = FindTabGroup();

        if (tabGroup == null)
        {
            Debug.LogError("Tab (" + gameObject.name + ")'s ToggleGroup must have a TabGroup.");
        }
    }
Exemplo n.º 30
0
    public override void Draw(AlloyFieldDrawerArgs args)
    {
        TexInst = args.MatInst;

        bool isOpen = TabGroup.Foldout(DisplayName, SaveName, GUILayout.Width(10.0f));

        m_tabOpen.target = isOpen;

        if (m_tabOpen.value)
        {
            EditorGUILayout.BeginFadeGroup(m_tabOpen.faded);
            DrawTextureControls(args);
            EditorGUILayout.EndFadeGroup();
        }

        if (m_tabOpen.isAnimating)
        {
            args.Editor.MatEditor.Repaint();
        }
    }
        private void MoveTabToPosition(DockingGroupTabItem item, DockingGroupTabItem targetPosition, TabGroup parentTabGroup)
        {
            ManagedView.DockManager.LockActiveView();
            parentTabGroup.Move(item.View, parentTabGroup.Items.IndexOf(targetPosition.View));
            ManagedView.DockManager.UnlockActiveView();

            item.ReorderManager._itemMoved = true;

            if (ManagedView.ParentContent is IInputElement)
                _mouseXForFloatingWindow = Mouse.GetPosition(ManagedView.ParentContent as IInputElement).X;
        }
Exemplo n.º 32
0
 private DockingGroupTabItem GetReorderingTabItem(TabGroup tabGroup)
 {
     //Check if any item is currently reordering
     View reorderingView = tabGroup.Items.FirstOrDefault(cur => tabGroup.GetContainer(cur).ReorderManager.IsActive);
     return tabGroup.GetContainer(reorderingView);
 }
        /// <summary>
        /// TODO
        /// </summary>
        private void InitiateFloating()
        {
            if (ManagedView.ParentContent == null)
                return;

            FloatingWindow floatingWindow = new FloatingWindow(_mouseXForFloatingWindow, ManagedView.ParentContent as FrameworkElement)
            {
                Owner = Window.GetWindow(ManagedItem)
            };

            //store the view or it will get destroyed
            View floatingView = ManagedView;

            floatingView.DockManager.AddFunctionalChild(floatingWindow);
            floatingView.ViewGroup.Remove(floatingView);

            //Initialize the floating window content
            TabGroup floatingTabGroup = new TabGroup();
            floatingTabGroup.Add(floatingView);
            floatingWindow.Content = floatingTabGroup;

            floatingWindow.Show();
            //After the window has been fully initialized, start dragging, since it's just been popped out
            if (Mouse.LeftButton == MouseButtonState.Pressed)
                floatingWindow.DragMove();
        }
Exemplo n.º 34
0
        private void MoveTab(DockingGroupTabItem item, DockingGroupTabItem targetItem, TabGroup parentTabGroup)
        {
            ManagedItem.View.DockManager.LockActiveView();
            parentTabGroup.Move(item.View, parentTabGroup.Items.IndexOf(targetItem.View));
            ManagedItem.View.DockManager.UnlockActiveView();

            item.ReorderManager.ItemMoved = true;
        }