hollyhock
dropDown.hpp
1 #pragma once
2 #include <stdint.h>
3 #include "util.hpp"
4 
6 
8 struct GUIDropDownMenu_Wrapped_VTable {
9  VTABLE_FAKE_ENTRY(5, 0);
10 
11  // Args: dropDownMenuItem, unknown0
12  // unknown0 - always pass 1
13  VTableFunction<void, void *, uint32_t> AddMenuItem;
14 
15  VTABLE_FAKE_ENTRY(28, 1);
16 
17  // Args: visibility
18  VTableFunction<void, uint32_t> SetScrollBarVisibility;
19 };
20 
22 struct GUIDropDownMenu_Wrapped {
23  uint8_t unknown0[0x4C];
24 
25  struct GUIDropDownMenu_Wrapped_VTable *vtable;
26 };
27 
28 class GUIDropDownMenu : public GUIElement {
29 public:
30  enum ScrollBarVisibility : uint32_t {
37  };
38 
40  uint16_t leftX, uint16_t topY, uint16_t rightX, uint16_t bottomY,
41  uint16_t eventID
42  );
43 
45  void AddMenuItem(GUIDropDownMenuItem &dropDownMenuItem);
46 };
47 
49 public:
50  enum Flag : int {
56  FlagEnabled = 1 << 15
57  };
58 
59  GUIDropDownMenuItem(const char *s, int idx, int flags);
60 };
61 
63 extern "C"
64 void *GUIDropDownMenu_ctor(
65  void *dropDownMenu,
66  uint16_t bounds[4],
67  uint16_t eventID, int flags1
68 );
69 
70 extern "C"
71 void *GUIDropDownMenuItem_ctor(
72  void *dropDownMenuItem,
73  int unk0, int unk1,
74  const char *text,
75  int index, int flags,
76  int unk2
77 );
Definition: dropDown.hpp:48
Flag
Definition: dropDown.hpp:50
@ FlagTextAlignLeft
Align the text of the item within the drop down to the left.
Definition: dropDown.hpp:54
@ FlagTextAlignRight
Align the text of the item within the drop down to the right.
Definition: dropDown.hpp:52
@ FlagEnabled
Allow the item to be selected.
Definition: dropDown.hpp:56
GUIDropDownMenuItem(const char *s, int idx, int flags)
Definition: dropDown.cpp:56
Definition: dropDown.hpp:28
void SetScrollBarVisibility(ScrollBarVisibility visibility)
Definition: dropDown.cpp:29
ScrollBarVisibility
Definition: dropDown.hpp:30
@ ScrollBarHidden
Always hide the scroll bar.
Definition: dropDown.hpp:32
@ ScrollBarAlwaysVisible
Always show the scroll bar.
Definition: dropDown.hpp:34
@ ScrollBarVisibleWhenRequired
Only show the scroll bar when required.
Definition: dropDown.hpp:36
GUIDropDownMenu(uint16_t leftX, uint16_t topY, uint16_t rightX, uint16_t bottomY, uint16_t eventID)
Definition: dropDown.cpp:14
void AddMenuItem(GUIDropDownMenuItem &dropDownMenuItem)
Definition: dropDown.cpp:41
Definition: util.hpp:78