unit1.cpp
来自「与Action相结合,可以解决中文件显示乱码」· C++ 代码 · 共 49 行
CPP
49 行
/*=============================================================================}
{ This demo show how to use information about hypertext item. }
{------------------------------------------------------------------------------}
{ Key methods: }
{ - GetJumpPointItemNo; }
{ - methods for obtaining information about items (see first demo in this }
{ group. }
{ Useful if text is self-describing (for example, for WWW addresses). }
{=============================================================================*/
#include <vcl\vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma link "RichView"
#pragma link "RVScroll"
#pragma link "RVStyle"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
RichView1->AddNL("Hypertext",1,1);
RichView1->AddNL("Some text styles can be chosen as hypertext styles. ",0,0);
RichView1->AddNL("Like this one.",4,-1);
RichView1->AddNL(" You can have as many hypertext styles as you want. ",0,-1);
RichView1->AddNL("Here is one more.",5,-1);
RichView1->AddNL("Images from Image Lists also can be hypertext: ",0,0);
RichView1->AddHotspotEx("Pen Image", 0,1, ImageList1, -1);
RichView1->AddNL(" Such images are called 'hotspots'.",0,-1);
RichView1->AddNL("Normal images also can be hypertext: ",0,0);
TIcon* ico = new TIcon;
ico->Assign(Image1->Picture->Graphic);
RichView1->AddHotPicture("Bobo", ico, -1, rvvaBaseline);
RichView1->Format();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RichView1Jump(TObject *Sender, int id)
{
int ItemNo = RichView1->GetJumpPointItemNo(id);
Panel1->Caption = AnsiString("Clicked: ")+RichView1->GetItemText(ItemNo);
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?