mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:59:06 +02:00
LCL, check custom columns on copy grid's content to clipboard
git-svn-id: trunk@25502 -
This commit is contained in:
parent
430aa43196
commit
ab9338a782
@ -8935,16 +8935,31 @@ end;
|
|||||||
procedure TCustomStringGrid.CopyCellRectToClipboard(const R: TRect);
|
procedure TCustomStringGrid.CopyCellRectToClipboard(const R: TRect);
|
||||||
var
|
var
|
||||||
SelStr: String;
|
SelStr: String;
|
||||||
i: LongInt;
|
i,j,k: LongInt;
|
||||||
j: LongInt;
|
|
||||||
begin
|
begin
|
||||||
SelStr := '';
|
SelStr := '';
|
||||||
for i:=R.Top to R.Bottom do begin
|
for i:=R.Top to R.Bottom do begin
|
||||||
|
|
||||||
for j:=R.Left to R.Right do begin
|
for j:=R.Left to R.Right do begin
|
||||||
SelStr := SelStr + Cells[j,i];
|
|
||||||
|
if Columns.Enabled and (j>=FirstGridColumn) then begin
|
||||||
|
|
||||||
|
k := ColumnIndexFromGridColumn(j);
|
||||||
|
if not Columns[k].Visible then
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (i=0) then
|
||||||
|
SelStr := SelStr + Columns[k].Title.Caption
|
||||||
|
else
|
||||||
|
SelStr := SelStr + Cells[j,i];
|
||||||
|
|
||||||
|
end else
|
||||||
|
SelStr := SelStr + Cells[j,i];
|
||||||
|
|
||||||
if j<>R.Right then
|
if j<>R.Right then
|
||||||
SelStr := SelStr + #9;
|
SelStr := SelStr + #9;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SelStr := SelStr + #13#10;
|
SelStr := SelStr + #13#10;
|
||||||
end;
|
end;
|
||||||
Clipboard.AsText := SelStr;
|
Clipboard.AsText := SelStr;
|
||||||
|
Loading…
Reference in New Issue
Block a user