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