diff options
Diffstat (limited to 'mwe/events/include/uiObject.h')
-rw-r--r-- | mwe/events/include/uiObject.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/mwe/events/include/uiObject.h b/mwe/events/include/uiObject.h index 720d5c2..893232d 100644 --- a/mwe/events/include/uiObject.h +++ b/mwe/events/include/uiObject.h @@ -53,17 +53,18 @@ class Text : public UIObject{ TTF_Font *font; RGBColor color; }; -class TextInput : public UIObject{ - public: - TextInput (int width,int height); - std::string textBuffer; +class TextInput : public UIObject { +public: + TextInput(int width, int height); + std::string textBuffer; std::string placeholder; - size_t caretPosition; - bool isActive; + bool isActive = false; RGBColor textColor; RGBColor backgroundColor; - size_t maxLength; + size_t maxLength = 100; Alignment alignment; - TTF_Font* font; - EventHandler<TextSubmitEvent> onSubmit; + TTF_Font* font = nullptr; + std::function<void()> onSubmit; + std::function<void()> onFocus; }; + |