unit Unit1;

interface

{$I RV_Defs.inc}

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, RVScroll, RichView, RVEdit, RVStyle,
  {$IFDEF RICHVIEWDEF4}
  ImgList,
  {$ENDIF}
  StdCtrls, ComCtrls, SclRView;

type
  TForm1 = class(TForm)
    ImageList1: TImageList;
    RVStyle1: TRVStyle;
    ImageList2: TImageList;
    srv: TSRichViewEdit;
    procedure FormCreate(Sender: TObject);
    procedure RichViewEdit1RVFImageListNeeded(Sender: TCustomRichView;
      ImageListTag: Integer; var il: TCustomImageList);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{-------------------------------------------------------------------------------
  RVStyle1.ListStyles[0] has two levels -
  0th - imagelistcounter
  1st - imagelist
-------------------------------------------------------------------------------}

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
const text = 'Text text text. Text text text text. Text text text. Text text text text. Text text text. Text text text text.';
begin

  with srv.RichViewEdit do begin
    Clear;
    for i := 1 to 5 do begin
      SetListMarkerInfo(-1, 0, 0, 1, 0, False);
      Add(text, 3);
        SetListMarkerInfo(-1, 0, 1, 1, 0, False);
        Add(text, 0);
        SetListMarkerInfo(-1, 0, 1, 1, 0, False);
        Add(text, 0);
        SetListMarkerInfo(-1, 0, 1, 1, 0, False);
        Add(text, 0);
    end;
    Format;
  end;
end;


// This event is not used in this demo.
// But if you want to save and load this document in RVF, it is necessary.
// Note: ImageList1.Tag is set to 1, ImageList2.Tag is set to 2.  
procedure TForm1.RichViewEdit1RVFImageListNeeded(Sender: TCustomRichView;
  ImageListTag: Integer; var il: TCustomImageList);
begin
  case ImageListTag of
    1: il := ImageList1;
    2: il := ImageList2;
  end;
end;

end.
