?? uprintseldlg.pas
字號:
unit UPrintSelDlg;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TPrintSelDlg = class(TForm)
PrinterSetupDialog1: TPrinterSetupDialog;
GroupBox2: TGroupBox;
lbFileName: TLabel;
cbSelectedText: TCheckBox;
GroupBox1: TGroupBox;
Label2: TLabel;
cbHeader: TCheckBox;
cbLineNumbers: TCheckBox;
cbSyntaxPrint: TCheckBox;
cbColor: TCheckBox;
cbWrapLines: TCheckBox;
ebMargin: TEdit;
procedure SetupBtnClick(Sender: TObject);
procedure OKButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
PrintSelDlg: TPrintSelDlg;
implementation
uses uconst, mwCustomEdit, MainForm;
{$R *.DFM}
procedure TPrintSelDlg.SetupBtnClick(Sender: TObject);
begin
PrinterSetupDialog1.Execute;
end;
procedure TPrintSelDlg.OKButtonClick(Sender: TObject);
var
Options: TmwPrintOptions;
begin
Screen.Cursor:= crHourGlass;
Options.SelectedOnly:= cbSelectedText.Checked;
Options.Highlighted:= cbSyntaxPrint.Checked;
Options.PrintRange := Rect(0,0,0,0); // Not using it here.
Options.MarginUnits := muThousandthsOfInches;
Options.Margins := Rect(500, 500, 500, 500); // 1/2 inch margins
Options.WrapLongLines:= cbWrapLines.Checked;
Options.Copies := 1;
Options.Header := TStringList.Create;
Options.Footer := TStringList.Create;
Options.Title:= FMainForm.ActiveUnit;
try
Options.Header.AddObject('Title: $title$', TObject(hfaCenter));
Options.Header.AddObject('Printing Time and Date: $time$ $date$',TObject(hfaLeft));
Options.Header.Add('');
Options.Footer.Add('');
Options.Footer.AddObject('Page Number: $pagenum$ Printing Date/Time: $datetime$', TObject(hfaRight));
ActivePasEditor.Print(nil, Options);
finally
Options.Header.Free;
Options.Footer.Free;
end;
Screen.Cursor:= crDefault;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -