-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTabbedView2plus.sc
115 lines (100 loc) · 2.52 KB
/
TabbedView2plus.sc
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/******* by jostM http://www.glyph.de *******/
/******* Part of TabbedView2 Quark *******/
+ TabbedView2{
// use these as examples to make your own class extentions according to your needs
*newBasic{ arg parent, bounds;
var q;
q=this.new(parent, bounds);
if( GUI.id !== \swing) {
q.labelColors_([Color.white.alpha_(0.3)]);
q.backgrounds_([Color.white.alpha_(0.3)]);
}{
q.labelColors_([Color(0.9,0.9,0.9)]);
q.backgrounds_([Color(0.9,0.9,0.9)]);
q.unfocusedColors_([Color(0.8,0.8,0.8)]);
};
^q;
}
*newColorLabels{ arg parent, bounds;
var q;
q=this.newBasic(parent, bounds);
q.labelColors_([Color.red,Color.blue,Color.yellow]);
if( GUI.id !== \swing) {
q.backgrounds_([Color.white.alpha_(0.3)]);
}{
q.backgrounds_([Color(0.9,0.9,0.9)]);
q.unfocusedColors_([Color(0.9,0.75,0.75),
Color(0.75,0.75,0.9),
Color(0.9,0.9,0.75)]);
};
^q;
}
*newColor{ arg parent, bounds;
var q;
q=this.new(parent, bounds);
if( GUI.id !== \swing) {
q.backgrounds_([Color.red.alpha_(0.1),
Color.blue.alpha_(0.1),
Color.yellow.alpha_(0.1)]);
q.unfocusedColors_([Color.red.alpha_(0.2),
Color.blue.alpha_(0.2),
Color.yellow.alpha_(0.2)]);
}{
q.backgrounds_([Color(0.9,0.85,0.85),
Color(0.85,0.85,0.9),
Color(0.9,0.9,0.85)]);
q.unfocusedColors_([Color(0.9,0.75,0.75),
Color(0.75,0.75,0.9),
Color(0.9,0.9,0.75)]);
};
q.labelColors_([Color.red,Color.blue,Color.yellow]);
^q;
}
*newFlat{ arg parent, bounds;
var q;
q=this.newBasic(parent, bounds);
q.tabHeight=14;
q.tabWidth= 70;
q.tabCurve=3;
^q;
}
*newTall{ arg parent, bounds;
var q;
q=this.newBasic(parent, bounds);
q.tabHeight= 30;
q.tabWidth= 70;
q.tabCurve=3;
^q;
}
*newTransparent{ arg parent, bounds;
var q;
q=this.new(parent, bounds);
if( GUI.id !== \swing) {
q.labelColors_([Color.white.alpha_(0.3)]);
}{
q.labelColors_([Color(0.9,0.9,0.9)]);
q.unfocusedColors_([Color(0.8,0.8,0.8)]);
};
q.backgrounds_([Color.clear]);
^q;
}
*newPacked{ arg parent, bounds;
var q;
q=this.new(parent, bounds);
if( GUI.id !== \swing) {
q.labelColors_([Color.white.alpha_(0.3)]);
q.backgrounds_([Color.white.alpha_(0.3)]);
}{
q.labelColors_([Color(0.85,0.85,0.85)]);
q.backgrounds_([Color(0.85,0.85,0.85)]);
q.unfocusedColors_([Color(0.8,0.8,0.8)]);
};
q.tabCurve=3;
q.labelPadding=8;
q.tabHeight=14;
^q;
}
demo{arg i=3, string="tab";
i.do{|i| this.add(string++(i+1).asString)};
}
}