Simple SFML GUI  0.2a
HaveContextMenu.hpp
1 /*
2  * HaveContextMenu.hpp
3  *
4  * Created on: 27.05.2017
5  * Author: jakub
6  */
7 
8 #ifndef SSG_HAVECONTEXTMENU_HPP_
9 #define SSG_HAVECONTEXTMENU_HPP_
10 
11 #include "Pressable.hpp"
12 
13 class HaveContextMenu : public Pressable<const Element&> {
14 public:
16  ~HaveContextMenu();
17 
18  void setMenu(const std::shared_ptr<Element>& menu);
19  virtual void draw(sf::RenderTarget& target, const sf::RenderStates& states) const;
20  virtual bool update(sf::Vector2f pointerPos, bool pressLeft, bool pressRight, bool aboveHover);
21  void setMenuActive(bool menuActive);
22  static HaveContextMenu* getLastActiveContextMenu();
23 
24 private:
25  std::shared_ptr<Element> menu;
26  bool lastPress;
27  bool menuActive;
28 
29  static HaveContextMenu* lastActiveContextMenu;
30 };
31 
32 #endif /* SSG_HAVECONTEXTMENU_HPP_ */
Definition: HaveContextMenu.hpp:13
Definition: Pressable.hpp:42