12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef HEADER_FLEXLAY_SLIDER_HPP
- #define HEADER_FLEXLAY_SLIDER_HPP
- #include <ClanLib/GUI/component.h>
- class Slider : public CL_Component
- {
- protected:
- virtual ~Slider();
- private:
- std::vector<CL_Slot> slots;
- float start;
- float end;
- float value;
- bool pressed;
- CL_Signal_v1<float> on_change;
- void update_mouse(const CL_InputEvent& event);
- public:
- Slider(const CL_Rect& rect, CL_Component* parent);
- CL_Signal_v1<float>& sig_on_change();
- void set_range(float start, float end);
- void set_value(float value);
- void draw();
- void on_mouse_down(const CL_InputEvent& event);
- void on_mouse_up (const CL_InputEvent& event);
- void on_mouse_move(const CL_InputEvent& event);
- };
- #endif
|