Hello, me again
I'm making chat alike application. After some testing, I noticed that TRichView eats much memory if there is alot of spam and I leave it to work overnight. This is how I add lines at the moment:
Code: Select all
tmpTable := TRVTableItemInfo.CreateEx(1, 3, ChatBox.RVData);
tmpTable.BorderWidth := 0;
tmpTable.CellVPadding := 0;
tmpTable.CellBorderWidth := 0;
tmpTable.CellVSpacing := 0;
tmpTable.BorderVSpacing := 0;
tmpTable.Color := clNone;
tmpTable.Options := [rvtoColSizing, rvtoRTFAllowAutofit];
tmpTable.Cells[0, 0].BestWidth := 135;
tmpTable.Cells[0, 2].BestWidth := 55;
tmpTable.Cells[0, 0].Clear;
tmpTable.Cells[0, 1].Clear;
tmpTable.Cells[0, 2].Clear;
tmpTable.Cells[0, 0].AddFmt('%s:', [ANick], ANickStyle, 0);
tmpTable.Cells[0, 1].AddFmt(ALine, [], ALineStyle, 1);
fmtTime.LongTimeFormat := 'HH:MM:SS';
fmtTime.TimeSeparator := ':';
tmpTable.Cells[0, 2].AddFmt(TimeToStr(Time, fmtTime), [], 1, 2);
ChatBox.AddItem('', tmpTable);
Basically, I create one table for each row added. Can I create table once, then just expand it for each line ? And how to do this ? I can create table outside function that adds line to chat, but how can I get its reference and add row to it from function ?