home *** CD-ROM | disk | FTP | other *** search
- unit HKeyImpl;
-
- interface
-
- uses
- Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
- ComServ, StdVCL, AXCtrls, DelC_TLB, ComCtrls;
-
- type
- THotKeyX = class(TActiveXControl, IHotKeyX)
- private
- { Private declarations }
- FDelphiControl: THotKey;
- FEvents: IHotKeyXEvents;
- protected
- { Protected declarations }
- procedure InitializeControl; override;
- procedure EventSinkChanged(const EventSink: IUnknown); override;
- procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
- function Get_AutoSize: WordBool; safecall;
- function Get_Cursor: Smallint; safecall;
- function Get_Enabled: WordBool; safecall;
- function Get_HotKey: Smallint; safecall;
- function Get_Visible: WordBool; safecall;
- procedure AboutBox; safecall;
- procedure Set_AutoSize(Value: WordBool); safecall;
- procedure Set_Cursor(Value: Smallint); safecall;
- procedure Set_Enabled(Value: WordBool); safecall;
- procedure Set_HotKey(Value: Smallint); safecall;
- procedure Set_Visible(Value: WordBool); safecall;
- end;
-
- implementation
-
- uses About12;
-
- { THotKeyX }
-
- procedure THotKeyX.InitializeControl;
- begin
- FDelphiControl := Control as THotKey;
- end;
-
- procedure THotKeyX.EventSinkChanged(const EventSink: IUnknown);
- begin
- FEvents := EventSink as IHotKeyXEvents;
- end;
-
- procedure THotKeyX.DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage);
- begin
- { Define property pages here. Property pages are defined by calling
- DefinePropertyPage with the class id of the page. For example,
- DefinePropertyPage(Class_HotKeyXPage); }
- end;
-
- function THotKeyX.Get_AutoSize: WordBool;
- begin
- Result := FDelphiControl.AutoSize;
- end;
-
- function THotKeyX.Get_Cursor: Smallint;
- begin
- Result := Smallint(FDelphiControl.Cursor);
- end;
-
- function THotKeyX.Get_Enabled: WordBool;
- begin
- Result := FDelphiControl.Enabled;
- end;
-
- function THotKeyX.Get_HotKey: Smallint;
- begin
- Result := Smallint(FDelphiControl.HotKey);
- end;
-
- function THotKeyX.Get_Visible: WordBool;
- begin
- Result := FDelphiControl.Visible;
- end;
-
- procedure THotKeyX.AboutBox;
- begin
- ShowHotKeyXAbout;
- end;
-
- procedure THotKeyX.Set_AutoSize(Value: WordBool);
- begin
- FDelphiControl.AutoSize := Value;
- end;
-
- procedure THotKeyX.Set_Cursor(Value: Smallint);
- begin
- FDelphiControl.Cursor := TCursor(Value);
- end;
-
- procedure THotKeyX.Set_Enabled(Value: WordBool);
- begin
- FDelphiControl.Enabled := Value;
- end;
-
- procedure THotKeyX.Set_HotKey(Value: Smallint);
- begin
- FDelphiControl.HotKey := TShortCut(Value);
- end;
-
- procedure THotKeyX.Set_Visible(Value: WordBool);
- begin
- FDelphiControl.Visible := Value;
- end;
-
- initialization
- TActiveXControlFactory.Create(
- ComServer,
- THotKeyX,
- THotKey,
- Class_HotKeyX,
- 12,
- '{FA7B83A8-9ED7-11D0-AA40-444553540000}',
- 0);
- end.
-