Demo6Frm.cpp
上传用户:daoqigc
上传日期:2021-04-20
资源大小:2795k
文件大小:2k
- //---------------------------------------------------------------------------
- #include <vclvcl.h>
- #pragma hdrstop
- #include "Demo6Frm.h"
- //---------------------------------------------------------------------------
- #pragma link "RichView"
- #pragma link "RVScroll"
- #pragma link "RVStyle"
- #pragma resource "*.dfm"
- TfrmDemo6 *frmDemo6;
- //---------------------------------------------------------------------------
- __fastcall TfrmDemo6::TfrmDemo6(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmDemo6::FormCreate(TObject *Sender)
- {
- ImageIndex = 0;
- Red = 150;
- DRed = 5;
- rvs->TextStyles->Items[rvsHeading]->Color = (TColor)RGB(Red,0,0);
- // How many items the following statements adds? (adding string with 10 "rn"?)
- // Answer: 11! because it is considered like
- // ""+"rn"+""+"rn"+""+"rn"+""+"rn"+""+"rn"+""+"rn"+""+"rn"+""+
- // +"rn"+""+"rn"+""+"rn"+""
- rv->AddTextNL("rnrnrnrnrnrnrnrnrnrn", 0,0,0);
- // And since v1.1 you can use TopMargin and BottomMargin properties instead of
- // adding empty lines!
- rv->AddBulletEx("",0,il,1);
- rv->Add("Credits Demo", 1);
- rv->AddTextNL(
- "Roberto Nelsonrn"
- "Bruce Youngrn"
- "Kim Lambertrn"
- "Leslie Johnsonrn"
- "Phil Forestrn"
- "K.J. Westonrn"
- "Lee Terryrn"
- "Stewart Hallrn"
- "Katherine Youngrn"
- "Chris Papadopulosrn"
- "Pete Fisherrn"
- "Ann Bennetrn"
- "Roger De Sousarn"
- "Janet Boldwinrn"
- "Roger Reevesrn"
- "Willie Stansburyrn"
- "Leslie Phongrn"
- "Ashok Ramanathan",0,0,0);
- rv->AddNL("and other people from Employee.db",2,0);
- rv->AddTextNL("rnrnrnrnrnrnrnrnrnrn", 0,0,0);
- rv->VSmallStep = 1;
- rv->Format();
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmDemo6::tmrTimer(TObject *Sender)
- {
- if (rv->VScrollPos!=rv->VScrollMax)
- rv->VScrollPos = rv->VScrollPos+1;
- else
- rv->VScrollPos = 0;
- Red += DRed;
- rvs->TextStyles->Items[rvsHeading]->Color = (TColor)RGB(Red,0,0);
- if (Red==255 || Red==100)
- DRed = (char)-DRed;
- if (++ImageIndex == il->Count)
- ImageIndex = 0;
- rv->SetBulletInfo(11,"",ImageIndex,NULL,0);
- }
- //---------------------------------------------------------------------------