| 477 | } |
| 478 | |
| 479 | void GuiTextEditCtrl::onCopy(bool andCut) |
| 480 | { |
| 481 | // Don't copy/cut password field! |
| 482 | if(mPasswordText) |
| 483 | return; |
| 484 | |
| 485 | if (mBlockEnd > 0) |
| 486 | { |
| 487 | //save the current state |
| 488 | saveUndoState(); |
| 489 | |
| 490 | //copy the text to the clipboard |
| 491 | UTF8* clipBuff = mTextBuffer.createSubstring8(mBlockStart, mBlockEnd - mBlockStart); |
| 492 | Platform::setClipboard(clipBuff); |
| 493 | delete[] clipBuff; |
| 494 | |
| 495 | //if we pressed the cut shortcut, we need to cut the selected text from the control... |
| 496 | if (andCut) |
| 497 | { |
| 498 | mTextBuffer.cut(mBlockStart, mBlockEnd - mBlockStart); |
| 499 | mCursorPos = mBlockStart; |
| 500 | } |
| 501 | |
| 502 | mBlockStart = 0; |
| 503 | mBlockEnd = 0; |
| 504 | } |
| 505 | |
| 506 | } |
| 507 | |
| 508 | void GuiTextEditCtrl::onPaste() |
| 509 | { |
nothing calls this directly
no test coverage detected