Virtual Testbed
Ship dynamics simulator for extreme conditions
Window.hh
1 #ifndef VTESTBED_GUI_WINDOW_HH
2 #define VTESTBED_GUI_WINDOW_HH
3 
4 #include <string>
5 
6 #include <vtestbed/gui/imgui.hh>
7 
8 namespace vtb {
9 
10  namespace gui {
11 
12  class Window {
13 
14  private:
15  std::string _name;
16  bool _show = false;
17 
18  public:
19 
20  inline void show(bool b) { this->_show = b; }
21  inline bool show() const { return this->_show; }
22  inline bool* show_ptr() { return &this->_show; }
23  inline void name(const std::string& rhs) { this->_name = rhs; }
24  inline const std::string& name() const { return this->_name; }
25  inline bool menuItem() { return ImGui::MenuItem(name().data(), nullptr, show_ptr()); }
26 
27  };
28 
29  }
30 
31 }
32 
33 #endif // vim:filetype=cpp
Main namespace.
Definition: convert.hh:9