home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / DingX / DingButtonXControl_TLB.pas < prev    next >
Pascal/Delphi Source File  |  1998-05-14  |  9KB  |  223 lines

  1. unit DingButtonXControl_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.23  $
  15. // File generated on 5/15/98 1:55:11 AM from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: E:\source\DingX\DingButtonXControl.tlb
  19. // IID\LCID: {199D9A87-CC89-11D1-AC07-C54ACBC13325}\0
  20. // Helpfile: 
  21. // HelpString: DingButtonXControl 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_DingButtonXControl: TGUID = '{199D9A87-CC89-11D1-AC07-C54ACBC13325}';
  38.   IID_IDingButtonX: TGUID = '{199D9A88-CC89-11D1-AC07-C54ACBC13325}';
  39.   DIID_IDingButtonXEvents: TGUID = '{199D9A89-CC89-11D1-AC07-C54ACBC13325}';
  40.   CLASS_DingButtonX: TGUID = '{199D9A8A-CC89-11D1-AC07-C54ACBC13325}';
  41.  
  42. // *********************************************************************//
  43. // Declaration of Enumerations defined in Type Library                  //
  44. // *********************************************************************//
  45. // TxDragMode constants
  46. type
  47.   TxDragMode = TOleEnum;
  48. const
  49.   dmManual = $00000000;
  50.   dmAutomatic = $00000001;
  51.  
  52. // TxMouseButton constants
  53. type
  54.   TxMouseButton = TOleEnum;
  55. const
  56.   mbLeft = $00000000;
  57.   mbRight = $00000001;
  58.   mbMiddle = $00000002;
  59.  
  60.  
  61. // *********************************************************************//
  62. // Forward declaration of interfaces defined in Type Library            //
  63. // *********************************************************************//
  64. type
  65.   IDingButtonX = interface;
  66.   IDingButtonXDisp = dispinterface;
  67.   IDingButtonXEvents = dispinterface;
  68.  
  69. // *********************************************************************//
  70. // Declaration of CoClasses defined in Type Library                     //
  71. // (NOTE: Here we map each CoClass to its Default Interface             //
  72. // *********************************************************************//
  73.   DingButtonX = IDingButtonX;
  74.  
  75.   IDingButtonX = interface(IDispatch)
  76.     ['{199D9A88-CC89-11D1-AC07-C54ACBC13325}']
  77.     procedure Click; safecall;
  78.     function Get_Cancel: WordBool; safecall;
  79.     procedure Set_Cancel(Value: WordBool); safecall;
  80.     function Get_Caption: WideString; safecall;
  81.     procedure Set_Caption(const Value: WideString); safecall;
  82.     function Get_Default: WordBool; safecall;
  83.     procedure Set_Default(Value: WordBool); safecall;
  84.     function Get_DragCursor: Smallint; safecall;
  85.     procedure Set_DragCursor(Value: Smallint); safecall;
  86.     function Get_DragMode: TxDragMode; safecall;
  87.     procedure Set_DragMode(Value: TxDragMode); safecall;
  88.     function Get_Enabled: WordBool; safecall;
  89.     procedure Set_Enabled(Value: WordBool); safecall;
  90.     function Get_Font: IFontDisp; safecall;
  91.     procedure Set_Font(const Value: IFontDisp); safecall;
  92.     function Get_Visible: WordBool; safecall;
  93.     procedure Set_Visible(Value: WordBool); safecall;
  94.     function Get_Cursor: Smallint; safecall;
  95.     procedure Set_Cursor(Value: Smallint); safecall;
  96.     procedure AboutBox; safecall;
  97.     property Cancel: WordBool read Get_Cancel write Set_Cancel;
  98.     property Caption: WideString read Get_Caption write Set_Caption;
  99.     property Default: WordBool read Get_Default write Set_Default;
  100.     property DragCursor: Smallint read Get_DragCursor write Set_DragCursor;
  101.     property DragMode: TxDragMode read Get_DragMode write Set_DragMode;
  102.     property Enabled: WordBool read Get_Enabled write Set_Enabled;
  103.     property Font: IFontDisp read Get_Font write Set_Font;
  104.     property Visible: WordBool read Get_Visible write Set_Visible;
  105.     property Cursor: Smallint read Get_Cursor write Set_Cursor;
  106.   end;
  107.  
  108. // Dispinterface declaration for dual interface IDingButtonX
  109.  
  110.   IDingButtonXDisp = dispinterface
  111.     ['{199D9A88-CC89-11D1-AC07-C54ACBC13325}']
  112.     procedure Click; dispid 1;
  113.     property Cancel: WordBool dispid 2;
  114.     property Caption: WideString dispid 3;
  115.     property Default: WordBool dispid 4;
  116.     property DragCursor: Smallint dispid 5;
  117.     property DragMode: TxDragMode dispid 6;
  118.     property Enabled: WordBool dispid 7;
  119.     property Font: IFontDisp dispid 8;
  120.     property Visible: WordBool dispid 9;
  121.     property Cursor: Smallint dispid 10;
  122.     procedure AboutBox; dispid -552;
  123.   end;
  124.  
  125.   IDingButtonXEvents = dispinterface
  126.     ['{199D9A89-CC89-11D1-AC07-C54ACBC13325}']
  127.     procedure OnClick; dispid 1;
  128.     procedure OnKeyPress(var Key: Smallint); dispid 2;
  129.   end;
  130.  
  131. //  DingButtonX control 
  132.  
  133.   TDingButtonXOnKeyPress = procedure(Sender: TObject; var Key: Smallint) of object;
  134.  
  135.   TDingButtonX = class(TOleControl)
  136.   private
  137.   // Instance of Closures to expose OCX Events as VCL ones
  138.   //
  139.     FOnClick: TNotifyEvent;
  140.     FOnKeyPress: TDingButtonXOnKeyPress;
  141.     FIntf: IDingButtonX;
  142.     function  GetControlInterface: IDingButtonX;
  143.   protected
  144.     procedure CreateControl;
  145.     procedure InitControlData; override;
  146.   public
  147.     procedure Click;
  148.     procedure AboutBox;
  149.     property  ControlInterface: IDingButtonX read GetControlInterface;
  150.   published
  151.     property Cancel: WordBool index 2 read GetWordBoolProp write SetWordBoolProp stored False;
  152.     property Caption: WideString index 3 read GetWideStringProp write SetWideStringProp stored False;
  153.     property Default: WordBool index 4 read GetWordBoolProp write SetWordBoolProp stored False;
  154.     property DragCursor: Smallint index 5 read GetSmallintProp write SetSmallintProp stored False;
  155.     property DragMode: TOleEnum index 6 read GetTOleEnumProp write SetTOleEnumProp stored False;
  156.     property Enabled: WordBool index 7 read GetWordBoolProp write SetWordBoolProp stored False;
  157.     property Font: TFont index 8 read GetTFontProp write SetTFontProp stored False;
  158.     property Visible: WordBool index 9 read GetWordBoolProp write SetWordBoolProp stored False;
  159.     property Cursor: Smallint index 10 read GetSmallintProp write SetSmallintProp stored False;
  160.     property OnClick: TNotifyEvent read FOnClick write FOnClick;
  161.     property OnKeyPress: TDingButtonXOnKeyPress read FOnKeyPress write FOnKeyPress;
  162.   end;
  163.  
  164. procedure Register;
  165.  
  166. implementation
  167.  
  168. uses ComObj;
  169.  
  170. procedure TDingButtonX.InitControlData;
  171. const
  172.   CEventDispIDs: array [0..1] of Integer = (
  173.     $00000001, $00000002);
  174.   CTFontIDs: array [0..0] of Integer = (
  175.     $00000008);
  176.   CControlData: TControlData = (
  177.     ClassID: '{199D9A8A-CC89-11D1-AC07-C54ACBC13325}';
  178.     EventIID: '{199D9A89-CC89-11D1-AC07-C54ACBC13325}';
  179.     EventCount: 2;
  180.     EventDispIDs: @CEventDispIDs;
  181.     LicenseKey: nil;
  182.     Flags: $00000000;
  183.     Version: 300;
  184.     FontCount: 1;
  185.     FontIDs: @CTFontIDs);
  186. begin
  187.   ControlData := @CControlData;
  188. end;
  189.  
  190. procedure TDingButtonX.CreateControl;
  191.  
  192.   procedure DoCre