Warning: session_start(): open(/var/lib/php/sessions/sess_vqq1tn5itsitdfsucgir5oi4bj, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// currently doesn't use any gaps or margins
sclass VScrollingWrapLayout > AbstractLayoutManager {
settable bool centeredHorizontally;
public void layoutContainer(Container parent) {
L components = getComponents(parent);
class X {
int maxWidth = parent.getWidth();
int x, y;
int lineHeight = 0;
int componentsInLine, i;
void finishLine {
if (centeredHorizontally) {
int x1 = x/2;
for (int j = i-componentsInLine; j < i; j++) {
var c = components.get(j);
Rectangle r = c.getBounds();
c.setBounds(r.x+x1, r.y, r.width, r.height);
}
}
}
void run {
for i over components: {
var c = components.get(i);
Dimension size = c.getPreferredSize();
bool needNewLine = componentsInLine != 0
&& x+size.width > maxWidth;
if (needNewLine) {
finishLine();
y += lineHeight;
x = componentsInLine = lineHeight = 0;
}
c.setBounds(x, y, size.width, size.height);
x += size.width;
lineHeight = max(size.height, lineHeight);
++componentsInLine;
}
finishLine();
preferredSize(maxWidth, y+lineHeight);
}
}
new X().run();
}
}