home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / Runimage / Delphi50 / Demos / Midas / Activefm / empe_tlb.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  12.8 KB  |  298 lines

  1. unit EmpE_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                  //
  5. // -------                                                                  //
  6. // The types declared in this file were generated from data read from a     //
  7. // Type Library. If this type library is explicitly or indirectly (via      //
  8. // another type library referring to this type library) re-imported, or the //
  9. // 'Refresh' command of the Type Library Editor activated while editing the //
  10. // Type Library, the contents of this file will be regenerated and all      //
  11. // manual modifications will be lost.                                       //
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.11.1.62  $
  15. // File generated on 6/12/98 8:31:55 AM from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: G:\DEMOS\MIDAS\ACTIVEFM\Empeditx.tlb
  19. // IID\LCID: {21F7A315-FDF0-11D0-9FFC-00A0248E4B9A}\0
  20. // Helpfile: 
  21. // HelpString: EmpE Library
  22. // Version:    1.0
  23. // ************************************************************************ //
  24.  
  25. interface
  26.  
  27. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  28.  
  29. // *********************************************************************//
  30. // GUIDS declared in the TypeLibrary. Following prefixes are used:      //
  31. //   Type Libraries     : LIBID_xxxx                                    //
  32. //   CoClasses          : CLASS_xxxx                                    //
  33. //   DISPInterfaces     : DIID_xxxx                                     //
  34. //   Non-DISP interfaces: IID_xxxx                                      //
  35. // *********************************************************************//
  36. const
  37.   LIBID_EmpE: TGUID = '{21F7A315-FDF0-11D0-9FFC-00A0248E4B9A}';
  38.   IID_IEmpEditForm: TGUID = '{21F7A316-FDF0-11D0-9FFC-00A0248E4B9A}';
  39.   DIID_IEmpEditFormEvents: TGUID = '{21F7A317-FDF0-11D0-9FFC-00A0248E4B9A}';
  40.   CLASS_EmpEditForm: TGUID = '{21F7A318-FDF0-11D0-9FFC-00A0248E4B9A}';
  41.  
  42. // *********************************************************************//
  43. // Declaration of Enumerations defined in Type Library                  //
  44. // *********************************************************************//
  45. // TxActiveFormBorderStyle constants
  46. type
  47.   TxActiveFormBorderStyle = TOleEnum;
  48. const
  49.   afbNone = $00000000;
  50.   afbSingle = $00000001;
  51.   afbSunken = $00000002;
  52.   afbRaised = $00000003;
  53.  
  54. // TxPrintScale constants
  55. type
  56.   TxPrintScale = TOleEnum;
  57. const
  58.   poNone = $00000000;
  59.   poProportional = $00000001;
  60.   poPrintToFit = $00000002;
  61.  
  62. // TxMouseButton constants
  63. type
  64.   TxMouseButton = TOleEnum;
  65. const
  66.   mbLeft = $00000000;
  67.   mbRight = $00000001;
  68.   mbMiddle = $00000002;
  69.  
  70. // TxWindowState constants
  71. type
  72.   TxWindowState = TOleEnum;
  73. const
  74.   wsNormal = $00000000;
  75.   wsMinimized = $00000001;
  76.   wsMaximized = $00000002;
  77.  
  78. type
  79.  
  80. // *********************************************************************//
  81. // Forward declaration of interfaces defined in Type Library            //
  82. // *********************************************************************//
  83.   IEmpEditForm = interface;
  84.   IEmpEditFormDisp = dispinterface;
  85.   IEmpEditFormEvents = dispinterface;
  86.  
  87. // *********************************************************************//
  88. // Declaration of CoClasses defined in Type Library                     //
  89. // (NOTE: Here we map each CoClass to its Default Interface)            //
  90. // *********************************************************************//
  91.   EmpEditForm = IEmpEditForm;
  92.  
  93.  
  94. // *********************************************************************//
  95. // Interface: IEmpEditForm
  96. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  97. // GUID:      {21F7A316-FDF0-11D0-9FFC-00A0248E4B9A}
  98. // *********************************************************************//
  99.   IEmpEditForm = interface(IDispatch)
  100.     ['{21F7A316-FDF0-11D0-9FFC-00A0248E4B9A}']
  101.     function Get_AutoScroll: WordBool; safecall;
  102.     procedure Set_AutoScroll(AutoScroll: WordBool); safecall;
  103.     function Get_AxBorderStyle: TxActiveFormBorderStyle; safecall;
  104.     procedure Set_AxBorderStyle(AxBorderStyle: TxActiveFormBorderStyle); safecall;
  105.     function Get_Caption: WideString; safecall;
  106.     procedure Set_Caption(const Caption: WideString); safecall;
  107.     function Get_Color: OLE_COLOR; safecall;
  108.     procedure Set_Color(Color: OLE_COLOR); safecall;
  109.     function Get_Font: IFontDisp; safecall;
  110.     procedure Set_Font(const Font: IFontDisp); safecall;
  111.     function Get_KeyPreview: WordBool; safecall;
  112.     procedure Set_KeyPreview(KeyPreview: WordBool); safecall;
  113.     function Get_PixelsPerInch: Integer; safecall;
  114.     procedure Set_PixelsPerInch(PixelsPerInch: Integer); safecall;
  115.     function Get_PrintScale: TxPrintScale; safecall;
  116.     procedure Set_PrintScale(PrintScale: TxPrintScale); safecall;
  117.     function Get_Scaled: WordBool; safecall;
  118.     procedure Set_Scaled(Scaled: WordBool); safecall;
  119.     function Get_Active: WordBool; safecall;
  120.     function Get_DropTarget: WordBool; safecall;
  121.     procedure Set_DropTarget(DropTarget: WordBool); safecall;
  122.     function Get_HelpFile: WideString; safecall;
  123.     procedure Set_HelpFile(const HelpFile: WideString); safecall;
  124.     function Get_WindowState: TxWindowState; safecall;
  125.     procedure Set_WindowState(WindowState: TxWindowState); safecall;
  126.     function Get_Visible: WordBool; safecall;
  127.     procedure Set_Visible(Visible: WordBool); safecall;
  128.     function Get_Enabled: WordBool; safecall;
  129.     procedure Set_Enabled(Enabled: WordBool); safecall;
  130.     function Get_Cursor: Smallint; safecall;
  131.     procedure Set_Cursor(Cursor: Smallint); safecall;
  132.     property AutoScroll: WordBool read Get_AutoScroll write Set_AutoScroll;
  133.     property AxBorderStyle: TxActiveFormBorderStyle read Get_AxBorderStyle write Set_AxBorderStyle;
  134.     property Caption: WideString read Get_Caption write Set_Caption;
  135.     property Color: OLE_COLOR read Get_Color write Set_Color;
  136.     property Font: IFontDisp read Get_Font write Set_Font;
  137.     property KeyPreview: WordBool read Get_KeyPreview write Set_KeyPreview;
  138.     property PixelsPerInch: Integer read Get_PixelsPerInch write Set_PixelsPerInch;
  139.     property PrintScale: TxPrintScale read Get_PrintScale write Set_PrintScale;
  140.     property Scaled: WordBool read Get_Scaled write Set_Scaled;
  141.     property Active: WordBool read Get_Active;
  142.     property DropTarget: WordBool read Get_DropTarget write Set_DropTarget;
  143.     property HelpFile: WideString read Get_HelpFile write Set_HelpFile;
  144.     property WindowState: TxWindowState read Get_WindowState write Set_WindowState;
  145.     property Visible: WordBool read Get_Visible write Set_Visible;
  146.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  147.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  148.   end;
  149.  
  150. // *********************************************************************//
  151. // DispIntf:  IEmpEditFormDisp
  152. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  153. // GUID:      {21F7A316-FDF0-11D0-9FFC-00A0248E4B9A}
  154. // *********************************************************************//
  155.   IEmpEditFormDisp = dispinterface
  156.     ['{21F7A316-FDF0-11D0-9FFC-00A0248E4B9A}']
  157.     property AutoScroll: WordBool dispid 1;
  158.     property AxBorderStyle: TxActiveFormBorderStyle dispid 2;
  159.     property Caption: WideString dispid 3;
  160.     property Color: OLE_COLOR dispid 4;
  161.     property Font: IFontDisp dispid 5;
  162.     property KeyPreview: WordBool dispid 6;
  163.     property PixelsPerInch: Integer dispid 7;
  164.     property PrintScale: TxPrintScale dispid 8;
  165.     property Scaled: WordBool dispid 9;
  166.     property Active: WordBool readonly dispid 10;
  167.     property DropTarget: WordBool dispid 11;
  168.     property HelpFile: WideString dispid 12;
  169.     property WindowState: TxWindowState dispid 13;
  170.     property Visible: WordBool dispid 14;
  171.     property Enabled: WordBool dispid 15;
  172.     property Cursor: Smallint dispid 16;
  173.   end;
  174.  
  175. // *********************************************************************//
  176. // DispIntf:  IEmpEditFormEvents
  177. // Flags:     (4096) Dispatchable
  178. // GUID:      {21F7A317-FDF0-11D0-9FFC-00A0248E4B9A}
  179. // *********************************************************************//
  180.   IEmpEditFormEvents = dispinterface
  181.     ['{21F7A317-FDF0-11D0-9FFC-00A0248E4B9A}']
  182.     procedure OnActivate; dispid 1;
  183.     procedure OnClick; dispid 2;
  184.     procedure OnCreate; dispid 3;
  185.     procedure OnDblClick; dispid 4;
  186.     procedure OnDestroy; dispid 5;
  187.     procedure OnDeactivate; dispid 6;
  188.     procedure OnKeyPress(var Key: Smallint); dispid 7;
  189.     procedure OnPaint; dispid 8;
  190.   end;
  191.  
  192.  
  193. // *********************************************************************//
  194. // OLE Control Proxy class declaration
  195. // Control Name     : TEmpEditForm
  196. // Help String      : EmpEditFormControl
  197. // Default Interface: IEmpEditForm
  198. // Def. Intf. DISP? : No
  199. // Event   Interface: IEmpEditFormEvents
  200. // TypeFlags        : (34) CanCreate Control
  201. // *********************************************************************//
  202.   TEmpEditFormOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  203.  
  204.   TEmpEditForm = class(TOleControl)
  205.   private
  206.     FOnActivate: TNotifyEvent;
  207.     FOnClick: TNotifyEvent;
  208.     FOnCreate: TNotifyEvent;
  209.     FOnDblClick: TNotifyEvent;
  210.     FOnDestroy: TNotifyEvent;
  211.     FOnDeactivate: TNotifyEvent;
  212.     FOnKeyPress: TEmpEditFormOnKeyPress;
  213.     FOnPaint: TNotifyEvent;
  214.     FIntf: IEmpEditForm;
  215.     function  GetControlInterface: IEmpEditForm;
  216.   protected
  217.     procedure CreateControl;
  218.     procedure InitControlData; override;
  219.   public
  220.     property  ControlInterface: IEmpEditForm read GetControlInterface;
  221.     property Active: WordBool index 10 read GetWordBoolProp;
  222.   published
  223.     property AutoScroll: WordBool index 1 read GetWordBoolProp write SetWordBoolProp stored False;
  224.     property AxBorderStyle: TOleEnum index 2 read GetTOleEnumProp write SetTOleEnumProp stored False;
  225.     property Caption: WideString index 3 read GetWideStringProp write SetWideStringProp stored False;
  226.     property Color: TColor index 4 read GetTColorProp write SetTColorProp stored False;
  227.     property Font: TFont index 5 read GetTFontProp write SetTFontProp stored False;
  228.     property KeyPreview: WordBool index 6 read GetWordBoolProp write SetWordBoolProp stored False;
  229.     property PixelsPerInch: Integer index 7 read GetIntegerProp write SetIntegerProp stored False;
  230.     property PrintScale: TOleEnum index 8 read GetTOleEnumProp write SetTOleEnumProp stored False;
  231.     property Scaled: WordBool index 9 read GetWordBoolProp write SetWordBoolProp stored False;
  232.     property DropTarget: WordBool index 11 read GetWordBoolProp write SetWordBoolProp stored False;
  233.     property HelpFile: WideString index 12 read GetWideStringProp write SetWideStringProp stored False;
  234.     property WindowState: TOleEnum index 13 read GetTOleEnumProp write SetTOleEnumProp stored False;
  235.     property Visible: WordBool index 14 read GetWordBoolProp write SetWordBoolProp stored False;
  236.     property Enabled: WordBool index 15 read GetWordBoolProp write SetWordBoolProp stored False;
  237.     property Cursor: Smallint index 16 read GetSmallintProp write SetSmallintProp stored False;
  238.     property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
  239.     property OnClick: TNotifyEvent read FOnClick write FOnClick;
  240.     property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
  241.     property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
  242.     property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
  243.     property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
  244.     property OnKeyPress: TEmpEditFormOnKeyPress read FOnKeyPress write FOnKeyPress;
  245.     property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
  246.   end;
  247.  
  248. procedure Register;
  249.  
  250. implementation
  251.  
  252. uses ComObj;
  253.  
  254. procedure TEmpEditForm.InitControlData;
  255. const
  256.   CEventDispIDs: array [0..7] of DWORD = (
  257.     $00000001, $00000002, $00000003, $00000004, $00000005, $00000006,
  258.     $00000007, $00000008);
  259.   CTFontIDs: array [0..0] of DWORD = (
  260.     $00000005);
  261.   CControlData: TControlData = (
  262.     ClassID: '{21F7A318-FDF0-11D0-9FFC-00A0248E4B9A}';
  263.     EventIID: '{21F7A317-FDF0-11D0-9FFC-00A0248E4B9A}';
  264.     EventCount: 8;
  265.     EventDispIDs: @CEventDispIDs;
  266.     LicenseKey: nil;
  267.     Flags: $00000000;
  268.     Version: 300;
  269.     FontCount: 1;
  270.     FontIDs: @CTFontIDs);
  271. begin
  272.   ControlData := @CControlData;
  273. end;
  274.  
  275. procedure TEmpEditForm.CreateControl;
  276.  
  277.   procedure DoCreate;
  278.   begin
  279.     FIntf := IUnknown(OleObject) as IEmpEditForm;
  280.   end;
  281.  
  282. begin
  283.   if FIntf = nil then DoCreate;
  284. end;
  285.  
  286. function TEmpEditForm.GetControlInterface: IEmpEditForm;
  287. begin
  288.   CreateControl;
  289.   Result := FIntf;
  290. end;
  291.  
  292. procedure Register;
  293. begin
  294.   RegisterComponents('ActiveX',[TEmpEditForm]);
  295. end;
  296.  
  297. end.
  298.