ContainerN.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <ewol/debug.hpp>
10 #include <ewol/widget/Widget.hpp>
11 #include <list>
12 
13 namespace ewol {
14  namespace widget {
15  class ContainerN;
16  using ContainerNShared = ememory::SharedPtr<ewol::widget::ContainerN>;
17  using ContainerNWeak = ememory::WeakPtr<ewol::widget::ContainerN>;
22  class ContainerN : public ewol::Widget {
23  public: // properties:
25  protected:
26  std::list<ewol::WidgetShared> m_subWidget;
27  protected:
31  ContainerN();
32  public:
36  virtual ~ContainerN();
37  protected:
39  // herited function
40  virtual bvec2 canExpand() override;
41  public:
45  virtual void subWidgetRemoveAll();
49  virtual void subWidgetRemoveAllDelayed();
55  virtual void subWidgetReplace(ewol::WidgetShared _oldWidget,
56  ewol::WidgetShared _newWidget);
62  virtual int32_t subWidgetAdd(ewol::WidgetShared _newWidget);
64  inline int32_t subWidgetAddBack(ewol::WidgetShared _newWidget) {
65  return subWidgetAdd(_newWidget);
66  };
68  inline int32_t subWidgetAddEnd(ewol::WidgetShared _newWidget) {
69  return subWidgetAdd(_newWidget);
70  };
76  virtual int32_t subWidgetAddStart(ewol::WidgetShared _newWidget);
78  inline int32_t subWidgetAddFront(ewol::WidgetShared _newWidget) {
79  return subWidgetAddStart(_newWidget);
80  };
85  virtual void subWidgetRemove(ewol::WidgetShared _newWidget);
90  virtual void subWidgetUnLink(ewol::WidgetShared _newWidget);
91  public:
92  void systemDraw(const ewol::DrawProperty& _displayProp) override;
93  void onRegenerateDisplay() override;
94  void onChangeSize() override;
95  void calculateMinMaxSize() override;
96  ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override;
97  ewol::ObjectShared getSubObjectNamed(const std::string& _objectName) override;
98  bool loadXML(const exml::Element& _node) override;
99  void setOffset(const vec2& _newVal) override;
100  void requestDestroyFromChild(const ewol::ObjectShared& _child) override;
101  protected:
102  virtual void onChangePropertyLockExpand();
103  };
104  };
105 };
virtual void subWidgetRemove(ewol::WidgetShared _newWidget)
remove definitly a widget from the system and this layer.
the Cotainer widget is a widget that have an only one subWidget
Definition: ContainerN.hpp:22
Definition: DrawProperty.hpp:15
virtual ~ContainerN()
Destructor.
void systemDraw(const ewol::DrawProperty &_displayProp) override
{SYSTEM} extern interface to request a draw ... (called by the drawing thread [Android, X11, ...]) This function generate a clipping with the viewport openGL system. Like this a widget draw can not draw over an other widget
virtual void subWidgetReplace(ewol::WidgetShared _oldWidget, ewol::WidgetShared _newWidget)
Replace a old subwidget with a new one.
virtual bvec2 canExpand() override
get the expend capabilities (x&y)
bvec2 m_subExpend
reference of the sub element expention requested.
Definition: ContainerN.hpp:38
void calculateMinMaxSize() override
calculate the minimum and maximum size (need to estimate expend properties of the widget) ...
void onChangeSize() override
Parent have set the size and the origin. the container need to update the subwidget property...
void setOffset(const vec2 &_newVal) override
set the zoom property of the widget.
int32_t subWidgetAddEnd(ewol::WidgetShared _newWidget)
Definition: ContainerN.hpp:68
ewol::WidgetShared getWidgetAtPos(const vec2 &_pos) override
get the widget at the specific windows absolute position
Definition: Area.hpp:16
ContainerN()
Constructor.
int32_t subWidgetAddBack(ewol::WidgetShared _newWidget)
Definition: ContainerN.hpp:64
void onRegenerateDisplay() override
Event generated when a redraw is needed.
bool loadXML(const exml::Element &_node) override
load properties with an XML node.
void requestDestroyFromChild(const ewol::ObjectShared &_child) override
Called by a whild that want to remove pointer of itself from the current list of his parrent...
virtual void subWidgetUnLink(ewol::WidgetShared _newWidget)
Just unlick the specify widget, this function does not remove it from the system (if you can...
virtual int32_t subWidgetAdd(ewol::WidgetShared _newWidget)
add at end position a Widget (note : This system use an inverted phylisophie (button to top...
eproperty::Value< bvec2 > propertyLockExpand
Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget.
Definition: ContainerN.hpp:24
virtual int32_t subWidgetAddStart(ewol::WidgetShared _newWidget)
add at start position a Widget (note : This system use an inverted phylisophie (button to top...
ewol::ObjectShared getSubObjectNamed(const std::string &_objectName) override
Retrive an object with his name (in the global list)
Widget class is the main widget interface, it hase some generic properties: :** known his parent :** ...
Definition: Widget.hpp:73
int32_t subWidgetAddFront(ewol::WidgetShared _newWidget)
Definition: ContainerN.hpp:78
virtual void subWidgetRemoveAll()
remove all sub element from the widget.
virtual void subWidgetRemoveAllDelayed()
remove all sub element from the widget (delayed to prevent remove in the callbback).