3 This file is part of libmspgltk
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
17 Label::Label(const string &t)
23 void Label::autosize()
28 geom.h = text.get_height();
29 geom.w = text.get_width();
30 if(const Part *text_part = style->get_part("text"))
32 const Sides &margin = text_part->get_margin();
33 geom.w += margin.left+margin.right;
34 geom.h += margin.top+margin.bottom;
38 void Label::set_text(const string &t)
43 void Label::render_special(const Part &part) const
45 if(part.get_name()=="text")
46 text.render(part, geom);
49 void Label::on_style_change()
51 text.set_style(style);
55 Label::Loader::Loader(Label &l):
58 add("text", &Loader::text);
61 void Label::Loader::text(const string &t)
63 static_cast<Label &>(wdg).text = t;