}
}
+void Button::on_style_change()
+{
+ text.update_style();
+}
+
Button::Loader::Loader(Button &btn):
Widget::Loader(btn)
private:
virtual const char *get_class() const { return "button"; }
virtual void render_special(const Part &) const;
+
+ virtual void on_style_change();
};
} // namespace GLtk
}
}
+void Entry::on_style_change()
+{
+ text.update_style();
+}
+
Entry::Loader::Loader(Entry &ent):
Widget::Loader(ent)
private:
virtual const char *get_class() const { return "entry"; }
virtual void render_special(const Part &) const;
+
+ virtual void on_style_change();
};
} // namespace GLtk
text.render(part, geom);
}
+void Label::on_style_change()
+{
+ text.update_style();
+}
+
Label::Loader::Loader(Label &l):
Widget::Loader(l)
private:
virtual const char *get_class() const { return "label"; }
virtual void render_special(const Part &) const;
+
+ virtual void on_style_change();
};
} // namespace GLtk
}
}
+void Text::update_style()
+{
+ float font_size=style->get_font()->get_default_size();
+ for(vector<Line>::iterator i=lines.begin(); i!=lines.end(); ++i)
+ i->width=static_cast<unsigned>(style->get_font()->get_string_width(text.substr(i->start, i->length))*font_size);
+}
+
void Text::render(const Part &part, const Geometry &geom) const
{
if(lines.empty())
const std::string &get() const { return text; }
unsigned size() const { return text.size(); }
+ void update_style();
+
void render(const Part &, const Geometry &) const;
Text &operator=(const std::string &);
tgl->set_value(false);
}
+void Toggle::on_style_change()
+{
+ text.update_style();
+}
+
Toggle::Loader::Loader(Toggle &t):
Widget::Loader(t)
virtual void render_special(const Part &) const;
void exclude_siblings();
+
+ virtual void on_style_change();
};
} // namespace GLtk