MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Button

Class Button

LibLemon/include/lemon/gui/widgets.h:158–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156 };
157
158 class Button : public Widget{
159 protected:
160 bool drawText = true;
161
162 TextAlignment labelAlignment = TextAlignment::Centre;
163
164 std::string label;
165 int labelLength;
166
167 void DrawButtonBorders(surface_t* surface, bool white);
168 void DrawButtonLabel(surface_t* surface, bool white);
169 public:
170 bool active = false;
171 bool pressed = false;
172 int style = 0; // 0 - Normal, 1 - Blue, 2 - Red, 3 - Yellow
173
174 bool state = false;
175
176 Button(const char* _label, rect_t _bounds);
177
178 virtual void Paint(surface_t* surface);
179 virtual void OnMouseDown(vector2i_t mousePos);
180 virtual void OnMouseUp(vector2i_t mousePos);
181
182 void (*OnPress)(Button*) = nullptr;
183 };
184
185 class Bitmap : public Widget{
186 public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected