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

Function InputWidget_UpdateText

src/Widgets.c:1395–1409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1393}
1394
1395void InputWidget_UpdateText(struct InputWidget* w) {
1396 int lines = w->GetMaxLines();
1397 if (lines > 1) {
1398 WordWrap_Do(&w->text, w->lines, lines, INPUTWIDGET_LEN);
1399 } else {
1400 w->lines[0] = w->text;
1401 }
1402
1403 Gfx_DeleteTexture(&w->inputTex.ID);
1404 InputWidget_CalculateLineSizes(w);
1405 w->RemakeTexture(w);
1406 InputWidget_UpdateCaret(w);
1407 OnscreenKeyboard_SetText(&w->text);
1408 if (w->OnTextChanged) w->OnTextChanged(w);
1409}
1410
1411void InputWidget_SetText(struct InputWidget* w, const cc_string* str) {
1412 InputWidget_Clear(w);

Callers 11

InputWidget_AppendTextFunction · 0.85
InputWidget_AppendFunction · 0.85
InputWidget_BackspaceKeyFunction · 0.85
InputWidget_DeleteKeyFunction · 0.85
InputWidget_SetTextFunction · 0.85
TextInputWidget_SetFontFunction · 0.85
ChatInputWidget_UpKeyFunction · 0.85
ChatInputWidget_DownKeyFunction · 0.85
ChatScreen_RedrawFunction · 0.85
ChatScreen_OpenInputFunction · 0.85

Calls 5

WordWrap_DoFunction · 0.85
InputWidget_UpdateCaretFunction · 0.85
Gfx_DeleteTextureFunction · 0.70
OnscreenKeyboard_SetTextFunction · 0.70

Tested by

no test coverage detected