00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef header_button_generic
00010 #define header_button_generic
00011
00012 #include "API/GUI/button.h"
00013
00014 class CL_Button_Generic
00015 {
00016 public:
00017 static CL_ComponentOptions create_options(
00018 const CL_Rect &pos,
00019 const std::string &text,
00020 bool toggle_mode);
00021
00022 CL_Button_Generic(CL_Button *self, const CL_ComponentOptions &options, CL_StyleManager *style);
00023 ~CL_Button_Generic() {};
00024
00025 CL_Button *button;
00026
00027 void on_key_down(CL_Component *comp, CL_InputDevice *device, CL_Key key);
00028 void on_key_up(CL_Component *comp, CL_InputDevice *device, CL_Key key);
00029 void on_mouse_move(CL_Component *comp, CL_InputDevice *device, int x, int y);
00030
00031 CL_Surface *surface_up;
00032 CL_Surface *surface_down;
00033 CL_Surface *surface_highlighted;
00034 CL_Surface *surface_disabled;
00035
00036 std::string text;
00037 bool toggled;
00038 bool toggle_mode;
00039
00040 bool captured;
00041 bool outside;
00042
00043 CL_Signal_v1<bool> sig_toggled;
00044 CL_Signal_v0 sig_clicked;
00045 CL_Signal_v0 sig_pressed;
00046 CL_Signal_v0 sig_released;
00047
00048 CL_Slot slot_key_down;
00049 CL_Slot slot_key_up;
00050 CL_Slot slot_mouse_move;
00051 };
00052
00053 #endif