Cannot insert BOLD Text in 1st Row of tables ar runtime
Posted: Fri Jun 08, 2007 5:51 am
Hi Sergey
I hope you can help me with this one.
I create a table in a separate function where richviewedit1 is passed as a var parameter.
Then I fiil the cells like this:
Atable.Cells[0,0].Addnl(lg('Date'),5,-1);
Atable is defined in the pubblic section of Richviewedit1 as
Atable: TRVTableItemInfo;
5 is the Textstyle index of a RvStyle1 wich is used in Richview1.
This style is called 'bold' has size=10 and Style = [fsbold].
(NOTE: I want this style i.e. bold ONLY on the first row, so I use
Atable.Cells[y,x].Addnl(lg('something'),0,-1); on y >0. Also note that if I use 0 instead of -1, the text shows blow the visible cells, i.e. is not visible UNLESS i click on the cell and move the arrow down)
Then inside the RichviewEdit1, in FillFields, I do this (which you suggested to me)
table := TRVTableItemInfo.CreateEx(Atable.Rows.Count,Atable.Rows[0].Count, RichViewEdit1.RVData);
Stream := TMemoryStream.Create;
Atable.SaveToStream(Stream);
Stream.Position := 0;
Atable.free;
table.LoadFromStream(Stream);
Stream.Free;
table.ParaNo := RVData.GetItemPara(i);
RVData.DeleteItems(i, 1);
s := '';
table.Inserting(RVData, s, False);
RVData.Items.InsertObject(i, s, table);
table.Inserted(RVData, i);
if (i>0) and (RVData.GetItemStyle(i-1)=rvsListMarker) then begin
dec(i);
RVData.DeleteItems(i, 1);
end;
When it is displayed, the text inside the cells is NOT bold, and is size 8.
Why?
Thanks for any help
Enrico
I hope you can help me with this one.
I create a table in a separate function where richviewedit1 is passed as a var parameter.
Then I fiil the cells like this:
Atable.Cells[0,0].Addnl(lg('Date'),5,-1);
Atable is defined in the pubblic section of Richviewedit1 as
Atable: TRVTableItemInfo;
5 is the Textstyle index of a RvStyle1 wich is used in Richview1.
This style is called 'bold' has size=10 and Style = [fsbold].
(NOTE: I want this style i.e. bold ONLY on the first row, so I use
Atable.Cells[y,x].Addnl(lg('something'),0,-1); on y >0. Also note that if I use 0 instead of -1, the text shows blow the visible cells, i.e. is not visible UNLESS i click on the cell and move the arrow down)
Then inside the RichviewEdit1, in FillFields, I do this (which you suggested to me)
table := TRVTableItemInfo.CreateEx(Atable.Rows.Count,Atable.Rows[0].Count, RichViewEdit1.RVData);
Stream := TMemoryStream.Create;
Atable.SaveToStream(Stream);
Stream.Position := 0;
Atable.free;
table.LoadFromStream(Stream);
Stream.Free;
table.ParaNo := RVData.GetItemPara(i);
RVData.DeleteItems(i, 1);
s := '';
table.Inserting(RVData, s, False);
RVData.Items.InsertObject(i, s, table);
table.Inserted(RVData, i);
if (i>0) and (RVData.GetItemStyle(i-1)=rvsListMarker) then begin
dec(i);
RVData.DeleteItems(i, 1);
end;
When it is displayed, the text inside the cells is NOT bold, and is size 8.
Why?
Thanks for any help
Enrico