CheckBox.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <ewol/debug.hpp>
12 #include <ewol/widget/Manager.hpp>
13 #include <esignal/Signal.hpp>
14 
15 
16 namespace ewol {
17  namespace widget {
18  class CheckBox;
19  using CheckBoxShared = ememory::SharedPtr<ewol::widget::CheckBox>;
20  using CheckBoxWeak = ememory::WeakPtr<ewol::widget::CheckBox>;
22  public: // Event list
23  esignal::Signal<> signalPressed;
24  esignal::Signal<> signalDown;
25  esignal::Signal<> signalUp;
26  esignal::Signal<> signalEnter;
27  esignal::Signal<bool> signalValue;
28  public: // propertie list
31  private:
32  ewol::compositing::Shaper m_shaper;
33  bool m_mouseHover;
34  bool m_buttonPressed;
35  // hover area :
36  vec2 m_selectableAreaPos;
37  vec2 m_selectableAreaSize;
38  // shaper ids:
39  int32_t m_shaperIdSize;
40  int32_t m_shaperIdSizeInsize;
41  protected:
46  CheckBox();
47  void init() override;
48  public:
49  DECLARE_WIDGET_FACTORY(CheckBox, "CheckBox");
53  virtual ~CheckBox();
54  protected:
59  void changeStatusIn(int32_t _newStatusId);
63  void CheckStatus();
64  protected:
65  void onDraw() override;
66  public:
67  void calculateMinMaxSize() override;
68  void onChangeSize() override;
69  void onRegenerateDisplay() override;
70  bool onEventInput(const ewol::event::Input& _event) override;
71  bool onEventEntry(const ewol::event::Entry& _event) override;
72  protected:
73  esignal::Connection m_PCH;
74 
78  void periodicCall(const ewol::event::Time& _event);
79  protected:
80  virtual void onChangePropertyShape();
81  virtual void onChangePropertyValue();
82  };
83  };
84 };
85 
void CheckStatus()
update the status with the internal satte of the button ...
Definition: Entry.hpp:13
eproperty::Value< std::string > propertyShape
shape of the widget
Definition: CheckBox.hpp:30
CheckBox()
Main checkbox constructor.
void onDraw() override
Common widget drawing function (called by the drawing thread [Android, X11, ...]) ...
Definition: Input.hpp:12
eproperty::Value< bool > propertyValue
Current state of the checkbox.
Definition: CheckBox.hpp:29
bool onEventEntry(const ewol::event::Entry &_event) override
Entry event. represent the physical event :
void onRegenerateDisplay() override
Event generated when a redraw is needed.
the Cotainer widget is a widget that have an only one subWidget
Definition: Container2.hpp:22
Definition: CheckBox.hpp:21
Definition: Time.hpp:14
void periodicCall(const ewol::event::Time &_event)
Periodic call to update grapgic display.
void changeStatusIn(int32_t _newStatusId)
internal system to change the property of the current status
Definition: Area.hpp:16
virtual ~CheckBox()
main destructor.
void calculateMinMaxSize() override
calculate the minimum and maximum size (need to estimate expend properties of the widget) ...
the Shaper system is a basic theme configuration for every widget, it corespond at a background displ...
Definition: Shaper.hpp:39
bool onEventInput(const ewol::event::Input &_event) override
Event on an input of this Widget (finger, mouse, stilet)
esignal::Connection m_PCH
Periodic call handle to remove it when needed.
Definition: CheckBox.hpp:73
void onChangeSize() override
Parent have set the size and the origin. the container need to update the subwidget property...