MCPcopy Create free account
hub / github.com/WheretIB/nullc / SetAreaText

Method SetAreaText

GUI/RichTextarea.cpp:993–1017  ·  view source on GitHub ↗

Function that sets the text in text area

Source from the content-addressed store, hash-verified

991
992// Function that sets the text in text area
993void RichTextarea::SetAreaText(HWND wnd, const char *text)
994{
995 TextareaData *data = GetData(wnd);
996
997 // Remove current text
998 ClearAreaText(wnd);
999 // Because we are not holding text as a simple string,
1000 // we simulate how this text is written symbol by symbol
1001 while(*text)
1002 {
1003 if((unsigned char)*text >= 0x20 || *text == '\t')
1004 data->InputChar(*text);
1005 else if(*text == '\r')
1006 data->InputEnter();
1007 *text++;
1008 }
1009 // Colorer should update text
1010 data->needUpdate = true;
1011 // Reset cursor and selection
1012 data->cursorCharX = data->dragStartX = data->dragEndX = 0;
1013 data->cursorCharY = data->dragStartY = data->dragEndY = 0;
1014 data->selectionOn = false;
1015
1016 data->history->ResetHistory();
1017}
1018
1019void RichTextarea::SetStatusBar(HWND status, unsigned int barWidth)
1020{

Callers

nothing calls this directly

Calls 4

InputCharMethod · 0.80
InputEnterMethod · 0.80
ResetHistoryMethod · 0.80
GetDataFunction · 0.70

Tested by

no test coverage detected