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

Class TextBox

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

Source from the content-addressed store, hash-verified

208 };
209
210 class TextBox : public Widget{
211 protected:
212 ScrollBar sBar;
213
214 std::vector<ContextMenuEntry> ctxEntries;
215 bool masked = false;
216 public:
217 bool editable = true;
218 bool multiline = false;
219 bool active = false;
220 std::vector<std::string> contents;
221 int lineCount;
222 int lineSpacing = 3;
223 size_t bufferSize;
224 vector2i_t cursorPos = {0, 0};
225 Graphics::Font* font = Graphics::DefaultFont();
226
227 TextBox(rect_t bounds, bool multiline);
228
229 void Paint(surface_t* surface);
230 void LoadText(const char* text);
231
232 void OnMouseDown(vector2i_t mousePos);
233 void OnMouseUp(vector2i_t mousePos);
234 void OnMouseMove(vector2i_t mousePos);
235 void OnKeyPress(int key);
236 void OnRightMouseDown(vector2i_t mousePos);
237 void OnCommand(unsigned short cmd);
238 void MaskText(bool state);
239
240 void ResetScrollBar();
241
242 rgba_colour_t textColour = colours[Colour::Text];
243
244 void (*OnSubmit)(TextBox*) = nullptr;
245 };
246
247 class ListItem{
248 public:

Callers

nothing calls this directly

Calls 1

DefaultFontFunction · 0.85

Tested by

no test coverage detected