-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSidebar.pde
More file actions
100 lines (85 loc) · 2.65 KB
/
Sidebar.pde
File metadata and controls
100 lines (85 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class Sidebar
{
final int baseX, baseY;
CheckBox checkbox;
Textfield textfield;
ListBox suggestions;
StringDict lookup;
int timesRun = 0;
RadioButton rb;
Toggle toggle;
Textlabel normal;
Button clear;
Sidebar(int x, int y)
{
baseX = x;
baseY = y;
lookup = new StringDict();
textfield = cp5.addTextfield("textfield")
.setPosition(baseX+10, 10)
.setSize(195, 30)
.setAutoClear(false)
;
textfield.captionLabel().set("Tag Search");
//Load the Listbox for suggestions of the state name
suggestions = cp5.addListBox("Suggestions")
.setPosition(baseX+10, 10+45)
.setSize(195, 250)
;
suggestions.captionLabel().set("");
suggestions.actAsPulldownMenu(false);
suggestions.setColorActive(#F09102);
ListBoxItem it = suggestions.addItem(reader.tags[11], 0);
it.setColor(new CColor(#ff0099, #ff0099, #ff0099, 255, #ff0099));
it.setIsActive(true);
activeTags.add("html");
activeRows.add(reader.table.getRow(11));
lookup.set(Integer.toString(0)+".0", "html");
checkbox = cp5.addCheckBox("checkBox")
.setPosition(baseX+20, baseY + 40)
.setColorForeground(color(120))
.setColorActive(#F09102)
.setColorLabel(color(0))
.setSize(20, 20)
.setItemsPerRow(2)
.setSpacingColumn(60)
.setSpacingRow(20)
.addItem("Questions", 0)
.addItem("Answers", 50)
.addItem("Comments", 100)
.addItem("Upvotes", 150)
.addItem("Downvotes", 200)
.addItem("Favorites", 255)
;
clear = cp5.addButton("clear")
.setValue(0)
.setPosition(baseX+10, 293)
.setSize(188, 15)
.setColorBackground(color(255))
.setColorCaptionLabel(color(0));
;
rb = cp5.addRadioButton("radio")
.setPosition(baseX+20, baseY+200)
.setColorForeground(color(120))
.setColorActive(#ff0099)
.setColorLabel(color(0))
.setSize(20, 20)
.addItem("None", 1)
.addItem("Unique active users", 2)
.addItem("New user registrations", 3)
.addItem("Site views", 4);
toggle = cp5.addToggle("toggle")
.setPosition(450, 105)
.setSize(50, 20)
.setValue(true)
.setMode(ControlP5.SWITCH)
;
}
void show()
{
noFill();
stroke(0);
strokeWeight(4);
rect(baseX, baseY, 200, h);
}
}