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

Method setText

Engine/source/gui/controls/guiMLTextCtrl.cpp:587–606  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

585
586//--------------------------------------------------------------------------
587void 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//--------------------------------------------------------------------------
609void 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