CrabUI
Loading...
Searching...
No Matches
CUIDropDownTest.cs
1using System;
2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
6using System.Linq;
7
8using Barotrauma;
9using HarmonyLib;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Graphics;
12
13using CrabUI;
14
15namespace CrabUITest
16{
17 public partial class ComponentTest : FillMethods
18 {
19 public static void CUIDropDown(CUIComponent Host)
20 {
21 CUIFrame frame = new CUIFrame(0.2f, 0.2f, 0.6f, 0.6f);
22
23 frame["dd"] = new CUIDropDown()
24 {
25 Absolute = new CUINullRect(x: 100, y: 100),
26 Options = new string[]{
27 "123", "bebebe", "321"
28 },
29 Selected = "bebebe",
30 };
31
33 {
34 Relative = new CUINullRect(w: 0.3f),
35 Absolute = new CUINullRect(300, 100, null, 40),
36 HideChildrenOutsideFrame = false,
37 Style = new CUIStyle(){
38 {"BackgroundColor", "White"},
39 }
40 };
41
42 hl["dd1"] = new CUIDropDown()
43 {
44 FillEmptySpace = new CUIBool2(true, false),
45 Options = new string[]{
46 "123", "bebebe", "321"
47 },
48 Selected = "bebebe",
49 };
50
51 hl["dd2"] = new CUIDropDown()
52 {
53 Absolute = new CUINullRect(x: 100, y: 100),
54 Options = new string[]{
55 "123", "bebebe", "321"
56 },
57 Selected = "bebebe",
58 };
59
60
61
62 frame.Append(hl);
63
64 Host.Append(frame);
65 }
66 }
67}
Base class for all components.
virtual CUIComponent Append(CUIComponent child, string name=null, [CallerMemberName] string memberName="")
Adds children to the end of the list.
Drop down list, aka Select.
Draggable and resizable container for other components.
Definition CUIFrame.cs:16
Resizing components to it's Height and placing them sequentially.
In Fact just an observable dict.
Definition CUIStyle.cs:21
Vector2 but with bools.
Definition CUIBool2.cs:17
Rectangle with float?
Definition CUIRect.cs:104