2008-02-03 12:05:55 +00:00
|
|
|
{*********************************************************}
|
|
|
|
{* VPPRTFMTDLG.PAS 1.03 *}
|
|
|
|
{*********************************************************}
|
|
|
|
|
|
|
|
{* ***** BEGIN LICENSE BLOCK ***** *}
|
|
|
|
{* Version: MPL 1.1 *}
|
|
|
|
{* *}
|
|
|
|
{* The contents of this file are subject to the Mozilla Public License *}
|
|
|
|
{* Version 1.1 (the "License"); you may not use this file except in *}
|
|
|
|
{* compliance with the License. You may obtain a copy of the License at *}
|
|
|
|
{* http://www.mozilla.org/MPL/ *}
|
|
|
|
{* *}
|
|
|
|
{* Software distributed under the License is distributed on an "AS IS" basis, *}
|
|
|
|
{* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License *}
|
|
|
|
{* for the specific language governing rights and limitations under the *}
|
|
|
|
{* License. *}
|
|
|
|
{* *}
|
|
|
|
{* The Original Code is TurboPower Visual PlanIt *}
|
|
|
|
{* *}
|
|
|
|
{* The Initial Developer of the Original Code is TurboPower Software *}
|
|
|
|
{* *}
|
|
|
|
{* Portions created by TurboPower Software Inc. are Copyright (C) 2002 *}
|
|
|
|
{* TurboPower Software Inc. All Rights Reserved. *}
|
|
|
|
{* *}
|
|
|
|
{* Contributor(s): *}
|
|
|
|
{* *}
|
|
|
|
{* ***** END LICENSE BLOCK ***** *}
|
|
|
|
|
|
|
|
{$I Vp.INC}
|
|
|
|
|
|
|
|
unit VpPrtFmtDlg;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
{$IFDEF LCL}
|
2016-07-12 18:00:32 +00:00
|
|
|
LCLProc, LCLType, LCLIntf,
|
2008-02-03 12:05:55 +00:00
|
|
|
{$ELSE}
|
2016-07-12 18:00:32 +00:00
|
|
|
Windows, Messages,
|
2008-02-03 12:05:55 +00:00
|
|
|
{$ENDIF}
|
2016-11-21 17:12:05 +00:00
|
|
|
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls,
|
2016-07-12 18:00:32 +00:00
|
|
|
VpBase, VpBaseDS, VpDlg, VpPrtFmtCBox, VpEdFmtLst;
|
2008-02-03 12:05:55 +00:00
|
|
|
|
|
|
|
type
|
|
|
|
|
2016-07-14 15:26:55 +00:00
|
|
|
TVpPrintFormatEditDialog = class(TVpBaseDialog)
|
2008-02-03 12:05:55 +00:00
|
|
|
private
|
|
|
|
FControlLink: TVpControlLink;
|
2016-07-06 21:49:00 +00:00
|
|
|
FDrawingStyle: TVpDrawingStyle;
|
2008-02-03 12:05:55 +00:00
|
|
|
FWindowState: TWindowState;
|
|
|
|
protected
|
|
|
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
|
|
|
procedure SetControlLink(const Value: TVpControlLink);
|
|
|
|
public
|
2016-07-06 21:49:00 +00:00
|
|
|
constructor Create(AOwner: TComponent); override;
|
|
|
|
function Execute: Boolean; override;
|
2008-02-03 12:05:55 +00:00
|
|
|
|
|
|
|
published
|
2016-07-06 21:49:00 +00:00
|
|
|
property ControlLink : TVpControlLink read FControlLink write SetControlLink;
|
|
|
|
property DrawingStyle: TVpDrawingStyle read FDrawingStyle write FDrawingStyle default ds3d;
|
|
|
|
property WindowState : TWindowState read FWindowState write FWindowState default wsNormal;
|
2008-02-03 12:05:55 +00:00
|
|
|
|
|
|
|
property Options;
|
|
|
|
property Placement;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2016-11-21 17:12:05 +00:00
|
|
|
uses
|
|
|
|
TypInfo;
|
2008-02-03 12:05:55 +00:00
|
|
|
|
|
|
|
{ TVpPrintFormatEditDialog }
|
|
|
|
|
|
|
|
constructor TVpPrintFormatEditDialog.Create(AOwner: TComponent);
|
|
|
|
begin
|
|
|
|
inherited Create(AOwner);
|
2016-07-06 18:56:23 +00:00
|
|
|
FControlLink := SearchControlLink (Owner);
|
2016-07-06 21:49:00 +00:00
|
|
|
FDrawingStyle := ds3d;
|
2008-02-03 12:05:55 +00:00
|
|
|
|
|
|
|
FPlacement.Height := 480;
|
2016-07-06 18:56:23 +00:00
|
|
|
FPlacement.Width := 640;
|
2008-02-03 12:05:55 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
function TVpPrintFormatEditDialog.Execute: Boolean;
|
|
|
|
var
|
|
|
|
PrtFmtDlg : TfrmPrnFormat;
|
|
|
|
begin
|
2016-07-06 18:56:23 +00:00
|
|
|
PrtFmtDlg := TfrmPrnFormat.Create(Application);
|
|
|
|
// Application.CreateForm(TfrmPrnFormat, PrtFmtDlg);
|
2008-02-03 12:05:55 +00:00
|
|
|
try
|
|
|
|
DoFormPlacement(PrtFmtDlg);
|
|
|
|
PrtFmtDlg.WindowState := WindowState;
|
|
|
|
PrtFmtDlg.ControlLink := ControlLink;
|
2016-07-06 21:49:00 +00:00
|
|
|
PrtFmtDlg.DrawingStyle := FDrawingStyle;
|
2008-02-03 12:05:55 +00:00
|
|
|
Result := PrtFmtDlg.Execute;
|
|
|
|
finally
|
2016-07-06 18:56:23 +00:00
|
|
|
PrtFmtDlg.Free;
|
2008-02-03 12:05:55 +00:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2016-07-06 18:56:23 +00:00
|
|
|
procedure TVpPrintFormatEditDialog.Notification(AComponent: TComponent;
|
|
|
|
Operation: TOperation);
|
2008-02-03 12:05:55 +00:00
|
|
|
{-Handle new/deleted components}
|
|
|
|
begin
|
|
|
|
inherited Notification (AComponent, Operation);
|
|
|
|
|
|
|
|
if Operation = opRemove then begin
|
|
|
|
{Owned components going away}
|
|
|
|
if AComponent = FControlLink then begin
|
|
|
|
FControlLink := nil;
|
|
|
|
end;
|
|
|
|
end else if Operation = opInsert then begin
|
|
|
|
if AComponent is TVpControlLink then begin
|
|
|
|
if not Assigned (FControlLink) then begin
|
|
|
|
FControlLink := TVpControlLink (AComponent);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TVpPrintFormatEditDialog.SetControlLink(
|
|
|
|
const Value: TVpControlLink);
|
|
|
|
begin
|
|
|
|
if FControlLink <> Value then
|
|
|
|
FControlLink := Value;
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|