tvplanit: Fix preview updating issue in print preview desinger.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4929 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-06 21:49:00 +00:00
parent ac3e014109
commit 1c6dc6b123
16 changed files with 172 additions and 149 deletions

View File

@ -25,9 +25,9 @@ object MainForm: TMainForm
Height = 532
Top = 48
Width = 780
ActivePage = TabEvents
ActivePage = TabSettings
Align = alClient
TabIndex = 0
TabIndex = 4
TabOrder = 0
object TabEvents: TTabSheet
Caption = 'Events'
@ -521,15 +521,6 @@ object MainForm: TMainForm
Caption = 'Drawing style:'
ParentColor = False
end
object ComboBox1: TComboBox
Left = 10
Height = 23
Top = 10
Width = 100
ItemHeight = 15
TabOrder = 5
Text = 'ComboBox1'
end
object CbDrawingStyle: TComboBox
Left = 439
Height = 23
@ -544,7 +535,7 @@ object MainForm: TMainForm
)
OnChange = CbDrawingStyleChange
Style = csDropDownList
TabOrder = 6
TabOrder = 5
Text = 'flat'
end
end
@ -707,6 +698,7 @@ object MainForm: TMainForm
Caption.Font.Style = [fsItalic]
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'DayView'
Height = 100
Left = 0
Shape.Shape = ustRectangle
@ -724,6 +716,7 @@ object MainForm: TMainForm
Version = 'v1.04'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'WeekView'
Height = 100
ItemType = itWeekView
Left = 0

View File

@ -19,7 +19,6 @@ TMAINFORM.CBALLOWINPLACEEDITING.CAPTION=Allow inplace editing
TMAINFORM.LBLADDRESSBUILDER.CAPTION=Address builder
TMAINFORM.CBADDRESSBUILDER.TEXT=(default)
TMAINFORM.LBLDRAWINGSTYLE.CAPTION=Drawing style:
TMAINFORM.COMBOBOX1.TEXT=ComboBox1
TMAINFORM.CBDRAWINGSTYLE.TEXT=flat
TMAINFORM.TITLELBL.CAPTION=TitleLbl
TMAINFORM.MENUITEM1.CAPTION=File

View File

@ -24,7 +24,6 @@ type
CbFirstDayOfWeek: TComboBox;
CbAllowInplaceEditing: TCheckBox;
CbAddressBuilder: TComboBox;
ComboBox1: TComboBox;
CbDrawingStyle: TComboBox;
Img: TImage;
ImageList1: TImageList;
@ -359,6 +358,7 @@ end;
procedure TMainForm.MnuEditPrintFormatsClick(Sender: TObject);
begin
VpPrintFormatEditDialog1.DrawingStyle := VpWeekView1.DrawingStyle;
VpPrintFormatEditDialog1.Execute;
end;
@ -387,7 +387,8 @@ begin
VpPrintPreviewDialog1.ControlLink := VpControlLink1;
VpPrintPreviewDialog1.Printer := Printer;
VpPrintPreviewDialog1.StartDate := t1;
VPPrintPreviewDialog1.EndDate := t2;
VpPrintPreviewDialog1.EndDate := t2;
VpPrintPreviewDialog1.DrawingStyle := VpDayView1.DrawingStyle;
if VpPrintPreviewDialog1.Execute then
if PrintDialog1.Execute then begin
Printer.BeginDoc;

View File

@ -215,10 +215,6 @@ msgstr ""
msgid "30 Min"
msgstr "30 Min"
#: tmainform.combobox1.text
msgid "ComboBox1"
msgstr ""
#: tmainform.lbladdressbuilder.caption
msgid "Address builder"
msgstr "Aufbau der Adresse:"

View File

@ -204,10 +204,6 @@ msgstr ""
msgid "30 Min"
msgstr ""
#: tmainform.combobox1.text
msgid "ComboBox1"
msgstr ""
#: tmainform.lbladdressbuilder.caption
msgid "Address builder"
msgstr ""

View File

@ -584,8 +584,8 @@ msgid "M"
msgstr "M"
#: vpsr.rsloadfilebtn
msgid "Load file"
msgstr "Datei laden"
msgid "Load file..."
msgstr "Datei laden..."
#: vpsr.rslocationlbl
msgid "Location:"
@ -936,8 +936,8 @@ msgid "Saturday"
msgstr "Samstag"
#: vpsr.rssavefilebtn
msgid "Save file"
msgstr "Datei speichern"
msgid "Save file..."
msgstr "Datei speichern..."
#: vpsr.rsselectasound
msgid "Select A Sound"

View File

@ -585,7 +585,7 @@ msgid "M"
msgstr "M"
#: vpsr.rsloadfilebtn
msgid "Load file"
msgid "Load file..."
msgstr ""
#: vpsr.rslocationlbl
@ -937,7 +937,7 @@ msgid "Saturday"
msgstr "Zaterdag"
#: vpsr.rssavefilebtn
msgid "Save file"
msgid "Save file..."
msgstr ""
#: vpsr.rsselectasound

View File

@ -574,7 +574,7 @@ msgid "M"
msgstr ""
#: vpsr.rsloadfilebtn
msgid "Load file"
msgid "Load file..."
msgstr ""
#: vpsr.rslocationlbl
@ -926,7 +926,7 @@ msgid "Saturday"
msgstr ""
#: vpsr.rssavefilebtn
msgid "Save file"
msgid "Save file..."
msgstr ""
#: vpsr.rsselectasound

View File

@ -589,7 +589,7 @@ msgid "M"
msgstr ""
#: vpsr.rsloadfilebtn
msgid "Load file"
msgid "Load file..."
msgstr ""
#: vpsr.rslocationlbl
@ -953,7 +953,7 @@ msgid "Saturday"
msgstr "Суббота"
#: vpsr.rssavefilebtn
msgid "Save file"
msgid "Save file..."
msgstr ""
#: vpsr.rsselectasound

View File

@ -2,12 +2,12 @@ object frmPrnFormat: TfrmPrnFormat
Left = 250
Height = 480
Top = 165
Width = 640
Width = 693
HorzScrollBar.Page = 639
VertScrollBar.Page = 479
Caption = 'Print Format Designer'
ClientHeight = 480
ClientWidth = 640
ClientWidth = 693
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnShow = FormShow
@ -25,16 +25,16 @@ object frmPrnFormat: TfrmPrnFormat
object LblElements: TLabel
Left = 8
Height = 15
Top = 205
Top = 225
Width = 51
Caption = 'Ele&ments:'
FocusControl = lbElements
ParentColor = False
end
object btnMoveElementUp: TSpeedButton
Left = 248
Left = 305
Height = 22
Top = 352
Top = 375
Width = 23
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
@ -54,9 +54,9 @@ object frmPrnFormat: TfrmPrnFormat
OnClick = btnMoveElementUpClick
end
object btnMoveElementDn: TSpeedButton
Left = 248
Left = 305
Height = 22
Top = 380
Top = 403
Width = 23
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
@ -76,17 +76,17 @@ object frmPrnFormat: TfrmPrnFormat
OnClick = btnMoveElementDnClick
end
object LblPrintOrder: TLabel
Left = 232
Left = 289
Height = 15
Top = 332
Top = 355
Width = 58
Caption = 'Print Order'
ParentColor = False
end
object btnNewFormat: TButton
Left = 223
Left = 280
Height = 25
Top = 27
Top = 25
Width = 75
Caption = '&New'
Enabled = False
@ -94,21 +94,21 @@ object frmPrnFormat: TfrmPrnFormat
TabOrder = 1
end
object PrintPreviewPanel: TPanel
Left = 312
Left = 365
Height = 439
Top = 0
Width = 320
Align = alRight
BorderSpacing.Right = 8
Caption = 'PrintPreviewPanel'
BevelOuter = bvNone
ClientHeight = 439
ClientWidth = 320
TabOrder = 8
object PrintPreview: TVpPrintPreview
Left = 1
Height = 437
Top = 1
Width = 318
Left = 0
Height = 439
Top = 0
Width = 320
CurPage = 0
EndDate = 37377.6447728357
StartDate = 37370.6447728357
@ -121,9 +121,10 @@ object frmPrnFormat: TfrmPrnFormat
end
object lbFormats: TListBox
Left = 8
Height = 173
Height = 191
Top = 25
Width = 201
Width = 257
Columns = 1
ItemHeight = 0
OnClick = lbFormatsClick
Sorted = True
@ -131,9 +132,9 @@ object frmPrnFormat: TfrmPrnFormat
end
object lbElements: TListBox
Left = 8
Height = 180
Top = 225
Width = 201
Height = 193
Top = 246
Width = 257
ItemHeight = 0
OnClick = lbElementsClick
OnDragDrop = lbElementsDragDrop
@ -142,9 +143,9 @@ object frmPrnFormat: TfrmPrnFormat
TabOrder = 4
end
object btnEditFormat: TButton
Left = 223
Left = 280
Height = 25
Top = 63
Top = 61
Width = 75
Caption = '&Edit'
Enabled = False
@ -152,9 +153,9 @@ object frmPrnFormat: TfrmPrnFormat
TabOrder = 2
end
object btnDeleteFormat: TButton
Left = 223
Left = 280
Height = 25
Top = 99
Top = 97
Width = 75
Caption = '&Delete'
Enabled = False
@ -162,9 +163,9 @@ object frmPrnFormat: TfrmPrnFormat
TabOrder = 3
end
object btnNewElement: TButton
Left = 223
Left = 280
Height = 25
Top = 223
Top = 246
Width = 75
Caption = 'Ne&w'
Enabled = False
@ -172,9 +173,9 @@ object frmPrnFormat: TfrmPrnFormat
TabOrder = 5
end
object btnEditElement: TButton
Left = 223
Left = 280
Height = 25
Top = 259
Top = 282
Width = 75
Caption = 'E&dit'
Enabled = False
@ -182,23 +183,24 @@ object frmPrnFormat: TfrmPrnFormat
TabOrder = 6
end
object btnDeleteElement: TButton
Left = 223
Left = 280
Height = 25
Top = 295
Top = 318
Width = 75
Caption = 'De&lete'
Enabled = False
OnClick = btnDeleteElementClick
TabOrder = 7
end
object Panel2: TPanel
object ButtonPanel: TPanel
Left = 0
Height = 41
Top = 439
Width = 640
Width = 693
Align = alBottom
BevelOuter = bvNone
ClientHeight = 41
ClientWidth = 640
ClientWidth = 693
TabOrder = 9
object btnLoadFile: TButton
Left = 88
@ -228,7 +230,7 @@ object frmPrnFormat: TfrmPrnFormat
TabOrder = 0
end
object btnOk: TButton
Left = 556
Left = 609
Height = 25
Top = 8
Width = 75

View File

@ -68,7 +68,7 @@ type
lbFormats: TListBox;
OpenDialog1: TOpenDialog;
PrintPreviewPanel: TPanel;
Panel2: TPanel;
ButtonPanel: TPanel;
PrintPreview: TVpPrintPreview;
SaveDialog1: TSaveDialog;
btnOk: TButton;
@ -102,7 +102,9 @@ type
IsDirty: Boolean;
LastX, LastY: Integer;
DragItem: Integer;
FDrawingStyle: TVpDrawingStyle;
procedure SetCaptions;
procedure SetDrawingStyle(const v: TVpDrawingStyle);
protected
function DirtyPrompt: Integer;
@ -115,6 +117,7 @@ type
procedure EnableElementButtons(Enable: Boolean);
procedure EnableFormatButtons(Enable: Boolean);
procedure EnableMoveButtons;
procedure RebuildPreview;
procedure SetFormatFileName(const v: string);
procedure UpdateFormats;
procedure UpdateCaption;
@ -124,8 +127,9 @@ type
procedure SetControlLink(const Value: TVpControlLink);
public
function Execute : Boolean;
property ControlLink : TVpControlLink read FControlLink write SetControlLink;
function Execute: Boolean;
property ControlLink: TVpControlLink read FControlLink write SetControlLink;
property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle;
published
property FormatFileName : string read FFormatFileName write SetFormatFileName;
@ -578,10 +582,7 @@ begin
Prn.CurFormat := Idx;
PrintPreview.ControlLink := ControlLink;
PrintPreview.ForceUpdate;
PrintPreview.FirstPage;
// PrintPreview.Invalidate;
RebuildPreview;
for i := 0 to Pred(Prn.PrintFormats.Items[Idx].Elements.Count) do begin
E := Prn.PrintFormats.Items[Idx].Elements.Items[i];
@ -636,7 +637,13 @@ begin
LastY := Y;
Accept := True;
end;
{=====}
procedure TfrmPrnFormat.RebuildPreview;
begin
PrintPreview.ForceUpdate;
PrintPreview.FirstPage;
end;
procedure TfrmPrnFormat.SetControlLink(const Value: TVpControlLink);
begin
if FControlLink <> Value then begin
@ -649,7 +656,7 @@ end;
procedure TfrmPrnFormat.SetCaptions;
var
cnv: TControlCanvas;
w: Integer;
i, w: Integer;
wPrv: Integer;
begin
wPrv := PrintPreview.Width;
@ -676,7 +683,7 @@ begin
cnv.Font.Assign(btnNewFile.Font);
w := Max(w, cnv.TextWidth(RSNewFileBtn));
w := Max(w, cnv.TextWidth(RSLoadFileBtn));
w := Max(W, cnv.TextWidth(RSSaveFileBtn));
w := Max(w, cnv.TextWidth(RSSaveFileBtn));
btnNewFile.Width := w + 16;
btnLoadFile.Left := btnNewFile.Left + btnNewFile.Width + 8;
btnLoadFile.Width := btnNewFile.Width;
@ -713,6 +720,15 @@ begin
end;
end;
procedure TfrmPrnFormat.SetDrawingStyle(const v: TVpDrawingStyle);
begin
FDrawingStyle := v;
if FDrawingStyle = dsNoBorder then
PrintPreview.BorderStyle := bsNone else
PrintPreview.BorderStyle := bsSingle;
PrintPreview.DrawingStyle := FDrawingStyle;
end;
procedure TfrmPrnFormat.SetFormatFileName(const v: string);
begin
if v <> FFormatFileName then begin
@ -731,10 +747,32 @@ procedure TfrmPrnFormat.UpdateFormats;
var
i: Integer;
Prn: TVpPrinter;
w: Integer;
cnv: TControlCanvas;
begin
Prn := ControlLink.Printer;
for i := 0 to Pred(Prn.PrintFormats.Count) do
lbFormats.Items.AddObject(Prn.PrintFormats.Items[i].FormatName, Prn.PrintFormats.Items[i]);
// Show a horizontal scrollbar if list items are too wide
w := 0;
cnv := TControlCanvas.Create;
try
cnv.Control := lbFormats;
cnv.Font := lbFormats.Font;
w := 0;
for i:=0 to lbFormats.Items.Count-1 do
w := Max(w, cnv.TextWidth(lbFormats.Items[i]));
lbFormats.ScrollWidth := w + 8;
w := 0;
for i:=0 to lbElements.Items.Count-1 do
w := Max(w, cnv.TextWidth(lbElements.Items[i]));
lbElements.ScrollWidth := w + 8;
finally
cnv.Free;
end;
EnableMoveButtons;
end;
{=====}
@ -752,6 +790,7 @@ begin
end;
Prn.NotifyLinked;
EnableMoveButtons;
RebuildPreview;
end;
{=====}

View File

@ -49,20 +49,19 @@ type
TVpPrintFormatEditDialog = class (TVpBaseDialog)
private
FControlLink: TVpControlLink;
FDrawingStyle: TVpDrawingStyle;
FWindowState: TWindowState;
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure SetControlLink(const Value: TVpControlLink);
public
constructor Create (AOwner : TComponent); override;
function Execute : Boolean; override;
constructor Create(AOwner: TComponent); override;
function Execute: Boolean; override;
published
property ControlLink : TVpControlLink
read FControlLink write SetControlLink;
property WindowState : TWindowState
read FWindowState write FWindowState default wsNormal;
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;
property Options;
property Placement;
@ -78,6 +77,7 @@ constructor TVpPrintFormatEditDialog.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FControlLink := SearchControlLink (Owner);
FDrawingStyle := ds3d;
FPlacement.Height := 480;
FPlacement.Width := 640;
@ -93,6 +93,7 @@ begin
DoFormPlacement(PrtFmtDlg);
PrtFmtDlg.WindowState := WindowState;
PrtFmtDlg.ControlLink := ControlLink;
PrtFmtDlg.DrawingStyle := FDrawingStyle;
Result := PrtFmtDlg.Execute;
finally
PrtFmtDlg.Free;

View File

@ -773,37 +773,28 @@ var
end;
procedure DrawBorders;
var
R: TRect;
begin
if FBorderStyle = bsSingle then begin
R := ClientRect;
if FDrawingStyle = dsFlat then begin
{ draw an outer and inner bevel }
DrawBevelRect(
WorkBmp.Canvas,
Rect(ClientRect.Left, ClientRect.Top, ClientRect.Right - 1, ClientRect.Bottom - 1),
clBtnShadow,
clBtnHighlight
);
DrawBevelRect(
WorkBmp.Canvas,
Rect(ClientRect.Left + 1, ClientRect.Top + 1, ClientRect.Right - 2, ClientRect.Bottom - 2),
clBtnHighlight,
clBtnShadow
);
// Draw a simple rectangular border
//InflateRect(R, 1, 1);
DrawBevelRect(WorkBmp.Canvas, R, clBtnShadow, clBtnShadow);
{
DrawBevelRect(WorkBmp.Canvas, R, clBtnShadow, clBtnHighlight);
InflateRect(R, 1,1);
DrawBevelRect(WorkBmp.Canvas, R, clBtnHighlight, clBtnShadow);
}
end else
if FDrawingStyle = ds3d then begin
{ draw a 3d bevel }
DrawBevelRect(
WorkBmp.Canvas,
Rect(ClientRect.Left, ClientRect.Top, ClientRect.Right - 1, ClientRect.Bottom - 1),
clBtnShadow,
clBtnHighlight
);
DrawBevelRect(
WorkBmp.Canvas,
Rect(ClientRect.Left + 1, ClientRect.Top + 1, ClientRect.Right - 2, ClientRect.Bottom - 2),
cl3DDkShadow,
clBtnFace
);
// Draw a 3d bevel
dec(R.Right);
dec(R.Bottom);
DrawBevelRect(WorkBmp.Canvas, R, clBtnShadow, clBtnHighlight);
InflateRect(R, -1, -1);
DrawBevelRect(WorkBmp.Canvas, R, cl3DDkShadow, clBtnFace);
end;
end;
end;

View File

@ -1,13 +1,13 @@
object frmPrintPreview: TfrmPrintPreview
Left = 325
Height = 791
Height = 818
Top = 118
Width = 539
Width = 540
HorzScrollBar.Page = 476
VertScrollBar.Page = 517
Caption = 'Print Preview'
ClientHeight = 791
ClientWidth = 539
ClientHeight = 818
ClientWidth = 540
Constraints.MinHeight = 200
Constraints.MinWidth = 395
KeyPreview = True
@ -19,10 +19,10 @@ object frmPrintPreview: TfrmPrintPreview
Left = 0
Height = 62
Top = 0
Width = 539
Width = 540
Align = alTop
ClientHeight = 62
ClientWidth = 539
ClientWidth = 540
TabOrder = 0
object cboxZoom: TComboBox
Left = 296
@ -57,7 +57,7 @@ object frmPrintPreview: TfrmPrintPreview
Left = 1
Height = 27
Top = 1
Width = 537
Width = 538
AutoSize = True
ButtonHeight = 25
ButtonWidth = 25
@ -125,9 +125,9 @@ object frmPrintPreview: TfrmPrintPreview
end
object VpPrintPreview1: TVpPrintPreview
Left = 0
Height = 729
Height = 756
Top = 62
Width = 539
Width = 540
CurPage = 0
EndDate = 37355.4526088079
StartDate = 37348.4526088079
@ -137,8 +137,8 @@ object frmPrintPreview: TfrmPrintPreview
TabOrder = 1
end
object imMain: TImageList
left = 357
top = 195
left = 272
top = 160
Bitmap = {
4C690600000010000000100000005B4848005B4848005B484800564343008679
799CD1CDCDF3D1CDCDEFD0CCCCEFD1CCCCEFD2CDCDEFD3CDCDF38E8181A75747
@ -338,8 +338,8 @@ object frmPrintPreview: TfrmPrintPreview
object actMain: TActionList
Images = imMain
OnUpdate = actMainUpdate
left = 272
top = 152
left = 192
top = 160
object actPrint: TAction
Caption = '&Print'
Hint = 'Print'

View File

@ -38,26 +38,11 @@ uses
{$ELSE}
Windows, Messages,
{$ENDIF}
SysUtils,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls,
ExtCtrls,
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
Buttons, Printers, ImgList, ComCtrls, ToolWin, ActnList,
{$IFDEF VERSION6} Variants, {$ENDIF}
VpMisc,
VpBase,
VpException,
VpData,
VpPrtPrv,
VpSR,
VpBaseDS,
VpDlg,
Buttons,
VpPrtFmtCBox,
Printers, ImgList, ComCtrls, ToolWin, ActnList;
VpMisc, VpBase, VpException, VpData, VpPrtPrv, VpSR, VpBaseDS, VpDlg,
VpPrtFmtCBox;
type
TVpPrintPreviewDialog = class;
@ -102,12 +87,15 @@ type
procedure VpPrintFormatComboBox1Change(Sender: TObject);
private
FDrawingStyle: TVpDrawingStyle;
procedure SetCaptions;
procedure SetDrawingStyle(AValue: TVpDrawingStyle);
public
Resource: TVpResource;
Contact: TVpContact;
ReturnCode: TVpEditorReturnCode;
property DrawingStyle: TVpDrawingStyle read FDrawingStyle write SetDrawingStyle;
end;
TVpPrintPreviewDialog = class (TVpBaseDialog)
@ -115,6 +103,7 @@ type
FControlLink: TVpControlLink;
FAutoPrint: Boolean;
FBottomMargin: Extended;
FDrawingStyle: TVpDrawingStyle;
FEndDate: TDateTime;
FLeftMargin: Extended;
FMarginUnits: TVpItemMeasurement;
@ -148,6 +137,7 @@ type
property AutoPrint: Boolean read FAutoPrint write SetAutoPrint default False;
property BottomMargin: Extended read FBottomMargin write SetBottomMargin;
property ControlLink: TVpControlLink read FControlLink write SetControlLink;
property DrawingStyle: TVpDrawingStyle read FDrawingStyle write FDrawingStyle default ds3D;
property EndDate: TDateTime read FEndDate write SetEndDate;
property LeftMargin: Extended read FLeftMargin write SetLeftMargin;
property MarginUnits: TVpItemMeasurement read FMarginUnits write SetMarginUnits default imInches;
@ -174,6 +164,8 @@ uses
Math,
VpPrtFmt;
{ TfrmPrintPreview }
procedure TfrmPrintPreview.FormCreate(Sender: TObject);
begin
ReturnCode := rtAbandon;
@ -197,19 +189,30 @@ begin
actCancel.Hint := RSPrintPrvCancelHint;
end;
procedure TfrmPrintPreview.SetDrawingStyle(AValue: TVpDrawingStyle);
begin
FDrawingStyle := AValue;
if FDrawingStyle = dsNoBorder then
VpPrintPreview1.BorderStyle := bsNone else
VpPrintPreview1.BorderStyle := bsSingle;
VpPrintPreview1.DrawingStyle := FDrawingStyle;
end;
procedure TfrmPrintPreview.VpPrintFormatComboBox1Change(Sender: TObject);
begin
VpPrintPreview1.ForceUpdate;
VpPrintPreview1.FirstPage;
end;
procedure TfrmPrintPreview.OKBtnClick(Sender: TObject);
begin
ReturnCode := rtCommit;
Close;
end;
{ TVpPrintPreviewDialog }
constructor TVpPrintPreviewDialog.Create(AOwner: TComponent);
begin
inherited Create (AOwner);
@ -222,6 +225,7 @@ begin
FAutoPrint := False;
FControlLink := SearchControlLink(Owner);
FPrinter := Printer;
DrawingStyle := ds3D;
end;
function TVpPrintPreviewDialog.Execute: Boolean;
@ -229,7 +233,7 @@ var
EditForm: TfrmPrintPreview;
begin
Result := False;
Application.CreateForm(TfrmPrintPreview, EditForm);
EditForm := TfrmPrintPreview.Create(Application);
try
DoFormPlacement(EditForm);
EditForm.WindowState := WindowState;
@ -242,6 +246,7 @@ begin
EditForm.VpPrintPreview1.Printer := Printer;
EditForm.VpPrintPreview1.ForceUpdate;
EditForm.VpPrintPreview1.FirstPage;
EditForm.DrawingStyle := FDrawingStyle;
EditForm.ShowModal;
if EditForm.ReturnCode = rtCommit then begin
Result := True;
@ -255,7 +260,7 @@ begin
end;
end;
finally
EditForm.Release;
EditForm.Free;
end;
end;

View File

@ -413,8 +413,8 @@ resourcestring
RSDeleteBtn = 'Delete';
RSPrintOrder = 'Print order';
RSNewFileBtn = 'New file';
RSLoadFileBtn = 'Load file';
RSSaveFileBtn = 'Save file';
RSLoadFileBtn = 'Load file...';
RSSaveFileBtn = 'Save file...';
{ Automatic resource adding/selection} {!!.01}
RSAddNewResource = 'No resources have been defined. Would you ' + {!!.01}