ultimatepp/reference/Counter/Counter.usc
mdelfede 263ff5f895 changed svn layout
git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-06-07 22:31:27 +00:00

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);
}
};