#ifndef FRONTEND_GUI_CONTROLS_H_ #define FRONTEND_GUI_CONTROLS_H_ #include #include #include #include #include #include "GUI.h" #include "UINode.h" #include "panels.h" #include "../../window/input.h" #include "../../delegates.h" class Batch2D; class Assets; namespace gui { class Label : public UINode { protected: std::wstring text; std::string fontName; wstringsupplier supplier = nullptr; public: Label(std::string text, std::string fontName="normal"); Label(std::wstring text, std::string fontName="normal"); virtual void setText(std::wstring text); std::wstring getText() const; virtual void draw(const GfxContext* pctx, Assets* assets) override; virtual void textSupplier(wstringsupplier supplier); }; class Image : public UINode { protected: std::string texture; bool autoresize = false; public: Image(std::string texture, glm::vec2 size=glm::vec2(32,32)); virtual void draw(const GfxContext* pctx, Assets* assets) override; virtual void setAutoResize(bool flag); virtual bool isAutoResize() const; }; class Button : public Panel { protected: glm::vec4 pressedColor {0.0f, 0.0f, 0.0f, 0.95f}; std::vector actions; std::shared_ptr