From: Mikko Rasa Date: Sun, 20 Sep 2009 16:27:08 +0000 (+0000) Subject: Add Text class with multiline support X-Git-Tag: 1.1~1 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=1e06dc208a02e68cf1bb127927e3ad5af3657c58;p=libs%2Fgltk.git Add Text class with multiline support Use said class in widgets containing text Support for displaying tooltips in the Root widget --- diff --git a/source/button.cpp b/source/button.cpp index aecfd32..c9bca9a 100644 --- a/source/button.cpp +++ b/source/button.cpp @@ -14,11 +14,12 @@ namespace GLtk { Button::Button(const Resources &r, const std::string &t): Widget(r), + text(style), icon(0), pressed(false) { - set_text(t); update_style(); + set_text(t); } void Button::set_text(const std::string &t) @@ -66,7 +67,8 @@ void Button::pointer_motion(int x, int y) void Button::render_special(const Part &part) const { if(part.get_name()=="text") - render_text(part, text); + //render_text(part, text); + text.render(part, geom); if(part.get_name()=="icon" && icon) { Geometry rgeom; @@ -95,12 +97,12 @@ void Button::render_special(const Part &part) const Button::Loader::Loader(Button &btn): Widget::Loader(btn) { - add("text", &Button::text); + add("text", &Loader::text); } -Button &Button::Loader::get_object() const +void Button::Loader::text(const std::string &t) { - return static_cast