summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-26 10:47:38 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-26 10:47:38 +0200
commit2ea40aa72ea6d4428c059e49cc952445e4a03a60 (patch)
treed9696fd1dc28a6b68cb6407a7064a35ed9da60a2
parentfb400c720d7029ac817605d405a6cef06188d52e (diff)
downloadfpGUI-2ea40aa72ea6d4428c059e49cc952445e4a03a60.tar.xz
docview: added copy to clipboard button in ShowText form.
-rw-r--r--docview/src/frm_text.pas22
1 files changed, 21 insertions, 1 deletions
diff --git a/docview/src/frm_text.pas b/docview/src/frm_text.pas
index 01de3776..1501bd6b 100644
--- a/docview/src/frm_text.pas
+++ b/docview/src/frm_text.pas
@@ -17,7 +17,9 @@ type
{@VFD_HEAD_BEGIN: TextForm}
btnClose: TfpgButton;
Memo1: TfpgMemo;
+ btnCopy: TfpgButton;
{@VFD_HEAD_END: TextForm}
+ procedure btnCopyClicked(Sender: TObject);
public
procedure AfterCreate; override;
end;
@@ -49,6 +51,11 @@ end;
{@VFD_NEWFORM_IMPL}
+procedure TTextForm.btnCopyClicked(Sender: TObject);
+begin
+ fpgClipboard.Text := Memo1.Lines.Text;
+end;
+
procedure TTextForm.AfterCreate;
begin
{%region 'Auto-generated GUI code' -fold}
@@ -68,8 +75,8 @@ begin
FontDesc := '#Label1';
Hint := '';
ImageName := '';
- TabOrder := 1;
ModalResult := mrOK;
+ TabOrder := 1;
end;
Memo1 := TfpgMemo.Create(self);
@@ -83,6 +90,19 @@ begin
TabOrder := 2;
end;
+ btnCopy := TfpgButton.Create(self);
+ with btnCopy do
+ begin
+ Name := 'btnCopy';
+ SetPosition(4, 268, 128, 24);
+ Text := 'Copy to Clipboard';
+ FontDesc := '#Label1';
+ Hint := '';
+ ImageName := '';
+ TabOrder := 3;
+ OnClick := @btnCopyClicked;
+ end;
+
{@VFD_BODY_END: TextForm}
{%endregion}
end;