Example #1
0
        private new void Layout(uiPanel p)
        {
            base.doLayout();

            cList.alignTop();
            cList.alignLeftSide();
            cList.FloodY();

            catPanel.moveRightOf(cList);
            catPanel.FloodXY();
        }
Example #2
0
        public DevMenu()
        {
            onLayout += DevMenu_onLayout;
            Title     = "DevMenu";
            Set_Size(800, 600);
            Center();

            list = uiControl.Create <uiListView>(this);
            list.alignTop();
            list.alignLeftSide();
            list.Set_Margin(0, 4, 0, 0);

            tabPanel = uiControl.Create <uiTabPanel>(this);
            tabPanel.Autosize_Method = AutosizeMethod.FILL;
            //tabPanel.local_style.normal.background = null;

            foreach (var kvp in Menus)
            {
                string eStr = Enum.GetName(typeof(Dev_Menu_Type), kvp.Key);
                var    tab  = tabPanel.Add_Tab();
                tab.Scrollable      = false;
                Menus[kvp.Key].Tab  = tab;
                Menus[kvp.Key].Type = kvp.Key;

                switch (kvp.Key)
                {
                case Dev_Menu_Type.HIERARCHY:
                    Create <Dev_Hierarchy_Browser>(tab);
                    break;

                case Dev_Menu_Type.SPAWN:
                    Create <Dev_SpawnMenu>(tab);
                    break;

                default:
                    SLog.Warn("Unhandled Dev_Menu type: {0}", eStr);
                    break;
                }

                var itm = uiControl.Create <uiListItem>();
                itm.Title       = kvp.Value.Title;
                itm.Description = kvp.Value.Description;
                itm.onSelected += (uiControl c) => { Set_Active_Menu(kvp.Value.Type); };
                list.Add(itm);
            }
        }