Create lists from code

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

Create lists from code

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

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?

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

Re: Create lists from code

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

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

Post Reply