23 #ifndef M4_GUI_CHEAPO_H 24 #define M4_GUI_CHEAPO_H 26 #include "common/str.h" 27 #include "m4/graphics/gr_buff.h" 28 #include "m4/m4_types.h" 33 constexpr int16 MAX_BUTTONS = 20;
36 NOTHING, IN_CONTROL, OVER_CONTROL, SELECTED, TRACKING
40 BUTTON_0, BUTTON_RELAXED, BUTTON_OVER, BUTTON_PICKED
49 int16 _x1 = 0, _x2 = 0, _y1 = 0, _y2 = 0;
52 RectClass(int16 x1, int16 y1, int16 x2, int16 y2);
55 virtual int16 inside(int16 x, int16 y)
const;
59 void set(int16 x1, int16 y1, int16 x2, int16 y2);
65 char *_string =
nullptr;
66 int16 _string_len = 0;
68 bool _must_redraw =
false;
71 TextField(int16 x1, int16 y1, int16 x2, int16 y2);
74 void set_string(
const char *
string);
75 void draw(
GrBuff *interface_buffer);
87 bool _highlighted =
false;
94 ButtonState _state = BUTTON_RELAXED;
96 bool _must_redraw =
false;
102 int16 unknown, int16 relaxed, int16 over, int16 picked,
int sprite);
104 int16 relaxed, int16 over, int16 picked,
int sprite);
107 void draw(
GrBuff *interface_buffer);
108 int16 inside(int16 x, int16 y)
const override;
109 virtual ControlStatus track(int32 eventType, int16 x, int16 y);
112 void set(int16 x1, int16 y1, int16 x2, int16 y2, int16 tag);
113 void set(int16 x1, int16 y1, int16 x2, int16 y2, int16 tag, int16 unknown,
114 int16 relaxed, int16 over, int16 picked, int32 sprite);
117 int16 get_tag()
const;
121 bool is_hidden()
const;
122 void set_sprite_relaxed(int16 r);
123 void set_sprite_picked(int16 p);
124 void set_sprite_over(int16 o);
125 void set_sprite_unknown(int16 val);
130 ControlStatus _toggle_state;
133 ControlStatus track(int32 eventType, int16 x, int16 y);
138 bool _selected =
false;
143 int16 _highlight_index = 0;
144 bool _must_redraw_all =
false;
150 void draw(
GrBuff *interface_buffer);
151 int16 inside(int16 x, int16 y)
const override;
152 ControlStatus track(int32 eventType, int16 x, int16 y);
155 int16 check_inventory(int16 x, int16 y);
156 void highlight_button(int16 index);
157 void set_selected(
bool);
Definition: gui_cheapo.h:63
Definition: gui_cheapo.h:47
Definition: gui_cheapo.h:128
Definition: gui_cheapo.h:136
Definition: database.h:28