MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / TextInputWidget_Create

Function TextInputWidget_Create

src/Widgets.c:1757–1779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1755 TextInputWidget_BuildMesh, TextInputWidget_Render2, TextInputWidget_MaxVertices
1756};
1757void TextInputWidget_Create(struct TextInputWidget* w, int width, const cc_string* text, struct MenuInputDesc* desc) {
1758 InputWidget_Reset(&w->base);
1759 w->base.VTABLE = &TextInputWidget_VTABLE;
1760
1761 w->minWidth = Display_ScaleX(width);
1762 w->minHeight = Display_ScaleY(30);
1763 w->desc = *desc;
1764
1765 w->base.convertPercents = false;
1766 w->base.padding = 3;
1767 w->base.showCaret = !Gui_TouchUI;
1768 w->base.flags = WIDGET_FLAG_SELECTABLE;
1769
1770 w->base.GetMaxLines = TextInputWidget_GetMaxLines;
1771 w->base.RemakeTexture = TextInputWidget_RemakeTexture;
1772 w->base.OnPressedEnter = InputWidget_OnPressedEnter;
1773 w->base.AllowedChar = TextInputWidget_AllowedChar;
1774
1775 String_InitArray(w->base.text, w->_textBuffer);
1776 String_Copy(&w->base.text, text);
1777 w->onscreenPlaceholder = "";
1778 w->onscreenType = KEYBOARD_TYPE_TEXT;
1779}
1780
1781void TextInputWidget_Add(void* screen, struct TextInputWidget* w, int width, const cc_string* text, struct MenuInputDesc* d) {
1782 TextInputWidget_Create(w, width, text, d);

Callers 1

TextInputWidget_AddFunction · 0.85

Calls 4

InputWidget_ResetFunction · 0.85
Display_ScaleXFunction · 0.85
Display_ScaleYFunction · 0.85
String_CopyFunction · 0.85

Tested by

no test coverage detected