| 165 | }; |
| 166 | |
| 167 | class Text : public Widget |
| 168 | { |
| 169 | FALCOR_OBJECT(Text) |
| 170 | public: |
| 171 | Text(Widget* parent, std::string_view text = "") : Widget(parent), m_text(text) {} |
| 172 | |
| 173 | const std::string& get_text() const { return m_text; } |
| 174 | void set_text(std::string_view text) { m_text = text; } |
| 175 | |
| 176 | virtual void render() override |
| 177 | { |
| 178 | ScopedID id(this); |
| 179 | if (!m_visible) |
| 180 | return; |
| 181 | ScopedDisable disable(!m_enabled); |
| 182 | ImGui::TextUnformatted(m_text.c_str()); |
| 183 | } |
| 184 | |
| 185 | private: |
| 186 | std::string m_text; |
| 187 | }; |
| 188 | |
| 189 | class ProgressBar : public Widget |
| 190 | { |