--------------------------------------------------------------------------
| 581 | |
| 582 | //-------------------------------------------------------------------------- |
| 583 | void GuiMLTextCtrl::setText(const char* textBuffer, const U32 numChars) |
| 584 | { |
| 585 | U32 chars = numChars; |
| 586 | if(numChars >= mMaxBufferSize) |
| 587 | chars = mMaxBufferSize; |
| 588 | |
| 589 | // leaving this usage because we StringBuffer.set((UTF8*)) cannot take a numChars arg. |
| 590 | // perhaps it should? -paxorr |
| 591 | FrameTemp<UTF8> tmp(chars+1); |
| 592 | dStrncpy(tmp, textBuffer, chars); |
| 593 | tmp[chars] = 0; |
| 594 | |
| 595 | mTextBuffer.set(tmp); |
| 596 | |
| 597 | //after setting text, always set the cursor to the beginning |
| 598 | setCursorPosition(0); |
| 599 | clearSelection(); |
| 600 | mDirty = true; |
| 601 | scrollToTop(); |
| 602 | } |
| 603 | |
| 604 | //-------------------------------------------------------------------------- |
| 605 | void GuiMLTextCtrl::addText(const char* textBuffer, const U32 numChars, bool reformat) |
no test coverage detected