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

Method addText

Engine/source/gui/controls/guiMLTextCtrl.cpp:609–628  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

607
608//--------------------------------------------------------------------------
609void GuiMLTextCtrl::addText(const char* textBuffer, const U32 numChars, bool reformat)
610{
611 if(numChars >= mMaxBufferSize)
612 return;
613
614 FrameTemp<UTF8> tmp(numChars+1);
615 dStrncpy(tmp, textBuffer, numChars);
616 tmp[numChars] = 0;
617
618 mTextBuffer.append(tmp);
619
620 //after setting text, always set the cursor to the beginning
621 if (reformat)
622 {
623 setCursorPosition(0);
624 clearSelection();
625 mDirty = true;
626 scrollToTop();
627 }
628}
629
630//--------------------------------------------------------------------------
631bool GuiMLTextCtrl::setCursorPosition(const S32 newPosition)

Callers 1

guiMLTextCtrl.cppFile · 0.45

Calls 2

dStrncpyFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected