7 Button::Button(const Resources &r, const std::string &t):
14 void Button::set_text(const std::string &t)
19 void Button::render_part(const Part &part) const
21 if(part.get_name()=="text")
23 render_text(part, text);
24 /*const GL::Font *const font=style->get_font();
26 const float font_size=font->get_default_size();
27 unsigned text_w=static_cast<unsigned>(font->get_string_width(text)*font_size);
29 part.get_alignment().apply(geom, text_w, static_cast<unsigned>(font_size));
32 GL::scale_uniform(font_size);
34 const Color &color=style->get_font_color();
35 glColor3f(color.r, color.g, color.b);
36 font->draw_string(text);
42 Widget::render_part(part);
45 void Button::on_button_press(int, int, unsigned btn)
51 void Button::on_button_release(int, int, unsigned btn)
53 if(btn==1/* && x>=0 && y>=0 && x<static_cast<int>(geom.w) && y<static_cast<int>(geom.h)*/)
56 signal_clicked.emit();