+ //show();
+}
+
+
+void TextPainter::horizontalLine(int x, int y, int n, char c)
+{
+ for (int i = 0; i < n && i + x < xmax_; ++i)
+ at(x + i, y) = c;
+}
+
+
+void TextPainter::verticalLine(int x, int y, int n, char c)
+{
+ for (int i = 0; i < n && i + y < ymax_; ++i)
+ at(x, y + i) = c;
+}
+
+
+void TextPainter::draw(int x, int y, char c)
+{
+ //cerr << "drawing char '" << c << "' at " << x << ',' << y << endl;
+ at(x, y) = c;
+ //show();
+}
+
+
+void TextPainter::show(std::ostream & os, int offset) const
+{
+ os << '\n';
+ for (int j = 0; j <= ymax_; ++j) {
+ for (int i = 0; i < offset; ++i)
+ os << ' ';
+ for (int i = 0; i < xmax_; ++i)
+ os << at(i, j);
+ os << '\n';
+ }