aboutsummaryrefslogtreecommitdiff
path: root/mwe/events/src/uiObject.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-05 16:12:47 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-05 16:12:47 +0100
commite36ea050972fcaaf3d85d672755bad4ebb2dcd80 (patch)
tree5145e0b66650eea1df301106b7d197a586be65f3 /mwe/events/src/uiObject.cpp
parent333b07775be1ef20fdb5909672c1e4dcabec1b40 (diff)
parentb770475741b7c33d57331f3139c55a3f237ad274 (diff)
merge `master` into `loek/savemgr`
Diffstat (limited to 'mwe/events/src/uiObject.cpp')
-rw-r--r--mwe/events/src/uiObject.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/mwe/events/src/uiObject.cpp b/mwe/events/src/uiObject.cpp
new file mode 100644
index 0000000..8405469
--- /dev/null
+++ b/mwe/events/src/uiObject.cpp
@@ -0,0 +1,24 @@
+#include "uiObject.h"
+
+// Constructor for UIObject
+UIObject::UIObject(int width, int height) : width(width), height(height) {}
+
+// Constructor for Button
+Button::Button(int width, int height) : UIObject(width, height) {}
+
+Text::Text(int width, int height)
+ : UIObject(width, height), size(12), font(nullptr),
+ color{255, 255, 255} { // Default size and color
+ alignment.horizontal = Alignment::Horizontal::CENTER;
+ alignment.vertical = Alignment::Vertical::MIDDLE;
+ alignment.mode = Alignment::PositioningMode::RELATIVE;
+}
+
+TextInput::TextInput(int width, int height)
+ : UIObject(width, height), textBuffer(""), placeholder(""), isActive(false),
+ textColor{255, 255, 255}, backgroundColor{0, 0, 0}, maxLength(100),
+ font(nullptr) {
+ alignment.horizontal = Alignment::Horizontal::LEFT;
+ alignment.vertical = Alignment::Vertical::TOP;
+ alignment.mode = Alignment::PositioningMode::RELATIVE;
+}