ContextMenu.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>
14 #include <ewol/widget/Manager.hpp>
15 
16 namespace ewol {
17  namespace widget {
18  class ContextMenu;
19  using ContextMenuShared = ememory::SharedPtr<ewol::widget::ContextMenu>;
20  using ContextMenuWeak = ememory::WeakPtr<ewol::widget::ContextMenu>;
25  public:
26  enum markPosition {
27  markTop,
28  markRight,
29  markButtom,
30  markLeft,
31  markNone
32  };
33  public: // properties
35  eproperty::Value<vec2> propertyArrowPos;
36  eproperty::List<enum markPosition> propertyArrawBorder;
37  protected:
38  ContextMenu();
39  void init() override;
40  public:
41  DECLARE_WIDGET_FACTORY(ContextMenu, "ContextMenu");
42  virtual ~ContextMenu();
43  private:
44  ewol::compositing::Shaper m_shaper;
45 
46  // TODO : Use shaper for the arraw ...
47  ewol::compositing::Drawing m_compositing;
48  etk::Color<> m_colorBorder; // use shaper ID
49 
50 
51  float m_offset;
52  public:
53  void setPositionMarkAuto(const vec2& _origin, const vec2& _size);
54  void setPositionMark(enum markPosition _position, const vec2& _arrowPos);
55  protected:
56  void onDraw() override;
57  public:
58  void onRegenerateDisplay() override;
59  bool onEventInput(const ewol::event::Input& _event) override;
60  void onChangeSize() override;
61  void calculateMinMaxSize() override;
62  ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override;
63  protected:
64  virtual void onChangePropertyArrowPos();
65  virtual void onChangePropertyArrawBorder();
66  virtual void onChangePropertyShape();
67  };
68  };
69 };
70 
void calculateMinMaxSize() override
calculate the minimum and maximum size (need to estimate expend properties of the widget) ...
void onRegenerateDisplay() override
Event generated when a redraw is needed.
ewol::WidgetShared getWidgetAtPos(const vec2 &_pos) override
get the widget at the specific windows absolute position
Definition: Input.hpp:12
the Cotainer widget is a widget that have an only one subWidget
Definition: Container.hpp:21
Definition: ContextMenu.hpp:24
Definition: Drawing.hpp:17
void onChangeSize() override
Parent have set the size and the origin. the container need to update the subwidget property...
Definition: Area.hpp:16
void onDraw() override
Common widget drawing function (called by the drawing thread [Android, X11, ...]) ...
eproperty::Value< std::string > propertyShape
shape of the widget.
Definition: ContextMenu.hpp:34
bool onEventInput(const ewol::event::Input &_event) override
Event on an input of this Widget (finger, mouse, stilet)
the Shaper system is a basic theme configuration for every widget, it corespond at a background displ...
Definition: Shaper.hpp:39