11 #include <SFML/Graphics.hpp> 16 #include "Element.hpp" 17 #include "HaveBackground.hpp" 18 #include "HaveContextMenu.hpp" 19 #include "HaveEnabled.hpp" 20 #include "PanelModel.hpp" 21 #include "ColorAccess.hpp" 25 const char*
const Area =
"areaupdate";
37 virtual ~
Panel() =
default;
38 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
override;
39 virtual bool update(sf::Vector2f mp,
bool pressLeft,
bool pressRight,
bool aboveHover)
override;
40 virtual void updateArea()
override;
42 const std::shared_ptr<PanelModel>& getModel()
const;
43 void setModel(
const std::shared_ptr<PanelModel>& model);
44 void add(
const ElementPtr& element,
const Element* stop);
45 void add(
const ElementPtr& element);
46 void add(
const std::vector<ElementPtr>& elements);
47 void add(
const std::vector<ElementPtr>&& elements);
48 const ElementPtr
get(
const sf::String& name);
49 const ElementPtr getFront();
50 const std::vector<ElementPtr>& getElements();
51 const std::vector<ElementPtr>& getElements()
const;
53 bool remove(
const Element* ptr);
54 bool remove(
int index);
55 bool removeFirst(
const sf::String& name);
57 virtual void refreshModel(
bool* wasTwice =
nullptr);
60 std::vector<std::shared_ptr<Element>> elements;
61 std::vector<std::pair<bool,std::shared_ptr<Element>>> elementsQueue;
62 std::shared_ptr<PanelModel> model;
63 bool updateRenderTexture;
65 void refreshModelLoop();
66 void updateElements();
69 typedef std::shared_ptr<Panel> PanelPtr;
Definition: HaveBackground.hpp:28
Definition: Checkbox.hpp:13
Definition: ColorAccess.hpp:17
Definition: HaveEnabled.hpp:15
Definition: ColorAccess.hpp:26
Definition: Element.hpp:22