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

Method copyToClipboard

Engine/source/gui/controls/guiMLTextCtrl.cpp:972–984  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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