Simple SFML GUI  0.2a
PanelModelList.hpp
1 /*
2  * PanelModelList.hpp
3  *
4  * Created on: 02.06.2017
5  * Author: jakub
6  */
7 
8 #ifndef SSG_PANELMODELLIST_HPP_
9 #define SSG_PANELMODELLIST_HPP_
10 
11 #include "MarginModelBase.hpp"
12 
14 public:
15 
16  PanelModelList(float margin = 0.f, MarginMode marginMode = MarginMode::Full);
17 
18  inline static auto create(
19  float margin = 0.f,
20  MarginMode marginMode = MarginMode::Full
21  ) {
22  return std::make_shared<PanelModelList>(margin, marginMode);
23  }
24 
25  virtual void init(const Panel& panel) override;
26  virtual void handleElement(const Panel& panel, Element& element, size_t order) override;
27 
28  void setElementWrap(bool value);
29 
30 private:
31  sf::FloatRect lastArea;
32 
33  float heightInLine = 0.f;
34  float sum = 0.f;
35  float lastSum = -1.f;
36  bool elementWrap = true;
37 };
38 
39 
40 typedef std::shared_ptr<PanelModelList> PanelModelListPtr;
41 
42 
43 #endif /* SSG_PANELMODELLIST_HPP_ */
Definition: Panel.hpp:29
Definition: PanelModelList.hpp:13
Definition: Element.hpp:22
Definition: MarginModelBase.hpp:7