galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Popup.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_UI_WIDGETS_POPUP_HPP_
9#define GALAXY_UI_WIDGETS_POPUP_HPP_
10
11#include <functional>
12#include <string_view>
13#include <string>
14
15namespace galaxy
16{
20 class Popup final
21 {
22 public:
28 Popup(std::string_view id) noexcept;
29
33 ~Popup() noexcept;
34
40 void draw_button(const char* text) noexcept;
41
47 void draw_menuitem(const char* text) noexcept;
48
54 void draw(std::move_only_function<void(void)>&& func);
55
56 private:
60 Popup() = delete;
61
62 private:
66 std::string m_id;
67
71 bool m_show;
72 };
73} // namespace galaxy
74
75#endif
std::string m_id
Unique id (name) of the popup.
Definition Popup.hpp:66
bool m_show
Controls state of popup.
Definition Popup.hpp:71
void draw_menuitem(const char *text) noexcept
Draw a menu button to show the popup.
Definition Popup.cpp:29
void draw_button(const char *text) noexcept
Draw the button to show the popup.
Definition Popup.cpp:24
Popup()=delete
Default constructor (deleted).
Popup(std::string_view id) noexcept
Constructor.
Definition Popup.cpp:14
void draw(std::move_only_function< void(void)> &&func)
Show popup.
Definition Popup.cpp:34
Application.hpp galaxy.