MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / setText

Method setText

Engine/source/gui/controls/guiMLTextCtrl.cpp:583–602  ·  view source on GitHub ↗

--------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

581
582//--------------------------------------------------------------------------
583void 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//--------------------------------------------------------------------------
605void GuiMLTextCtrl::addText(const char* textBuffer, const U32 numChars, bool reformat)

Callers 1

guiMLTextCtrl.cppFile · 0.45

Calls 2

dStrncpyFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected