Class TRyPrinter (unit Rprev16)

Inherits from

TObject

Public declarations

Constructors


constructor Create;



Functions

destructor Destroy;


procedure DisplayPage(Page : Integer);

Routine that is called by the Preview form to display page Actually called in PaintBox1.

procedure DonePrinting;

Called once before Preview, PrintIt, or PringPage - if you don't call it, it will be called automatically

procedure Line(const a, b : TPoint);


function MemoOut(const aRect : TRect; p : PChar; DisposePChar : Boolean; DontPrint : Boolean): Integer;

Spits out a memo between two bounds (bottom is irrelevant) includes TabStop functionality - outputs Height of finished text

procedure NewJob;

Must call before drawing - automatically creates the first page

function NewPage : Integer;


function PageSize : TPoint;

reports the physical page

procedure Preview;


procedure PrintIt;


procedure PrintPage(const PageNum : Integer);

Here's the gold - when you're done drawing, call one or all of these to display or print your work

function PrintSize : TPoint;

reports the Printable area

procedure PutPageNums(const X, Y : Integer; Alignment : TAlignment);

steps through the pages and puts the page numbers at the position you specify, for ex.

procedure Rectangle(const aRect : TRect);


procedure SaveToFile(const TheFile : String);

for some reason this doesn't work - can't figure out why - it write the files, but the files are unreadable

function TextHeight: Integer;


procedure TextOut(const X, Y : Integer; const Text : String);


procedure TextOutCenter(const X, Y : Integer; const Text : String);


procedure TextOutRight(const X, Y : Integer; const Text : String);


procedure TextRect(const aRect : TRect; const X, Y : Integer; const Text : String);


function TextWidth(const Text : String): Integer;


function XInch(const aSingle : Single): Integer;

Takes Inches and outputs Pixels

function YInch(const aSingle : Single): Integer;


function GetCanvas(Index : Integer): TCanvas;


function GetFont : TFont;


function GetMetafile(Index : Integer): TMetafile;


function GetPageCount : Integer;


function GetPen : TPen;


procedure SetCurrentPage(Index : Integer);


procedure SetFont(Value : TFont);


procedure SetOrientation(Value : TPrinterOrientation);


procedure SetPen(Value : TPen);


Properties

property Canvases : TCanvas

don't try using canvases after DonePrinting - the handles will be invalid

property CurrentPage : Integer


property Font : TFont


property Metafiles : TMetafile


property Orientation : TPrinterOrientation

best to set Orientation before calling NewJob

property PageCount : Integer


property Pen : TPen


Events

Variables

pXppi : Integer;

Public declarations

pYppi : Integer;


Title : String;

Assign Title before call to PrintIt or PrintPage (not necessary

XOff : Integer;

Reports where the Printable area starts

YOff : Integer;


FCanvases : TList;

Raw canvases - with Handles connected to OPEN metafiles

FCurrentPage : Integer;

Private declarations } {Current page

FDonePrinting : Boolean;


FMetafiles : TList;

Metafiles - with Handles connected to CLOSED metafiles

FOrientation : TPrinterOrientation;


FRyPreviewForm : TRyPreviewFrm;

Pointer to the preview form, which isn't created until Preview is called


Constructors


constructor Create;


Functions


destructor Destroy;


procedure DisplayPage(Page : Integer);

Routine that is called by the Preview form to display page Actually called in PaintBox1.OnPaint - Don't call this (it might be best to put this in the preview form


procedure DonePrinting;

Called once before Preview, PrintIt, or PringPage - if you don't call it, it will be called automatically


procedure Line(const a, b : TPoint);


function MemoOut(const aRect : TRect; p : PChar; DisposePChar : Boolean; DontPrint : Boolean): Integer;

Spits out a memo between two bounds (bottom is irrelevant) includes TabStop functionality - outputs Height of finished text


procedure NewJob;

Must call before drawing - automatically creates the first page


function NewPage : Integer;


function PageSize : TPoint;

reports the physical page


procedure Preview;


procedure PrintIt;


procedure PrintPage(const PageNum : Integer);

Here's the gold - when you're done drawing, call one or all of these to display or print your work


function PrintSize : TPoint;

reports the Printable area


procedure PutPageNums(const X, Y : Integer; Alignment : TAlignment);

steps through the pages and puts the page numbers at the position you specify, for ex. "Page 1 of 2" - call after all your drawing for best results

it's a tab


procedure Rectangle(const aRect : TRect);


procedure SaveToFile(const TheFile : String);

for some reason this doesn't work - can't figure out why - it write the files, but the files are unreadable


function TextHeight: Integer;


procedure TextOut(const X, Y : Integer; const Text : String);


procedure TextOutCenter(const X, Y : Integer; const Text : String);


procedure TextOutRight(const X, Y : Integer; const Text : String);


procedure TextRect(const aRect : TRect; const X, Y : Integer; const Text : String);


function TextWidth(const Text : String): Integer;


function XInch(const aSingle : Single): Integer;

Takes Inches and outputs Pixels


function YInch(const aSingle : Single): Integer;


function GetCanvas(Index : Integer): TCanvas;


function GetFont : TFont;


function GetMetafile(Index : Integer): TMetafile;


function GetPageCount : Integer;


function GetPen : TPen;


procedure SetCurrentPage(Index : Integer);


procedure SetFont(Value : TFont);


procedure SetOrientation(Value : TPrinterOrientation);


procedure SetPen(Value : TPen);


Properties


property Canvases : TCanvas

don't try using canvases after DonePrinting - the handles will be invalid


property CurrentPage : Integer


property Font : TFont


property Metafiles : TMetafile


property Orientation : TPrinterOrientation

best to set Orientation before calling NewJob


property PageCount : Integer


property Pen : TPen


Events


Variables


pXppi : Integer;

Public declarations


pYppi : Integer;


Title : String;

Assign Title before call to PrintIt or PrintPage (not necessary


XOff : Integer;

Reports where the Printable area starts


YOff : Integer;


FCanvases : TList;

Raw canvases - with Handles connected to OPEN metafiles


FCurrentPage : Integer;

Private declarations } {Current page


FDonePrinting : Boolean;


FMetafiles : TList;

Metafiles - with Handles connected to CLOSED metafiles


FOrientation : TPrinterOrientation;


FRyPreviewForm : TRyPreviewFrm;

Pointer to the preview form, which isn't created until Preview is called