aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/EditBox.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/EditBox.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.Client/EditBox.h')
-rw-r--r--Minecraft.Client/EditBox.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Minecraft.Client/EditBox.h b/Minecraft.Client/EditBox.h
new file mode 100644
index 00000000..9e24553f
--- /dev/null
+++ b/Minecraft.Client/EditBox.h
@@ -0,0 +1,36 @@
+#pragma once
+#include "GuiComponent.h"
+using namespace std;
+class Font;
+class Screen;
+
+class EditBox : public GuiComponent
+{
+private:
+ Font *font;
+ int x;
+ int y;
+ int width;
+ int height;
+ wstring value;
+ unsigned int maxLength;
+ int frame;
+
+public:
+ bool inFocus;
+ bool active;
+private:
+ Screen *screen;
+
+public:
+ EditBox(Screen *screen, Font *font, int x, int y, int width, int height, const wstring& value);
+ void setValue(const wstring& value);
+ wstring getValue();
+ void tick();
+ void keyPressed(wchar_t ch, int eventKey);
+ void mouseClicked(int mouseX, int mouseY, int buttonNum);
+ void focus(bool newFocus);
+ void render();
+ void setMaxLength(int maxLength);
+ int getMaxLength();
+}; \ No newline at end of file