/usr/share/SuperCollider/HelpSource/Classes/VLayoutView.schelp is in supercollider-common 1:3.8.0~repack-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | class:: VLayoutView
summary:: A container view that arranges its children vertically
categories:: GUI>Views
related:: Classes/HLayoutView, Classes/CompositeView
DESCRIPTION::
note::
In Qt GUI, this class has been rendered strong::obsolete:: by a special set of layout classes; they are easier to use and more flexible. See link::Classes/VLayout:: for an equivalent to this class, and link::Guides/GUI-Layout-Management:: for a general description of the Qt layout system.
::
VLayoutView can be a parent to other views, and it automatically arranges its child views in vertical order, expanding their width to its own bounds. Only the height of the children is relevant.
When arranging its children, VLayoutView takes the values of their 'minHeight' and 'maxHeight' properties into account. This is useful when a child's link::Classes/View#-resize#resize:: mode is set to 4, 5, or 6. See link::#examples:: below.
VLayoutView inherits some useful formatting methods from its superclasses.
note::
VLayoutView is designed mainly for grouping and placing widgets. While you can set it to accept key presses, it does not accept mouse clicks or drags.
::
CLASSMETHODS::
PRIVATE:: key
EXAMPLES::
code::
(
q = 10;
w = Window.new;
v = VLayoutView(w,Rect(10,10,300,300));
Array.fill(q,{ arg i;
Slider(v,Rect(0,0,75,20)).value_(i / q)
});
w.front
)
// show the area of the view.
v.background_(Color.rand) // The sliders automatically expand to the optimal width
::
Stretching the layout view; Slider height is fixed:
code::
(
q = 10;
w = Window.new;
v = VLayoutView(w,Rect(10,10,300,300));
v.background_(Color.rand);
v.resize = 5; // elastic
Array.fill(q,{ arg i;
var s;
s = Slider(v,Rect(0,0,55,20));// The bounds.width are irrelevant here. They expand to the optimal width
s.value = i / q;
s
});
StaticText(v, Rect(0,0,55,20)).background_(Color.rand).string_("Some Example Text").align_(\center);
w.front
)
::
Stretching the layout view and the contents; if all the contents are elastic, the heights of the contents are perfectly divided up. In this example, the StaticText is not elastic in order to preserve its height.
code::
(
q = 10;
w = Window.new;
v = VLayoutView(w,Rect(10,10,300,300));
v.background_(Color.rand);
v.resize = 5; // elastic
Array.fill(q,{ arg i;
var s;
s = Slider(v,Rect(0,0,75,20));
s.resize = 5; // elastic
s.value = i / q;
s
});
StaticText(v, Rect(0,0,55,40))
.background_(Color.rand).string_("Some Example Text")
.align_(\center);
w.front
)
::
Mixed stretching modes:
code::
(
q = 5;
w = Window.new;
v = VLayoutView(w,Rect(10,10,300,300));
v.resize = 5; // elastic
v.background_(Color.grey);
Array.fill(q,{ arg i;
var s;
s = Slider(v,Rect(0,0,75,20)).background_(Color.rand);
s.value = i / 5;
if(i < 2,{
s.resize = 5; // some elastic
s.setProperty(\minHeight,20);
},{
s.resize = 1; // some not elastic
});
s
});
StaticText(v, Rect(0,0,55,20)).background_(Color.rand).string_("Some Example Text").align_(\center);
w.front
)
::
Set minimum heights; beware that if the layout view height is smaller than the combined height of all the contents, things might disappear when you try to handle them with the mouse:
code::
(
q = 5;
w = Window.new;
v = VLayoutView(w,Rect(10,10,300,300));
v.resize = 5; // elastic
v.background_(Color.grey);
Array.fill(q,{ arg i;
var s;
s = Slider(v,Rect(0,0,75,20)).background_(Color.blue.alpha_(0.2));
s.value = i / 5;
s.resize = 5;
s.setProperty(\minHeight,20);
s.setProperty(\maxHeight,40);
s
});
w.front
)
::
Spacing:
code::
(
q = 10;
w = Window.new;
v = VLayoutView(w,Rect(10,10,300,300));
v.setProperty(\spacing,0);
Array.fill(q,{
Slider(v,Rect(0,0,75,20))
});
w.front
)
::
Nesting: use VLayoutView and HLayoutView in combination:
code::
(
q = 10;
w = Window.new("nesting",Rect(30,30,400,700));
v = VLayoutView(w,Rect(10,10,300,600));
v.background = Color.rand;
Array.fill(q,{ arg i;
Slider(v,Rect(0,0,75,20)).value_(i / q)
});
StaticText(v, Rect(0,0,55,20)).background_(Color.rand).string_("Some Example Text").align_(\center);
h = HLayoutView(v,Rect(10,10,300,300));
Array.fill(q,{ arg i;
Slider(h,Rect(0,0,20,70)).value_(i / q)
});
h.background = Color.rand;
w.front
)
::
|