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

Method addText

Engine/source/gui/controls/guiMLTextCtrl.cpp:605–624  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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