📄 iwdnprinterproj_tlb.pas
字号:
property SnapBuffer: Integer read Get_SnapBuffer write Set_SnapBuffer;
property DoubleBuffered: WordBool read Get_DoubleBuffered write Set_DoubleBuffered;
property AlignDisabled: WordBool read Get_AlignDisabled;
property VisibleDockClientCount: Integer read Get_VisibleDockClientCount;
property Enabled: WordBool read Get_Enabled write Set_Enabled;
end;
// *********************************************************************//
// DispIntf: IActiveFormXDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {BFE17BA6-2B6D-44EB-BC71-C317444C1CFE}
// *********************************************************************//
IActiveFormXDisp = dispinterface
['{BFE17BA6-2B6D-44EB-BC71-C317444C1CFE}']
property Visible: WordBool dispid 201;
property AutoScroll: WordBool dispid 202;
property AutoSize: WordBool dispid 203;
property AxBorderStyle: TxActiveFormBorderStyle dispid 204;
property Caption: WideString dispid -518;
property Color: OLE_COLOR dispid -501;
property Font: IFontDisp dispid -512;
property KeyPreview: WordBool dispid 205;
property PixelsPerInch: Integer dispid 206;
property PrintScale: TxPrintScale dispid 207;
property Scaled: WordBool dispid 208;
property Active: WordBool readonly dispid 209;
property DropTarget: WordBool dispid 210;
property HelpFile: WideString dispid 211;
property ScreenSnap: WordBool dispid 212;
property SnapBuffer: Integer dispid 213;
property DoubleBuffered: WordBool dispid 214;
property AlignDisabled: WordBool readonly dispid 215;
property VisibleDockClientCount: Integer readonly dispid 216;
property Enabled: WordBool dispid -514;
procedure AboutBox; dispid -552;
end;
// *********************************************************************//
// DispIntf: IActiveFormXEvents
// Flags: (0)
// GUID: {8DC169AA-CD58-4C03-BD99-DF5705C6BEDE}
// *********************************************************************//
IActiveFormXEvents = dispinterface
['{8DC169AA-CD58-4C03-BD99-DF5705C6BEDE}']
procedure OnActivate; dispid 201;
procedure OnClick; dispid 202;
procedure OnCreate; dispid 203;
procedure OnDblClick; dispid 204;
procedure OnDestroy; dispid 205;
procedure OnDeactivate; dispid 206;
procedure OnKeyPress(var Key: Smallint); dispid 207;
procedure OnPaint; dispid 208;
end;
// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name : TiwDNPrinter
// Help String : iwDNPrinter Control
// Default Interface: IiwDNPrinter
// Def. Intf. DISP? : No
// Event Interface: IiwDNPrinterEvents
// TypeFlags : (34) CanCreate Control
// *********************************************************************//
TiwDNPrinterOnKeyPress = procedure(ASender: TObject; var Key: Smallint) of object;
TiwDNPrinter = class(TOleControl)
private
FOnActivate: TNotifyEvent;
FOnClick: TNotifyEvent;
FOnCreate: TNotifyEvent;
FOnDblClick: TNotifyEvent;
FOnDestroy: TNotifyEvent;
FOnDeactivate: TNotifyEvent;
FOnKeyPress: TiwDNPrinterOnKeyPress;
FOnPaint: TNotifyEvent;
FIntf: IiwDNPrinter;
function GetControlInterface: IiwDNPrinter;
protected
procedure CreateControl;
procedure InitControlData; override;
public
procedure AboutBox;
property ControlInterface: IiwDNPrinter read GetControlInterface;
property DefaultInterface: IiwDNPrinter read GetControlInterface;
property Visible: WordBool index 201 read GetWordBoolProp write SetWordBoolProp;
property Active: WordBool index 209 read GetWordBoolProp;
property DropTarget: WordBool index 210 read GetWordBoolProp write SetWordBoolProp;
property HelpFile: WideString index 211 read GetWideStringProp write SetWideStringProp;
property ScreenSnap: WordBool index 212 read GetWordBoolProp write SetWordBoolProp;
property SnapBuffer: Integer index 213 read GetIntegerProp write SetIntegerProp;
property DoubleBuffered: WordBool index 214 read GetWordBoolProp write SetWordBoolProp;
property AlignDisabled: WordBool index 215 read GetWordBoolProp;
property VisibleDockClientCount: Integer index 216 read GetIntegerProp;
property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp;
published
property Anchors;
property AutoScroll: WordBool index 202 read GetWordBoolProp write SetWordBoolProp stored False;
property AutoSize: WordBool index 203 read GetWordBoolProp write SetWordBoolProp stored False;
property AxBorderStyle: TOleEnum index 204 read GetTOleEnumProp write SetTOleEnumProp stored False;
property Caption: WideString index -518 read GetWideStringProp write SetWideStringProp stored False;
property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
property KeyPreview: WordBool index 205 read GetWordBoolProp write SetWordBoolProp stored False;
property PixelsPerInch: Integer index 206 read GetIntegerProp write SetIntegerProp stored False;
property PrintScale: TOleEnum index 207 read GetTOleEnumProp write SetTOleEnumProp stored False;
property Scaled: WordBool index 208 read GetWordBoolProp write SetWordBoolProp stored False;
property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
property OnKeyPress: TiwDNPrinterOnKeyPress read FOnKeyPress write FOnKeyPress;
property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
end;
// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name : TActiveFormX
// Help String : ActiveFormX Control
// Default Interface: IActiveFormX
// Def. Intf. DISP? : No
// Event Interface: IActiveFormXEvents
// TypeFlags : (34) CanCreate Control
// *********************************************************************//
TActiveFormXOnKeyPress = procedure(ASender: TObject; var Key: Smallint) of object;
TActiveFormX = class(TOleControl)
private
FOnActivate: TNotifyEvent;
FOnClick: TNotifyEvent;
FOnCreate: TNotifyEvent;
FOnDblClick: TNotifyEvent;
FOnDestroy: TNotifyEvent;
FOnDeactivate: TNotifyEvent;
FOnKeyPress: TActiveFormXOnKeyPress;
FOnPaint: TNotifyEvent;
FIntf: IActiveFormX;
function GetControlInterface: IActiveFormX;
protected
procedure CreateControl;
procedure InitControlData; override;
public
procedure AboutBox;
property ControlInterface: IActiveFormX read GetControlInterface;
property DefaultInterface: IActiveFormX read GetControlInterface;
property Visible: WordBool index 201 read GetWordBoolProp write SetWordBoolProp;
property Active: WordBool index 209 read GetWordBoolProp;
property DropTarget: WordBool index 210 read GetWordBoolProp write SetWordBoolProp;
property HelpFile: WideString index 211 read GetWideStringProp write SetWideStringProp;
property ScreenSnap: WordBool index 212 read GetWordBoolProp write SetWordBoolProp;
property SnapBuffer: Integer index 213 read GetIntegerProp write SetIntegerProp;
property DoubleBuffered: WordBool index 214 read GetWordBoolProp write SetWordBoolProp;
property AlignDisabled: WordBool index 215 read GetWordBoolProp;
property VisibleDockClientCount: Integer index 216 read GetIntegerProp;
property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp;
published
property Anchors;
property AutoScroll: WordBool index 202 read GetWordBoolProp write SetWordBoolProp stored False;
property AutoSize: WordBool index 203 read GetWordBoolProp write SetWordBoolProp stored False;
property AxBorderStyle: TOleEnum index 204 read GetTOleEnumProp write SetTOleEnumProp stored False;
property Caption: WideString index -518 read GetWideStringProp write SetWideStringProp stored False;
property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
property KeyPreview: WordBool index 205 read GetWordBoolProp write SetWordBoolProp stored False;
property PixelsPerInch: Integer index 206 read GetIntegerProp write SetIntegerProp stored False;
property PrintScale: TOleEnum index 207 read GetTOleEnumProp write SetTOleEnumProp stored False;
property Scaled: WordBool index 208 read GetWordBoolProp write SetWordBoolProp stored False;
property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
property OnKeyPress: TActiveFormXOnKeyPress read FOnKeyPress write FOnKeyPress;
property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
end;
procedure Register;
resourcestring
dtlServerPage = 'Servers';
dtlOcxPage = 'ActiveX';
implementation
uses ComObj;
procedure TiwDNPrinter.InitControlData;
const
CEventDispIDs: array [0..7] of DWORD = (
$000000C9, $000000CA, $000000CB, $000000CC, $000000CD, $000000CE,
$000000CF, $000000D0);
CTFontIDs: array [0..0] of DWORD = (
$FFFFFE00);
CControlData: TControlData2 = (
ClassID: '{0E13768E-19AD-4BD9-AB44-6B8283D9DFB6}';
EventIID: '{C2A773A6-207C-4E51-982F-0E48581DCB7B}';
EventCount: 8;
EventDispIDs: @CEventDispIDs;
LicenseKey: nil (*HR:$80040154*);
Flags: $0000001D;
Version: 401;
FontCount: 1;
FontIDs: @CTFontIDs);
begin
ControlData := @CControlData;
TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnActivate) - Cardinal(Self);
end;
procedure TiwDNPrinter.CreateControl;
procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as IiwDNPrinter;
end;
begin
if FIntf = nil then DoCreate;
end;
function TiwDNPrinter.GetControlInterface: IiwDNPrinter;
begin
CreateControl;
Result := FIntf;
end;
procedure TiwDNPrinter.AboutBox;
begin
DefaultInterface.AboutBox;
end;
procedure TActiveFormX.InitControlData;
const
CEventDispIDs: array [0..7] of DWORD = (
$000000C9, $000000CA, $000000CB, $000000CC, $000000CD, $000000CE,
$000000CF, $000000D0);
CTFontIDs: array [0..0] of DWORD = (
$FFFFFE00);
CControlData: TControlData2 = (
ClassID: '{3441B48F-9319-498A-9245-037F6300BDC7}';
EventIID: '{8DC169AA-CD58-4C03-BD99-DF5705C6BEDE}';
EventCount: 8;
EventDispIDs: @CEventDispIDs;
LicenseKey: nil (*HR:$80040154*);
Flags: $0000001D;
Version: 401;
FontCount: 1;
FontIDs: @CTFontIDs);
begin
ControlData := @CControlData;
TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnActivate) - Cardinal(Self);
end;
procedure TActiveFormX.CreateControl;
procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as IActiveFormX;
end;
begin
if FIntf = nil then DoCreate;
end;
function TActiveFormX.GetControlInterface: IActiveFormX;
begin
CreateControl;
Result := FIntf;
end;
procedure TActiveFormX.AboutBox;
begin
DefaultInterface.AboutBox;
end;
procedure Register;
begin
RegisterComponents(dtlOcxPage, [TiwDNPrinter, TActiveFormX]);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -