/*------------------------------------------------------------------------------
  RVStyle1->ListStyles->Items[0] has two levels -
  0th - imagelistcounter
  1st - imagelist
------------------------------------------------------------------------------*/
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma link "RVEdit"
#pragma link "RichView"
#pragma link "RVScroll"
#pragma link "RVStyle"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
#define text "Text text text. Text text text text. Text text text. Text text text text. Text text text. Text text text text."
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  RichViewEdit1->Clear();
  for (int i=0; i<5; i++)
  {
    RichViewEdit1->SetListMarkerInfo(-1, 0, 0, 1, 0, false);
    RichViewEdit1->AddNLWTag(text, 3, -1, 0);
    RichViewEdit1->SetListMarkerInfo(-1, 0, 1, 1, 0, false);
    RichViewEdit1->AddNLWTag(text, 0, -1, 0);
    RichViewEdit1->SetListMarkerInfo(-1, 0, 1, 1, 0, false);
    RichViewEdit1->AddNLWTag(text, 0, -1, 0);
    RichViewEdit1->SetListMarkerInfo(-1, 0, 1, 1, 0, false);
    RichViewEdit1->AddNLWTag(text, 0, -1, 0);
  }
  RichViewEdit1->Format();
}
//---------------------------------------------------------------------------
// 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.
void __fastcall TForm1::RichViewEdit1RVFImageListNeeded(TCustomRichView *Sender,
	int ImageListTag, TCustomImageList *&il)
{
  switch (ImageListTag)
  {
    case 1: il = ImageList1; break;
    case 2: il = ImageList2; break;
  }
}
//---------------------------------------------------------------------------