Create lists from code

General TRichView support forum. Please post your questions here
Post Reply
Posts: 29
Joined: Tue Dec 15, 2009 10:01 am

Create lists from code

Post by DmitriPopov » Fri Jun 16, 2017 8:30 am


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;
  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?

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

Re: Create lists from code

Post by Sergey Tkachenko » Sat Jun 17, 2017 10:19 am

Use SetListMarkerInfo(-1, ...) instead of AddItem.

Post Reply