unit MFPreview;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  SRVPrint, StdCtrls, Spin, ExtCtrls, RVScroll, CRVPP, SRVPreview;

type
  TFPreview = class(TForm)
    SRVPreview1: TSRVPreview;
    Panel2: TPanel;
    btnUpdatePreview: TButton;
    spinPageNo: TSpinEdit;
    cbAutoUpdate: TCheckBox;
    SRVPrint1: TSRVPrint;
    Button1: TButton;
    Button2: TButton;
    procedure cbAutoUpdateClick(Sender: TObject);
    procedure spinPageNoChange(Sender: TObject);
    procedure btnUpdatePreviewClick(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FPreview: TFPreview;

implementation

uses MFInsertControls;

{$R *.DFM}

procedure TFPreview.cbAutoUpdateClick(Sender: TObject);
begin
  SRVPrint1.AutoUpdate := cbAutoUpdate.Checked;
end;

procedure TFPreview.spinPageNoChange(Sender: TObject);
begin
  SRVPreview1.PageNo := spinPageNo.Value;
end;

procedure TFPreview.btnUpdatePreviewClick(Sender: TObject);
begin
  SRVPreview1.PageNo := spinPageNo.Value;
end;

procedure TFPreview.Button1Click(Sender: TObject);
begin
  FInsertControls.SRichViewEdit1.PrintAll;
end;

procedure TFPreview.Button2Click(Sender: TObject);
begin
  SRVPrint1.PrintFrames('', SRVPreview1.PageNo);
end;

end.
