mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
20 lines
536 B
Text
20 lines
536 B
Text
ctrl CounterCtrl {
|
|
group "Example";
|
|
|
|
GetMinSize() { sz = GetTextSize("X"); sz.cy += 2; return sz; }
|
|
GetStdSize() { sz = GetMinSize(); sz.cx *= 7; return sz; }
|
|
|
|
Frame SetFrame = BlackFrame() @2;
|
|
Font SetFont = StdFont();
|
|
Color Ink = :SBlack;
|
|
Color Paper = :SWhite;
|
|
|
|
Paint(w) {
|
|
r = GetRect();
|
|
DrawCtrlFrame(w, r, .SetFrame);
|
|
w.DrawRect(r, .Paper);
|
|
textsize = GetTextSize("0", .SetFont);
|
|
w.DrawText((r.right + r.left - textsize.cx) / 2,
|
|
(r.bottom + r.top - textsize.cy) / 2, "0", .SetFont, .Ink);
|
|
}
|
|
};
|