22 #ifndef KJB_CPP_GUI_BUTTON_H
23 #define KJB_CPP_GUI_BUTTON_H
25 #ifdef KJB_HAVE_OPENGL
28 #include <boost/function.hpp>
41 class Abstract_button :
public Overlay
46 Abstract_button(
int x,
int y,
int width,
int height,
const boost::function0<void>& callback);
49 virtual void render()
const;
51 virtual void render_up()
const = 0;
52 virtual void render_down()
const = 0;
56 bool motion_event(
int cursor_x,
int cursor_y);
58 bool mouse_event(
int button,
int state,
int cursor_x,
int cursor_y);
60 void set_callback(
const boost::function0<void>& callback);
63 bool inside_(
int cursor_x,
int cursor_y);
66 boost::function0<void> click_callback_;
74 class Simple_button :
public Abstract_button
76 typedef Abstract_button Base;
79 Simple_button(
int x,
int y,
int width,
int height,
const boost::function0<void>& callback);
81 virtual void render_up()
const
86 virtual void render_down()
const
92 void render_(
bool down)
const;
height
Definition: APPgetLargeConnectedEdges.m:33
x
Definition: APPgetLargeConnectedEdges.m:100
void render(const Cuboid &c)
Definition: psi_weighted_box.cpp:56