Unit1.cpp
上传用户:daoqigc
上传日期:2021-04-20
资源大小:2795k
文件大小:2k
- /*------------------------------------------------------------------------------
- RVStyle1->ListStyles->Items[0] has two levels -
- 0th - imagelistcounter
- 1st - imagelist
- ------------------------------------------------------------------------------*/
- //---------------------------------------------------------------------------
- #include <vclvcl.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->Add(text, 3);
- RichViewEdit1->SetListMarkerInfo(-1, 0, 1, 1, 0, false);
- RichViewEdit1->Add(text, 0);
- RichViewEdit1->SetListMarkerInfo(-1, 0, 1, 1, 0, false);
- RichViewEdit1->Add(text, 0);
- RichViewEdit1->SetListMarkerInfo(-1, 0, 1, 1, 0, false);
- RichViewEdit1->Add(text, 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;
- }
- }
- //---------------------------------------------------------------------------