Warning: session_start(): open(/var/lib/php/sessions/sess_l94h148mokok1fscg0nprq548n, 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
!7
module FontPlusMinus > DynPrintLog {
transient volatile bool active;
double scale = 1.25;
transient volatile bool enlarging;
visualize {
ret centerAndSouthWithMargins(super.visualize(), jhgrid(
jbutton("Font +", r { doIt(true) }),
jbutton("Font -", r { doIt(false) })));
}
start {
ownResource(vmBus_onMessage('mouseDown, voidfunc(int x, int y, int button) {
if (!active) ret;
active = false;
final JComponent c = optCast(JComponent, componentAtScreenLocation(x, y));
print("Have component: " + c);
if (c == null) ret;
swing {
Font font = scaleFont(c.getFont(), enlarging ? scale : 1/scale);
c.setFont(font);
print((enlarging ? "Enlarged" : "Shrunk") + " font to " + formatDouble(font.getSize2D(), 1));
}
}));
}
void doIt(bool enlarge) {
enlarging = enlarge;
print("Please click on a component to enlarge its font");
set active;
}
}