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

Method copyToClipboard

Engine/source/gui/controls/guiMLTextCtrl.cpp:976–988  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

974
975//--------------------------------------------------------------------------
976void GuiMLTextCtrl::copyToClipboard(const U32 rangeStart, const U32 rangeEnd)
977{
978 AssertFatal(rangeStart < mTextBuffer.length() && rangeEnd < mTextBuffer.length(),
979 avar("GuiMLTextCtrl::copyToClipboard: can't copy outside of current text (%d, %d, %d)",
980 rangeStart, rangeEnd, mTextBuffer.length()));
981 AssertFatal(rangeStart <= rangeEnd, "GuiMLTextCtrl::copyToClipboard: invalid copy range");
982
983 //copy the selection to the clipboard
984
985 UTF8* selection = mTextBuffer.createSubstring8(rangeStart, rangeEnd-rangeStart+1);
986 Platform::setClipboard(selection);
987 delete[] selection;
988}
989
990//--------------------------------------------------------------------------
991bool GuiMLTextCtrl::isSelectionActive() const

Callers

nothing calls this directly

Calls 3

avarFunction · 0.85
createSubstring8Method · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected