Page 1 of 1

Create lists from code

Posted: Fri Jun 16, 2017 8:30 am
by DmitriPopov
Hello!

I need to create lists from code. I try to do it like this:

Code: Select all

procedure TForm1.AddListItem(ARVData: TCustomRVData);
var marker: TRVMarkerItemInfo;
begin
  marker := TRVMarkerItemInfo.CreateEx(ARVData, CreateBullets, 0, 1, True);
  ARVData.AddItem('', marker);
  ARVData.AddTextNL('Test list item', 0, -1, 0);  
Where CreateBullets is a function from your "BulletsAndNumbering" demo.

The item appears, idented as it should, but there's no bullet or number in front of it. I know about ApplyListStyle method but I need to add lists to any TCustomRVData descendant, not just TRichViewRVData. Is there any way to do it?

Re: Create lists from code

Posted: Sat Jun 17, 2017 10:19 am
by Sergey Tkachenko
Use SetListMarkerInfo(-1, ...) instead of AddItem.