Slider.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <etk/Color.hpp>
10 #include <ewol/debug.hpp>
11 #include <ewol/widget/Widget.hpp>
13 #include <esignal/Signal.hpp>
14 
15 namespace ewol {
16  namespace widget {
17  class Slider;
18  using SliderShared = ememory::SharedPtr<ewol::widget::Slider>;
19  using SliderWeak = ememory::WeakPtr<ewol::widget::Slider>;
23  class Slider : public ewol::Widget {
24  public: // signals
25  esignal::Signal<float> signalChange;
26  public:
27  //eproperty::Value<std::string> propertyShape; //!< name of the shape used
32  protected:
33  Slider();
34  public:
35  DECLARE_WIDGET_FACTORY(Slider, "Slider");
36  virtual ~Slider();
37  public:
38  // TODO : Rewoek the color in the theme ...
39  void setColor(etk::Color<> _newColor) {
40  m_textColorFg = _newColor;
41  };
42  protected:
46  void updateValue(float _newValue);
47  public: // Derived function
48  void onDraw() override;
49  void calculateMinMaxSize() override;
50  void onRegenerateDisplay() override;
51  bool onEventInput(const ewol::event::Input& _event) override;
52  protected:
53  virtual void onChangePropertyValue();
54  virtual void onChangePropertyMinimum();
55  virtual void onChangePropertyMaximum();
56  virtual void onChangePropertyStep();
57  };
58  }
59 }
60 
void calculateMinMaxSize() override
calculate the minimum and maximum size (need to estimate expend properties of the widget) ...
void onDraw() override
Common widget drawing function (called by the drawing thread [Android, X11, ...]) ...
Definition: Input.hpp:12
ewol::compositing::Drawing m_draw
drawing tool.
Definition: Slider.hpp:41
Definition: Drawing.hpp:17
eproperty::Value< float > propertyMaximum
maximum value of the slider
Definition: Slider.hpp:30
eproperty::Value< float > propertyMinimum
minimum value of the slider
Definition: Slider.hpp:29
Definition: Slider.hpp:23
Definition: Area.hpp:16
void onRegenerateDisplay() override
Event generated when a redraw is needed.
eproperty::Value< float > propertyValue
current value of the Slider
Definition: Slider.hpp:28
eproperty::Value< float > propertyStep
step of every iteration of the slider (increment/precision)
Definition: Slider.hpp:31
bool onEventInput(const ewol::event::Input &_event) override
Event on an input of this Widget (finger, mouse, stilet)
etk::Color m_textColorFg
Text color.
Definition: Slider.hpp:44
Widget class is the main widget interface, it hase some generic properties: :** known his parent :** ...
Definition: Widget.hpp:73
etk::Color m_textColorBg
Background color.
Definition: Slider.hpp:45