diff options
-rw-r--r-- | examples/apps/ide/src/frm_main.pas | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/examples/apps/ide/src/frm_main.pas b/examples/apps/ide/src/frm_main.pas index 96b78a52..0b221f6c 100644 --- a/examples/apps/ide/src/frm_main.pas +++ b/examples/apps/ide/src/frm_main.pas @@ -67,6 +67,9 @@ type procedure btnOpenFileClicked(Sender: TObject); procedure miFileSave(Sender: TObject); procedure miFileSaveAs(Sender: TObject); + procedure miEditCutClicked(Sender: TObject); + procedure miEditCopyClicked(Sender: TObject); + procedure miEditPasteClicked(Sender: TObject); procedure miFindClicked(Sender: TObject); procedure miSearchProcedureList(Sender: TObject); procedure miAboutFPGuiClicked(Sender: TObject); @@ -203,6 +206,30 @@ begin TfpgTextEdit(pcEditor.ActivePage.Components[0]).SaveToFile(s); end; +procedure TMainForm.miEditCutClicked(Sender: TObject); +var + edt: TfpgTextEdit; +begin + edt := TfpgTextEdit(pcEditor.ActivePage.Components[0]); + edt.CutToClipboard; +end; + +procedure TMainForm.miEditCopyClicked(Sender: TObject); +var + edt: TfpgTextEdit; +begin + edt := TfpgTextEdit(pcEditor.ActivePage.Components[0]); + edt.CopyToClipboard; +end; + +procedure TMainForm.miEditPasteClicked(Sender: TObject); +var + edt: TfpgTextEdit; +begin + edt := TfpgTextEdit(pcEditor.ActivePage.Components[0]); + edt.PasteFromClipboard; +end; + procedure TMainForm.miFindClicked(Sender: TObject); var s: TfpgString; @@ -1239,9 +1266,9 @@ begin begin Name := 'mnuEdit'; SetPosition(476, 80, 172, 20); - AddMenuItem('Cut', '', nil).Enabled := False; - AddMenuItem('Copy', '', nil).Enabled := False; - AddMenuItem('Paste', '', nil).Enabled := False; + AddMenuItem('Cut', rsKeyCtrl+'X', @miEditCutClicked); + AddMenuItem('Copy', rsKeyCtrl+'C', @miEditCopyClicked); + AddMenuItem('Paste', rsKeyCtrl+'V', @miEditPasteClicked); AddMenuItem('-', '', nil); AddMenuItem('Indent selection', rsKeyCtrl+'I', nil).Enabled := False; AddMenuItem('Unindent selection', rsKeyCtrl+'U', nil).Enabled := False; |