Page 1 of 1
Cell item text style
Posted: Sat Dec 03, 2011 2:40 pm
by xmedia
Is it possible to set the text style for all the cells when inserting a new table
Posted: Sun Dec 04, 2011 8:25 pm
by Sergey Tkachenko
Each table cell initially has one text item of the 0-th text and the 0th paragraph styles. You can delete it and replace to the text item of another style.
If you do not use RichViewActions, do it before calling rve.InsertItem.
Code: Select all
table := TRVTableItemInfo.CreateEx(...);
// changing all cell styles to the current text and paragraph styles
for r := 0 to table.RowCount-1 do
for c := 0 to table.ColCount-1 do begin
table.Cells[r,c].Clear;
table.Cells[r,c].AddNL('', rve.CurTextStyleNo, rve.CurParaStyleNo);
end;
rve.InsertItem('', table);
If you use RichViewActions, add this cycle in rvActionInsertTable.OnInserting event.
Posted: Sun Dec 04, 2011 10:16 pm
by xmedia
This is exactly what i want to do
, Thank you very much for your help
What is the signification of the property 'AssociatedTextStyle', when use it and for what ?
Posted: Mon Dec 05, 2011 1:34 pm
by Sergey Tkachenko
It is used internally, do not use it in your code.
(it is used for non-text items linked to a text style, like a labelitem or a tabulator).