MainFrm.pas
上传用户:daoqigc
上传日期:2021-04-20
资源大小:2795k
文件大小:6k
- unit MainFrm;
- interface
- {.$DEFINE USEGIFIMAGE} // Use this define, if you want to enable Gif support
- // with Anders Melander's TGifImage
- // http://www.torry.net/vcl/graphics/gif/gifimage.exe (original)
- // http://www.trichview.com/resources/thirdparty/gifimage.zip (update)
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, ShellApi,
- Dialogs, StdCtrls, ComCtrls, RVStyle, RVScroll,
- RichView, RVFuncs, ExtCtrls, RVEdit, CRVData, CRVFData, RVOfficeCnv
- {$IFDEF USEGIFIMAGE}
- , GifImage
- {$ENDIF}
- ;
- type
- TfrmMain = class(TForm)
- od: TOpenDialog;
- rvs: TRVStyle;
- rve: TRichViewEdit;
- Panel1: TPanel;
- btnOpen: TButton;
- rvc: TRVOfficeConverter;
- btnSave: TButton;
- sd: TSaveDialog;
- pb: TProgressBar;
- procedure btnOpenClick(Sender: TObject);
- procedure rvcConverting(Sender: TObject; Percent: Integer);
- procedure btnSaveClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure rveReadHyperlink(Sender: TCustomRichView; const Target,
- Extras: String; DocFormat: TRVLoadFormat; var StyleNo,
- ItemTag: Integer; var ItemName: String);
- procedure rveJump(Sender: TObject; id: Integer);
- procedure rveWriteHyperlink(Sender: TCustomRichView; id: Integer;
- RVData: TCustomRVData; ItemNo: Integer; SaveFormat: TRVSaveFormat;
- var Target, Extras: string);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- frmMain: TfrmMain;
- implementation
- {$R *.dfm}
- {====================== Import and export =====================================}
- procedure TfrmMain.FormCreate(Sender: TObject);
- begin
- od.Filter := 'RTF (Built-In RichView Import)|*.rtf|'+rvc.GetImportFilter;
- sd.Filter := 'RTF (Built-In RichView Export)|*.rtf|'+rvc.GetExportFilter;
- rve.Clear;
- rve.Add('This demo shows how to use Microsoft