Example #1
0
        private static UIHelper CreateTab(UIScrollablePanel mainPanel, string name)
        {
            TabStrip.AddTab(name, 1.25f);

            var tabPanel = mainPanel.AddUIComponent <UIPanel>();

            SetTabSize(tabPanel, mainPanel);
            tabPanel.isVisible = false;
            TabPanels.Add(tabPanel);

            var panel = tabPanel.AddUIComponent <UIScrollablePanel>();

            tabPanel.AddScrollbar(panel);
            panel.verticalScrollbar.eventVisibilityChanged += ScrollbarVisibilityChanged;

            panel.size                 = tabPanel.size;
            panel.relativePosition     = Vector2.zero;
            panel.autoLayout           = true;
            panel.autoLayoutDirection  = LayoutDirection.Vertical;
            panel.clipChildren         = true;
            panel.scrollWheelDirection = UIOrientation.Vertical;

            return(new UIHelper(panel));

            void ScrollbarVisibilityChanged(UIComponent component, bool value)
            {
                panel.width = tabPanel.width - (panel.verticalScrollbar.isVisible ? panel.verticalScrollbar.width : 0);
            }
        }
Example #2
0
        private void CreateEditor <EditorType>() where EditorType : Editor
        {
            var editor = AddUIComponent <EditorType>();

            editor.Active = false;
            editor.Init(this);
            TabStrip.AddTab(editor);

            Editors.Add(editor);
        }
Example #3
0
        private static UIHelper CreateTab(UIPanel mainPanel, string name)
        {
            TabStrip.AddTab(name, 1.25f);

            var tabPanel = mainPanel.AddUIComponent <AdvancedScrollablePanel>();

            tabPanel.Content.autoLayoutPadding = new RectOffset(8, 8, 0, 0);
            SetTabSize(tabPanel, mainPanel);
            tabPanel.isVisible = false;
            TabPanels.Add(tabPanel);

            return(new UIHelper(tabPanel.Content));
        }
Example #4
0
        protected virtual void SetupTabs()
        {
            Log.Verbose("Debugger", "Setup debug window tabs...");

            tabStrip           = new TabStrip("DebuggerTabStrip");
            tabContainer       = new TabContainer("DebuggerTabContainer");
            tabStrip.Container = tabContainer;

            InnerPanel.AttachControl(disposingManager.R(tabStrip));
            InnerPanel.AttachControl(disposingManager.R(tabContainer));

            tabStrip.Anchor           = Anchor.Top | Anchor.CenterHorizontal;
            tabStrip.Size             = new Vector2(5 * 120 + 4, 37);
            tabStrip.RelativePosition = Vector3.zero;

            tabContainer.Anchor           = Anchor.All;
            tabContainer.RelativePosition = new Vector3(0, tabStrip.Height + 2);
            tabContainer.Size             = new Vector2(InnerPanel.Width, InnerPanel.Height - (tabStrip.Height + 2));

            var tab1 = tabStrip.AddTab("Console");

            tab1.Width = 120; tab1.ZOrder = 10;
            tabStrip.AddTab("Log").ZOrder       = 20;
            tabStrip.AddTab("Code").ZOrder      = 30;
            tabStrip.AddTab("Inspector").ZOrder = 40;
            tabStrip.AddTab("Watch").ZOrder     = 50;

            tabStrip.InitiallySelectedIndex = 0;
            tabStrip.SelectedIndex          = 0;

            UIComponent[] tabs = tabStrip.UIComponent.tabs.OfType <UIButton>().ToArray();

            tabPageConsole   = new Panel(tabContainer.Children[0]);
            tabPageLog       = new Panel(tabContainer.Children[1]);
            tabPageCode      = new Panel(tabContainer.Children[2]);
            tabPageInspector = new Panel(tabContainer.Children[3]);
            tabPageWatch     = new Panel(tabContainer.Children[4]);
        }
        private void CreateEditor <EditorType>() where EditorType : BaseEditor
        {
            Log.Debug("LaneManagerPanel.CreateEditor<EditorType>() called");
            var editor = AddUIComponent <EditorType>();

            editor.Init(this);
            TabStrip.AddTab(editor.Name);

            editor.isVisible        = false;
            editor.size             = EditorSize;
            editor.relativePosition = EditorPosition;

            Editors.Add(editor);
        }
Example #6
0
        private UIAdvancedHelper CreateTab(string name, string label)
        {
            TabStrip.AddTab(label, 1.25f);

            var tabPanel = MainPanel.AddUIComponent <AdvancedScrollablePanel>();

            tabPanel.Content.autoLayoutPadding = new RectOffset(8, 8, 0, 0);
            SetTabSize(tabPanel);
            tabPanel.isVisible = false;
            TabPanels.Add(tabPanel);

            var helper = new UIAdvancedHelper(tabPanel.Content);

            Tabs[name] = helper;
            return(helper);
        }