#pragma once #include "../Application.hpp" #include "AppWindow.hpp" #include "PageLayout.hpp" #include #include namespace gui { enum class Arrow : bool { Disabled, Enabled }; struct Option { const UTF8 text = ""; std::function activatedCallback = nullptr; Arrow arrow = Arrow::Enabled; Option(const UTF8 &text, std::function cb, Arrow arrow) : text(text), activatedCallback(cb), arrow(arrow) { LOG_INFO("text: %s", text.c_str()); } }; /// creates new `option` label on heap with text description and on activated callback connected Item *newOptionLabel(const UTF8 &text, std::function activatedCallback, Arrow arrow = Arrow::Disabled); Item *newOptionLabel(const Option &option); class OptionWindow : public AppWindow { protected: PageLayout *body = nullptr; public: OptionWindow(app::Application *app, const std::string &name); virtual ~OptionWindow(); void addOptionLabel(const UTF8 &text, std::function activatedCallback, Arrow arrow); /// add options as {text, on click callback } void addOptions(std::list