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