3 This file is part of libmspgltk
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
17 Label::Label(const Resources &r, const string &t):
25 void Label::autosize()
27 const list<Part> &parts=style->get_parts();
28 const Part *text_part=0;
29 for(list<Part>::const_iterator i=parts.begin(); (!text_part && i!=parts.end()); ++i)
30 if(i->get_name()=="text")
33 geom.h=text.get_height();
34 geom.w=text.get_width();
37 const Sides &margin=text_part->get_margin();
38 geom.w+=margin.left+margin.right;
39 geom.h+=margin.top+margin.bottom;
43 void Label::set_text(const string &t)
48 void Label::render_special(const Part &part) const
50 if(part.get_name()=="text")
51 text.render(part, geom);
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;