/* ui/text.cc This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #include "ui/paint.h" #include "ui/plaintext.h" namespace ui { PlainText::PlainText(Widget *parent, const char *text) : Widget(parent) { set_label("text"); set_text(text); } PlainText::~PlainText() { } void PlainText::print(const size_t indent) const { std::string marker(""); con_print << aux::pad_left(marker, indent*2) << label() << " \"" << text() << "\"" << std::endl; } void PlainText::clear() { widget_text.clear(); } void PlainText::set_text(const char *text) { if (text) widget_text.assign(text); else widget_text.clear(); } void PlainText::set_text(const std::string &text) { widget_text.assign(text); } void PlainText::draw() { if (!text().size()) return; Paint::set_color(palette()->foreground()); Paint::draw_text(global_location(), font(), text()); } }