summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/apps/ide/src/frm_main.pas18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/apps/ide/src/frm_main.pas b/examples/apps/ide/src/frm_main.pas
index e13f102b..f5adaec6 100644
--- a/examples/apps/ide/src/frm_main.pas
+++ b/examples/apps/ide/src/frm_main.pas
@@ -97,6 +97,7 @@ type
procedure miProjectSaveAs(Sender: TObject);
procedure miProjectAddUnitToProject(Sender: TObject);
procedure tvProjectDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
+ procedure grdMessageKeyPressed(Sender: TObject; var KeyCode: Word; var ShiftState: TShiftState; var Consumed: Boolean);
procedure TabSheetClosing(Sender: TObject; ATabSheet: TfpgTabSheet);
procedure BuildTerminated(Sender: TObject);
procedure BuildOutput(Sender: TObject; const ALine: string);
@@ -529,6 +530,22 @@ begin
end;
end;
+procedure TMainForm.grdMessageKeyPressed(Sender: TObject; var KeyCode: Word; var ShiftState: TShiftState; var Consumed: Boolean);
+var
+ cr: TClipboardKeyType;
+ i: integer;
+ s: TfpgString;
+begin
+ cr := CheckClipboardKey(KeyCode, ShiftState);
+ if cr = ckCopy then
+ begin
+ s := '';
+ for i := 0 to grdMessages.RowCount-1 do
+ s := s + grdMessages.Cells[0, i] + LineEnding;
+ fpgClipboard.Text := s;
+ end;
+end;
+
procedure TMainForm.TabSheetClosing(Sender: TObject; ATabSheet: TfpgTabSheet);
var
u: TUnit;
@@ -1326,6 +1343,7 @@ begin
RowSelect := True;
ShowHeader := False;
TabOrder := 13;
+ OnKeyPress := @grdMessageKeyPressed;
end;
tsScribble := TfpgTabSheet.Create(pnlWindow);