TPrintPreview with a public Property PaperView: TPaperPrevi

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

TPrintPreview with a public Property PaperView: TPaperPrevi

Postby TactiSoft » July 9th, 2010, 6:32 am

Hello,

I use your TPrintPreview component. May i suggest you to modify TPrintPreview so that the field FPaperView would becom accessible from outside the component.

TPrintPreview = class(TScrollBox)
private
{...}
FPaperView: TPaperPreview;
{ ...others declarations }

Public
Property PaperView: TPaperPreview read FPaperView;
{...}
end;

Why?:
Because it make sense in some application like mine which create visual objects on the paper area so that they become incorporated in the final Metafile and then be used in a PDF document (i use PDFCreatorPilot http://www.colorpilot.com )

For the moment, and as a 'worth solution' i create an Component derived from yours as this:

unit PreviewEx;

interface

uses Preview;
type

TPrintPreviewEx=class(TPrintPreview)
private
function GetPaperView: TPaperPreview;
public
property PaperView:TPaperPreview read GetPaperView ;
end;

procedure Register;

implementation
uses
Classes,Controls;
procedure Register;
begin
RegisterComponents('Delphi Area', [TPrintPreviewEx]);
end;


{ TPrintPreviewEx }

function TPrintPreviewEx.GetPaperView: TPaperPreview;
var
ctl:TControl;
I:Integer;
begin
result:=NIL;
for i := 0 to self.ControlCount-1 do
begin
ctl:=self.Controls[i];
if ctl is TPaperPreview then
begin
result:=ctl as TPaperPreview ;
break;
end;
end;

end;

end.
TactiSoft
Member
Member
 
Posts: 1
Joined: July 9th, 2010, 6:13 am

Re: TPrintPreview with a public Property PaperView: TPaperP

Postby Kambiz » July 30th, 2010, 4:38 am

In the next release, the PaperViewControl will serve your needs.

Code: Select all
public
  property PaperViewControl: TPaperView;

Thanks for bringing this issue in my attention.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 4 guests

cron