Function that sets the text in text area
| 991 | |
| 992 | // Function that sets the text in text area |
| 993 | void 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 | |
| 1019 | void RichTextarea::SetStatusBar(HWND status, unsigned int barWidth) |
| 1020 | { |
nothing calls this directly
no test coverage detected