hollyhock
textBox.hpp
1 #pragma once
2 #include <stdint.h>
3 #include "util.hpp"
4 
6 struct GUITextBox_Wrapped_VTable {
7  VTABLE_FAKE_ENTRY(32, 0);
8 
9  // Args: text
10  VTableFunction<void, const char *> SetText;
11 };
12 
14 struct GUITextBox_Wrapped {
15  uint8_t unknown0[0x4C];
16 
17  struct GUITextBox_Wrapped_VTable *vtable;
18 
19  uint8_t unknown1[0x4];
20 
21  const char *text;
22 
23  uint8_t unknown2[0x48];
24 };
25 static_assert(sizeof(struct GUITextBox_Wrapped) == 0xA0);
26 
27 class GUITextBox : public GUIElement {
28 public:
29  enum Flag {
31  FlagDrawBox = 1 << 3,
32 
34  FlagEditable = 1 << 8
35  };
36 
37  GUITextBox(
38  int x, int y, int width,
39  int maxLength, bool countLengthByBytes
40  );
41  GUITextBox(
42  int x, int y, int width,
43  const char *text, int maxLength, bool countLengthByBytes
44  );
45 
46  const char *GetText();
47  void SetText(const char *text);
48 };
49 
51 extern "C"
52 struct GUITextBox_Wrapped *GUITextBox_ctor(
53  void *textBox,
54  int x, int y, int width,
55  const char *text,
56  int unknown0,
57  int flags,
58  int maxLength, bool countLengthByBytes
59 );
Definition: util.hpp:78
Definition: textBox.hpp:27
Flag
Definition: textBox.hpp:29
@ FlagDrawBox
Enables drawing the text box's outline and background.
Definition: textBox.hpp:31
@ FlagEditable
Allows the contents of the text box to be modified.
Definition: textBox.hpp:34
const char * GetText()
Definition: textBox.cpp:75
GUITextBox(int x, int y, int width, int maxLength, bool countLengthByBytes)
Definition: textBox.cpp:24
void SetText(const char *text)
Definition: textBox.cpp:87