示例#1
0
文件: GuiListBox.cs 项目: bsimser/CoM
        public ScrollableListBox(int width = 200, int height = 200)
            : base(width, height)
        {
            ScrollArea            = new GuiScrollableArea(Width, Height);
            ScrollArea.Align      = GuiAlignment.Full;
            ScrollArea.ScrollMode = ScrollMode.VerticalOnly;

            ListBox          = new GuiListBox <T>(0, 0, width - (int)GUI.skin.verticalScrollbar.fixedWidth);
            ListBox.AutoSize = true;

            Add(ScrollArea);
            ScrollArea.Add(ListBox);
        }
示例#2
0
文件: GuiListBox.cs 项目: bsimser/CoM
        public FramedListBox(int width = 200, int height = 200, string title = "")
            : base(width, height)
        {
            this.WindowStyle = title == "" ? GuiWindowStyle.Normal : GuiWindowStyle.Titled;
            Title            = title;

            var scrollArea = new GuiScrollableArea(Width, Height);

            scrollArea.Align      = GuiAlignment.Full;
            scrollArea.ScrollMode = ScrollMode.None;

            ListBox       = new GuiListBox <T>(0, 0);
            ListBox.Align = GuiAlignment.Full;

            Add(scrollArea);
            scrollArea.Add(ListBox);
        }