TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tbx_interface_slider.hpp
1 
9 #ifndef TurtleBrainsExpress_InterfaceSlider_hpp
10 #define TurtleBrainsExpress_InterfaceSlider_hpp
11 
12 #include <turtle_brains/express/interface/tbx_interface.hpp>
13 #include <turtle_brains/express/interface/tbx_interface_element.hpp>
14 
15 #include <functional>
16 
17 namespace TurtleBrainsExpress
18 {
19  namespace Interface
20  {
21  namespace Unstable
22  {
23  class InterfaceHandlerInterface;
24 
28  class Slider : public Element
29  {
30  public:
31  Slider(void);
32  virtual ~Slider(void) = 0;
33 
34  inline float GetValue(void) const { return mSliderValue; }
35  void SetValue(const float value);
36 
37  protected:
38  void AddSliderGraphic(tbGraphics::Graphic& graphic);
39  void AddSliderGraphic(tbGraphics::Graphic* graphic);
40  void RemoveSliderGraphic(tbGraphics::Graphic* graphic);
41 
42  virtual void OnHandleUserEvent(const UserEvent& userEvent) override;
43  virtual void OnHandleActiveUserEvent(const UserEvent& userEvent) override;
44  virtual void OnActivate(void) override;
45 
46  private:
47  //TODO: TurtleBrainsExpress: Interface:
48  //Having a single "checked graphics" list may prove problematic WRT having the visuals
49  //change with focus/enabled/disabled - but the alternative (having a checked graphics
50  //list for each state, seems not so fun either... Will continue ponder to refactor later.
51  tbGraphics::GraphicList mSliderGraphics;
52  float mSliderValue;
53  };
54 
55  class SimpleSlider : public Slider
56  {
57  public:
58  SimpleSlider(const tbGraphics::PixelSpace& width, const tbGraphics::PixelSpace& height);
59  virtual ~SimpleSlider(void);
60 
61  private:
62  };
63 
64  };
65  }; /* namespace Interface */
66 }; /* namespace TurtleBrainsExpress */
67 
69 
70 #endif /* TurtleBrainsExpress_InterfaceSlider_hpp */
Definition: tb_graphic.hpp:61
Definition: tb_graphic_list.hpp:27
Definition: tbx_interface_slider.hpp:55
A collection of objects and functions to express games quickly.
Definition: tbx_interface.hpp:18
Definition: tbx_interface_slider.hpp:28
tbCore::uint16 PixelSpace
Definition: tb_texture_manager.hpp:36
Definition: tbx_interface_element.hpp:28