diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-10-19 18:21:33 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-10-19 18:21:33 +0100 |
commit | ce022bcfb4c1e9544f76ed8a83d4ec17233a5cf1 (patch) | |
tree | 427cabdebf4b8a7b0bda2709b1e1251330c7509c /examples/apps/ide | |
parent | c76ac77e0d2961bc8f24f8d13ab1cfd5ae9849bc (diff) | |
download | fpGUI-ce022bcfb4c1e9544f76ed8a83d4ec17233a5cf1.tar.xz |
textedit: Implemented the DoCopy method so now Ctrl+C copies selected text to the clipboard.
Diffstat (limited to 'examples/apps/ide')
-rw-r--r-- | examples/apps/ide/src/fpg_textedit.pas | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/apps/ide/src/fpg_textedit.pas b/examples/apps/ide/src/fpg_textedit.pas index 5ae1b52a..caf51736 100644 --- a/examples/apps/ide/src/fpg_textedit.pas +++ b/examples/apps/ide/src/fpg_textedit.pas @@ -149,6 +149,7 @@ type function mousewheelacceleration(const avalue: double): double; function mousewheelacceleration(const avalue: integer): integer; function FindReplaceProc(TextToFind: TfpgString; FindOptions: TfpgFindOptions; Backward, ReplaceMode: Boolean; var ReplaceText: Boolean): Boolean; + procedure DoCopy; protected { -- internal events -- } procedure HandleShow; override; @@ -1487,6 +1488,13 @@ begin end; end; +procedure TfpgBaseTextEdit.DoCopy; +begin + if not FSelected then + Exit; + fpgClipboard.Text := GetSelectedText; +end; + procedure TfpgBaseTextEdit.HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); var @@ -1527,7 +1535,7 @@ begin case CheckClipboardKey(keycode, shiftstate) of ckCopy: begin -// DoCopy; + DoCopy; end; ckPaste: |