XClockLib_TLB.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:14k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit XClockLib_TLB;
  2. // ************************************************************************ //
  3. // WARNING                                                                    
  4. // -------                                                                    
  5. // The types declared in this file were generated from data read from a       
  6. // Type Library. If this type library is explicitly or indirectly (via        
  7. // another type library referring to this type library) re-imported, or the   
  8. // 'Refresh' command of the Type Library Editor activated while editing the   
  9. // Type Library, the contents of this file will be regenerated and all        
  10. // manual modifications will be lost.                                         
  11. // ************************************************************************ //
  12. // PASTLWTR : $Revision:   1.118  $
  13. // File generated on 4/29/2001 4:24:06 PM from Type Library described below.
  14. // ************************************************************************  //
  15. // Type Lib: C:md6code20XClockXClockLib.tlb (1)
  16. // LIBID: {5551EB31-0AC6-11D2-B9F1-004845400FAA}
  17. // LCID: 0
  18. // Helpfile: 
  19. // DepndLst: 
  20. //   (1) v2.0 stdole, (C:WINDOWSSystem32stdole2.tlb)
  21. //   (2) v4.0 StdVCL, (C:WINDOWSsystem32stdvcl40.dll)
  22. // ************************************************************************ //
  23. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
  24. {$WARN SYMBOL_PLATFORM OFF}
  25. {$WRITEABLECONST ON}
  26. interface
  27. uses ActiveX, Classes, Graphics, OleCtrls, StdVcl, Variants, Windows;
  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.   // TypeLibrary Major and minor versions
  38.   XClockLibMajorVersion = 1;
  39.   XClockLibMinorVersion = 0;
  40.   LIBID_XClockLib: TGUID = '{5551EB31-0AC6-11D2-B9F1-004845400FAA}';
  41.   IID_IXClock: TGUID = '{5551EB32-0AC6-11D2-B9F1-004845400FAA}';
  42.   DIID_IXClockEvents: TGUID = '{5551EB34-0AC6-11D2-B9F1-004845400FAA}';
  43.   CLASS_XClock: TGUID = '{5551EB36-0AC6-11D2-B9F1-004845400FAA}';
  44. // *********************************************************************//
  45. // Declaration of Enumerations defined in Type Library                    
  46. // *********************************************************************//
  47. // Constants for enum TxActiveFormBorderStyle
  48. type
  49.   TxActiveFormBorderStyle = TOleEnum;
  50. const
  51.   afbNone = $00000000;
  52.   afbSingle = $00000001;
  53.   afbSunken = $00000002;
  54.   afbRaised = $00000003;
  55. // Constants for enum TxPrintScale
  56. type
  57.   TxPrintScale = TOleEnum;
  58. const
  59.   poNone = $00000000;
  60.   poProportional = $00000001;
  61.   poPrintToFit = $00000002;
  62. // Constants for enum TxMouseButton
  63. type
  64.   TxMouseButton = TOleEnum;
  65. const
  66.   mbLeft = $00000000;
  67.   mbRight = $00000001;
  68.   mbMiddle = $00000002;
  69. // Constants for enum TxBiDiMode
  70. type
  71.   TxBiDiMode = TOleEnum;
  72. const
  73.   bdLeftToRight = $00000000;
  74.   bdRightToLeft = $00000001;
  75.   bdRightToLeftNoAlign = $00000002;
  76.   bdRightToLeftReadingOnly = $00000003;
  77. type
  78. // *********************************************************************//
  79. // Forward declaration of types defined in TypeLibrary                    
  80. // *********************************************************************//
  81.   IXClock = interface;
  82.   IXClockDisp = dispinterface;
  83.   IXClockEvents = dispinterface;
  84. // *********************************************************************//
  85. // Declaration of CoClasses defined in Type Library                       
  86. // (NOTE: Here we map each CoClass to its Default Interface)              
  87. // *********************************************************************//
  88.   XClock = IXClock;
  89. // *********************************************************************//
  90. // Interface: IXClock
  91. // Flags:     (4416) Dual OleAutomation Dispatchable
  92. // GUID:      {5551EB32-0AC6-11D2-B9F1-004845400FAA}
  93. // *********************************************************************//
  94.   IXClock = interface(IDispatch)
  95.     ['{5551EB32-0AC6-11D2-B9F1-004845400FAA}']
  96.     function  Get_Visible: WordBool; safecall;
  97.     procedure Set_Visible(Value: WordBool); safecall;
  98.     function  Get_AutoScroll: WordBool; safecall;
  99.     procedure Set_AutoScroll(Value: WordBool); safecall;
  100.     function  Get_AutoSize: WordBool; safecall;
  101.     procedure Set_AutoSize(Value: WordBool); safecall;
  102.     function  Get_AxBorderStyle: TxActiveFormBorderStyle; safecall;
  103.     procedure Set_AxBorderStyle(Value: TxActiveFormBorderStyle); safecall;
  104.     function  Get_Caption: WideString; safecall;
  105.     procedure Set_Caption(const Value: WideString); safecall;
  106.     function  Get_Color: OLE_COLOR; safecall;
  107.     procedure Set_Color(Value: OLE_COLOR); safecall;
  108.     function  Get_Font: IFontDisp; safecall;
  109.     procedure Set_Font(const Value: IFontDisp); safecall;
  110.     procedure _Set_Font(const Value: IFontDisp); safecall;
  111.     function  Get_KeyPreview: WordBool; safecall;
  112.     procedure Set_KeyPreview(Value: WordBool); safecall;
  113.     function  Get_PixelsPerInch: Integer; safecall;
  114.     procedure Set_PixelsPerInch(Value: Integer); safecall;
  115.     function  Get_PrintScale: TxPrintScale; safecall;
  116.     procedure Set_PrintScale(Value: TxPrintScale); safecall;
  117.     function  Get_Scaled: WordBool; safecall;
  118.     procedure Set_Scaled(Value: WordBool); safecall;
  119.     function  Get_Active: WordBool; safecall;
  120.     function  Get_DropTarget: WordBool; safecall;
  121.     procedure Set_DropTarget(Value: WordBool); safecall;
  122.     function  Get_HelpFile: WideString; safecall;
  123.     procedure Set_HelpFile(const Value: WideString); safecall;
  124.     function  Get_DoubleBuffered: WordBool; safecall;
  125.     procedure Set_DoubleBuffered(Value: WordBool); safecall;
  126.     function  Get_Enabled: WordBool; safecall;
  127.     procedure Set_Enabled(Value: WordBool); safecall;
  128.     function  Get_BiDiMode: TxBiDiMode; safecall;
  129.     procedure Set_BiDiMode(Value: TxBiDiMode); safecall;
  130.     function  Get_Cursor: Smallint; safecall;
  131.     procedure Set_Cursor(Value: Smallint); safecall;
  132.     property Visible: WordBool read Get_Visible write Set_Visible;
  133.     property AutoScroll: WordBool read Get_AutoScroll write Set_AutoScroll;
  134.     property AutoSize: WordBool read Get_AutoSize write Set_AutoSize;
  135.     property AxBorderStyle: TxActiveFormBorderStyle read Get_AxBorderStyle write Set_AxBorderStyle;
  136.     property Caption: WideString read Get_Caption write Set_Caption;
  137.     property Color: OLE_COLOR read Get_Color write Set_Color;
  138.     property Font: IFontDisp read Get_Font write Set_Font;
  139.     property KeyPreview: WordBool read Get_KeyPreview write Set_KeyPreview;
  140.     property PixelsPerInch: Integer read Get_PixelsPerInch write Set_PixelsPerInch;
  141.     property PrintScale: TxPrintScale read Get_PrintScale write Set_PrintScale;
  142.     property Scaled: WordBool read Get_Scaled write Set_Scaled;
  143.     property Active: WordBool read Get_Active;
  144.     property DropTarget: WordBool read Get_DropTarget write Set_DropTarget;
  145.     property HelpFile: WideString read Get_HelpFile write Set_HelpFile;
  146.     property DoubleBuffered: WordBool read Get_DoubleBuffered write Set_DoubleBuffered;
  147.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  148.     property BiDiMode: TxBiDiMode read Get_BiDiMode write Set_BiDiMode;
  149.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  150.   end;
  151. // *********************************************************************//
  152. // DispIntf:  IXClockDisp
  153. // Flags:     (4416) Dual OleAutomation Dispatchable
  154. // GUID:      {5551EB32-0AC6-11D2-B9F1-004845400FAA}
  155. // *********************************************************************//
  156.   IXClockDisp = dispinterface
  157.     ['{5551EB32-0AC6-11D2-B9F1-004845400FAA}']
  158.     property Visible: WordBool dispid 1;
  159.     property AutoScroll: WordBool dispid 2;
  160.     property AutoSize: WordBool dispid 3;
  161.     property AxBorderStyle: TxActiveFormBorderStyle dispid 4;
  162.     property Caption: WideString dispid -518;
  163.     property Color: OLE_COLOR dispid -501;
  164.     property Font: IFontDisp dispid -512;
  165.     property KeyPreview: WordBool dispid 5;
  166.     property PixelsPerInch: Integer dispid 6;
  167.     property PrintScale: TxPrintScale dispid 7;
  168.     property Scaled: WordBool dispid 8;
  169.     property Active: WordBool dispid 9;
  170.     property DropTarget: WordBool dispid 10;
  171.     property HelpFile: WideString dispid 11;
  172.     property DoubleBuffered: WordBool dispid 12;
  173.     property Enabled: WordBool dispid -514;
  174.     property BiDiMode: TxBiDiMode dispid 13;
  175.     property Cursor: Smallint dispid 14;
  176.   end;
  177. // *********************************************************************//
  178. // DispIntf:  IXClockEvents
  179. // Flags:     (4096) Dispatchable
  180. // GUID:      {5551EB34-0AC6-11D2-B9F1-004845400FAA}
  181. // *********************************************************************//
  182.   IXClockEvents = dispinterface
  183.     ['{5551EB34-0AC6-11D2-B9F1-004845400FAA}']
  184.     procedure OnActivate; dispid 1;
  185.     procedure OnClick; dispid 2;
  186.     procedure OnCreate; dispid 3;
  187.     procedure OnDblClick; dispid 4;
  188.     procedure OnDestroy; dispid 5;
  189.     procedure OnDeactivate; dispid 6;
  190.     procedure OnKeyPress(var Key: Smallint); dispid 10;
  191.     procedure OnPaint; dispid 15;
  192.   end;
  193. // *********************************************************************//
  194. // OLE Control Proxy class declaration
  195. // Control Name     : TXClock
  196. // Help String      : XClock Control
  197. // Default Interface: IXClock
  198. // Def. Intf. DISP? : No
  199. // Event   Interface: IXClockEvents
  200. // TypeFlags        : (34) CanCreate Control
  201. // *********************************************************************//
  202.   TXClockOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  203.   TXClock = class(TOleControl)
  204.   private
  205.     FOnActivate: TNotifyEvent;
  206.     FOnClick: TNotifyEvent;
  207.     FOnCreate: TNotifyEvent;
  208.     FOnDblClick: TNotifyEvent;
  209.     FOnDestroy: TNotifyEvent;
  210.     FOnDeactivate: TNotifyEvent;
  211.     FOnKeyPress: TXClockOnKeyPress;
  212.     FOnPaint: TNotifyEvent;
  213.     FIntf: IXClock;
  214.     function  GetControlInterface: IXClock;
  215.   protected
  216.     procedure CreateControl;
  217.     procedure InitControlData; override;
  218.   public
  219.     property  ControlInterface: IXClock read GetControlInterface;
  220.     property  DefaultInterface: IXClock read GetControlInterface;
  221.     property Visible: WordBool index 1 read GetWordBoolProp write SetWordBoolProp;
  222.     property Active: WordBool index 9 read GetWordBoolProp;
  223.     property DropTarget: WordBool index 10 read GetWordBoolProp write SetWordBoolProp;
  224.     property HelpFile: WideString index 11 read GetWideStringProp write SetWideStringProp;
  225.     property DoubleBuffered: WordBool index 12 read GetWordBoolProp write SetWordBoolProp;
  226.     property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp;
  227.     property BiDiMode: TOleEnum index 13 read GetTOleEnumProp write SetTOleEnumProp;
  228.   published
  229.     property  ParentColor;
  230.     property  ParentFont;
  231.     property  Align;
  232.     property  DragCursor;
  233.     property  DragMode;
  234.     property  ParentShowHint;
  235.     property  PopupMenu;
  236.     property  ShowHint;
  237.     property  TabOrder;
  238.     property  OnDragDrop;
  239.     property  OnDragOver;
  240.     property  OnEndDrag;
  241.     property  OnEnter;
  242.     property  OnExit;
  243.     property  OnStartDrag;
  244.     property AutoScroll: WordBool index 2 read GetWordBoolProp write SetWordBoolProp stored False;
  245.     property AutoSize: WordBool index 3 read GetWordBoolProp write SetWordBoolProp stored False;
  246.     property AxBorderStyle: TOleEnum index 4 read GetTOleEnumProp write SetTOleEnumProp stored False;
  247.     property Caption: WideString index -518 read GetWideStringProp write SetWideStringProp stored False;
  248.     property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
  249.     property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
  250.     property KeyPreview: WordBool index 5 read GetWordBoolProp write SetWordBoolProp stored False;
  251.     property PixelsPerInch: Integer index 6 read GetIntegerProp write SetIntegerProp stored False;
  252.     property PrintScale: TOleEnum index 7 read GetTOleEnumProp write SetTOleEnumProp stored False;
  253.     property Scaled: WordBool index 8 read GetWordBoolProp write SetWordBoolProp stored False;
  254.     property Cursor: Smallint index 14 read GetSmallintProp write SetSmallintProp stored False;
  255.     property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
  256.     property OnClick: TNotifyEvent read FOnClick write FOnClick;
  257.     property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
  258.     property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
  259.     property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
  260.     property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
  261.     property OnKeyPress: TXClockOnKeyPress read FOnKeyPress write FOnKeyPress;
  262.     property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
  263.   end;
  264. procedure Register;
  265. resourcestring
  266.   dtlServerPage = 'Servers';
  267. implementation
  268. uses ComObj;
  269. procedure TXClock.InitControlData;
  270. const
  271.   CEventDispIDs: array [0..7] of DWORD = (
  272.     $00000001, $00000002, $00000003, $00000004, $00000005, $00000006,
  273.     $0000000A, $0000000F);
  274.   CTFontIDs: array [0..0] of DWORD = (
  275.     $FFFFFE00);
  276.   CControlData: TControlData2 = (
  277.     ClassID: '{5551EB36-0AC6-11D2-B9F1-004845400FAA}';
  278.     EventIID: '{5551EB34-0AC6-11D2-B9F1-004845400FAA}';
  279.     EventCount: 8;
  280.     EventDispIDs: @CEventDispIDs;
  281.     LicenseKey: nil (*HR:$00000000*);
  282.     Flags: $0000001D;
  283.     Version: 401;
  284.     FontCount: 1;
  285.     FontIDs: @CTFontIDs);
  286. begin
  287.   ControlData := @CControlData;
  288.   TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnActivate) - Cardinal(Self);
  289. end;
  290. procedure TXClock.CreateControl;
  291.   procedure DoCreate;
  292.   begin
  293.     FIntf := IUnknown(OleObject) as IXClock;
  294.   end;
  295. begin
  296.   if FIntf = nil then DoCreate;
  297. end;
  298. function TXClock.GetControlInterface: IXClock;
  299. begin
  300.   CreateControl;
  301.   Result := FIntf;
  302. end;
  303. procedure Register;
  304. begin
  305.   RegisterComponents('ActiveX',[TXClock]);
  306. end;
  307. end.