| 184 | } |
| 185 | |
| 186 | void GuiTextCtrl::setText(const char *txt) |
| 187 | { |
| 188 | //make sure we don't call this before onAdd(); |
| 189 | if( !mProfile ) |
| 190 | return; |
| 191 | |
| 192 | // The txt pointer is sometimes the same as the mText pointer, so make sure |
| 193 | // we don't call strncpy with overlapping src and dest. |
| 194 | if (txt && txt != mText) |
| 195 | dStrncpy(mText, (UTF8*)txt, MAX_STRING_LENGTH); |
| 196 | mText[MAX_STRING_LENGTH] = '\0'; |
| 197 | |
| 198 | setVariable((char*)mText); |
| 199 | setUpdate(); |
| 200 | |
| 201 | autoResize(); |
| 202 | } |
| 203 | |
| 204 | void GuiTextCtrl::setTextID(const char *id) |
| 205 | { |