line break in cell

Public forum for discussing TScaleRichView (shareware addon to TRichView providing WYSIWYG editing)
Post Reply
rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

line break in cell

Post by rellik » Thu Nov 10, 2016 8:50 am

Hi! I need paste text into cell of table.

I use table1.cell[0, 0].addNL(s);

but if s = 'перенос '+#10#13+'строки'; SrichViewEdit ignore it and paste into cell 'перенос строки'

Sergey Tkachenko
Site Admin
Posts: 13468
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Thu Nov 10, 2016 9:25 am

To add multiline text, use AddTextNL:

Code: Select all

table.Cells[0,0].AddTextNL('line1'#10#13'line2', 0, 0, 0);

rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

Post by rellik » Thu Nov 10, 2016 10:24 am

Thanks, I can see, how many lines in the text of the cell?

Sergey Tkachenko
Site Admin
Posts: 13468
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Thu Nov 10, 2016 10:47 am

I assume that "lines" means "paragraphs" (including line breaks inside paragraphs)

Code: Select all

function GetParaCount(RVData: TCustomRVData): Integer;
var i: Integer;
begin
  Result := 0;
  for I := 0 to RVData.ItemCount - 1 do
    if RVData.IsFromNewLine(I) then
      inc(Result);
end;

Call:
ParaCount := GetParaCount(table.Cells[0,0].GetRVData);

Post Reply