unit PanelXControl1_TLB;

// ************************************************************************ //
// WARNING                                                                    
// -------                                                                    
// The types declared in this file were generated from data read from a       
// Type Library. If this type library is explicitly or indirectly (via        
// another type library referring to this type library) re-imported, or the   
// 'Refresh' command of the Type Library Editor activated while editing the   
// Type Library, the contents of this file will be regenerated and all        
// manual modifications will be lost.                                         
// ************************************************************************ //

// PASTLWTR : $Revision:   1.88  $
// File generated on 14.03.2001 15:33:35 from Type Library described below.

// *************************************************************************//
// NOTE:                                                                      
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties  
// which return objects that may need to be explicitly created via a function 
// call prior to any access via the property. These items have been disabled  
// in order to prevent accidental use from within the object inspector. You   
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively   
// removing them from the $IFDEF blocks. However, such items must still be    
// programmatically created via a method of the appropriate CoClass before    
// they can be used.                                                          
// ************************************************************************ //
// Type Lib: F:\Projects\Temp\VR\PanelXControl1.tlb (1)
// IID\LCID: {1474B3E2-D13D-48CC-8BA0-8C47FAE16342}\0
// Helpfile: 
// DepndLst: 
//   (1) v2.0 stdole, (D:\WINNT\System32\stdole2.tlb)
//   (2) v4.0 StdVCL, (D:\WINNT\System32\STDVCL40.DLL)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
interface

uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:        
//   Type Libraries     : LIBID_xxxx                                      
//   CoClasses          : CLASS_xxxx                                      
//   DISPInterfaces     : DIID_xxxx                                       
//   Non-DISP interfaces: IID_xxxx                                        
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  PanelXControl1MajorVersion = 1;
  PanelXControl1MinorVersion = 0;

  LIBID_PanelXControl1: TGUID = '{1474B3E2-D13D-48CC-8BA0-8C47FAE16342}';

  IID_IPanelX: TGUID = '{0F3F0491-EE7D-4B5C-9F1C-57A4941C81BA}';
  DIID_IPanelXEvents: TGUID = '{8CFD05E7-3210-4580-96F2-4A2DCD36C39B}';
  CLASS_PanelX: TGUID = '{6723410F-B4A4-4E83-B0A6-98543AA08D9E}';

// *********************************************************************//
// Declaration of Enumerations defined in Type Library                    
// *********************************************************************//
// Constants for enum TxAlignment
type
  TxAlignment = TOleEnum;
const
  taLeftJustify = $00000000;
  taRightJustify = $00000001;
  taCenter = $00000002;

// Constants for enum TxBevelCut
type
  TxBevelCut = TOleEnum;
const
  bvNone = $00000000;
  bvLowered = $00000001;
  bvRaised = $00000002;
  bvSpace = $00000003;

// Constants for enum TxBorderStyle
type
  TxBorderStyle = TOleEnum;
const
  bsNone = $00000000;
  bsSingle = $00000001;

// Constants for enum TxDragMode
type
  TxDragMode = TOleEnum;
const
  dmManual = $00000000;
  dmAutomatic = $00000001;

// Constants for enum TxMouseButton
type
  TxMouseButton = TOleEnum;
const
  mbLeft = $00000000;
  mbRight = $00000001;
  mbMiddle = $00000002;

type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                    
// *********************************************************************//
  IPanelX = interface;
  IPanelXDisp = dispinterface;
  IPanelXEvents = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library                       
// (NOTE: Here we map each CoClass to its Default Interface)              
// *********************************************************************//
  PanelX = IPanelX;


// *********************************************************************//
// Declaration of structures, unions and aliases.                         
// *********************************************************************//
  PPUserType1 = ^IFontDisp; {*}


// *********************************************************************//
// Interface: IPanelX
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {0F3F0491-EE7D-4B5C-9F1C-57A4941C81BA}
// *********************************************************************//
  IPanelX = interface(IDispatch)
    ['{0F3F0491-EE7D-4B5C-9F1C-57A4941C81BA}']
    function  Get_Alignment: TxAlignment; safecall;
    procedure Set_Alignment(Value: TxAlignment); safecall;
    function  Get_AutoSize: WordBool; safecall;
    procedure Set_AutoSize(Value: WordBool); safecall;
    function  Get_BevelInner: TxBevelCut; safecall;
    procedure Set_BevelInner(Value: TxBevelCut); safecall;
    function  Get_BevelOuter: TxBevelCut; safecall;
    procedure Set_BevelOuter(Value: TxBevelCut); safecall;
    function  Get_BorderStyle: TxBorderStyle; safecall;
    procedure Set_BorderStyle(Value: TxBorderStyle); safecall;
    function  Get_Caption: WideString; safecall;
    procedure Set_Caption(const Value: WideString); safecall;
    function  Get_Color: OLE_COLOR; safecall;
    procedure Set_Color(Value: OLE_COLOR); safecall;
    function  Get_Ctl3D: WordBool; safecall;
    procedure Set_Ctl3D(Value: WordBool); safecall;
    function  Get_UseDockManager: WordBool; safecall;
    procedure Set_UseDockManager(Value: WordBool); safecall;
    function  Get_DockSite: WordBool; safecall;
    procedure Set_DockSite(Value: WordBool); safecall;
    function  Get_DragCursor: Smallint; safecall;
    procedure Set_DragCursor(Value: Smallint); safecall;
    function  Get_DragMode: TxDragMode; safecall;
    procedure Set_DragMode(Value: TxDragMode); safecall;
    function  Get_Enabled: WordBool; safecall;
    procedure Set_Enabled(Value: WordBool); safecall;
    function  Get_FullRepaint: WordBool; safecall;
    procedure Set_FullRepaint(Value: WordBool); safecall;
    function  Get_Font: IFontDisp; safecall;
    procedure _Set_Font(const Value: IFontDisp); safecall;
    procedure Set_Font(var Value: IFontDisp); safecall;
    function  Get_Locked: WordBool; safecall;
    procedure Set_Locked(Value: WordBool); safecall;
    function  Get_ParentColor: WordBool; safecall;
    procedure Set_ParentColor(Value: WordBool); safecall;
    function  Get_ParentCtl3D: WordBool; safecall;
    procedure Set_ParentCtl3D(Value: WordBool); safecall;
    function  Get_Visible: WordBool; safecall;
    procedure Set_Visible(Value: WordBool); safecall;
    function  Get_DoubleBuffered: WordBool; safecall;
    procedure Set_DoubleBuffered(Value: WordBool); safecall;
    function  Get_VisibleDockClientCount: Integer; safecall;
    function  Get_Cursor: Smallint; safecall;
    procedure Set_Cursor(Value: Smallint); safecall;
    procedure SetCap(Caption: PChar); safecall;
    function  Get_MyProp: Integer; safecall;
    procedure Set_MyProp(Value: Integer); safecall;
    property Alignment: TxAlignment read Get_Alignment write Set_Alignment;
    property AutoSize: WordBool read Get_AutoSize write Set_AutoSize;
    property BevelInner: TxBevelCut read Get_BevelInner write Set_BevelInner;
    property BevelOuter: TxBevelCut read Get_BevelOuter write Set_BevelOuter;
    property BorderStyle: TxBorderStyle read Get_BorderStyle write Set_BorderStyle;
    property Caption: WideString read Get_Caption write Set_Caption;
    property Color: OLE_COLOR read Get_Color write Set_Color;
    property Ctl3D: WordBool read Get_Ctl3D write Set_Ctl3D;
    property UseDockManager: WordBool read Get_UseDockManager write Set_UseDockManager;
    property DockSite: WordBool read Get_DockSite write Set_DockSite;
    property DragCursor: Smallint read Get_DragCursor write Set_DragCursor;
    property DragMode: TxDragMode read Get_DragMode write Set_DragMode;
    property Enabled: WordBool read Get_Enabled write Set_Enabled;
    property FullRepaint: WordBool read Get_FullRepaint write Set_FullRepaint;
    property Font: IFontDisp read Get_Font write _Set_Font;
    property Locked: WordBool read Get_Locked write Set_Locked;
    property ParentColor: WordBool read Get_ParentColor write Set_ParentColor;
    property ParentCtl3D: WordBool read Get_ParentCtl3D write Set_ParentCtl3D;
    property Visible: WordBool read Get_Visible write Set_Visible;
    property DoubleBuffered: WordBool read Get_DoubleBuffered write Set_DoubleBuffered;
    property VisibleDockClientCount: Integer read Get_VisibleDockClientCount;
    property Cursor: Smallint read Get_Cursor write Set_Cursor;
    property MyProp: Integer read Get_MyProp write Set_MyProp;
  end;

// *********************************************************************//
// DispIntf:  IPanelXDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {0F3F0491-EE7D-4B5C-9F1C-57A4941C81BA}
// *********************************************************************//
  IPanelXDisp = dispinterface
    ['{0F3F0491-EE7D-4B5C-9F1C-57A4941C81BA}']
    property Alignment: TxAlignment dispid 1;
    property AutoSize: WordBool dispid 2;
    property BevelInner: TxBevelCut dispid 3;
    property BevelOuter: TxBevelCut dispid 4;
    property BorderStyle: TxBorderStyle dispid 5;
    property Caption: WideString dispid -518;
    property Color: OLE_COLOR dispid -501;
    property Ctl3D: WordBool dispid 6;
    property UseDockManager: WordBool dispid 7;
    property DockSite: WordBool dispid 8;
    property DragCursor: Smallint dispid 9;
    property DragMode: TxDragMode dispid 10;
    property Enabled: WordBool dispid -514;
    property FullRepaint: WordBool dispid 11;
    property Font: IFontDisp dispid -512;
    property Locked: WordBool dispid 12;
    property ParentColor: WordBool dispid 13;
    property ParentCtl3D: WordBool dispid 14;
    property Visible: WordBool dispid 15;
    property DoubleBuffered: WordBool dispid 16;
    property VisibleDockClientCount: Integer readonly dispid 17;
    property Cursor: Smallint dispid 26;
    procedure SetCap(Caption: {??PChar} OleVariant); dispid 34;
    property MyProp: Integer dispid 19;
  end;

// *********************************************************************//
// DispIntf:  IPanelXEvents
// Flags:     (4096) Dispatchable
// GUID:      {8CFD05E7-3210-4580-96F2-4A2DCD36C39B}
// *********************************************************************//
  IPanelXEvents = dispinterface
    ['{8CFD05E7-3210-4580-96F2-4A2DCD36C39B}']
    procedure OnCanResize(var NewWidth: Integer; var NewHeight: Integer; var Resize: WordBool); dispid 1;
    procedure OnClick; dispid 2;
    procedure OnConstrainedResize(var MinWidth: Integer; var MinHeight: Integer; 
                                  var MaxWidth: Integer; var MaxHeight: Integer); dispid 3;
    procedure OnDblClick; dispid 7;
    procedure OnResize; dispid 16;
  end;


// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name     : TPanelX
// Help String      : PanelX Control
// Default Interface: IPanelX
// Def. Intf. DISP? : No
// Event   Interface: IPanelXEvents
// TypeFlags        : (34) CanCreate Control
// *********************************************************************//
  TPanelXOnCanResize = procedure(Sender: TObject; var NewWidth: Integer; var NewHeight: Integer; 
                                                  var Resize: WordBool) of object;
  TPanelXOnConstrainedResize = procedure(Sender: TObject; var MinWidth: Integer; 
                                                          var MinHeight: Integer; 
                                                          var MaxWidth: Integer; 
                                                          var MaxHeight: Integer) of object;

  TPanelX = class(TOleControl)
  private
    FOnCanResize: TPanelXOnCanResize;
    FOnClick: TNotifyEvent;
    FOnConstrainedResize: TPanelXOnConstrainedResize;
    FOnDblClick: TNotifyEvent;
    FOnResize: TNotifyEvent;
    FIntf: IPanelX;
    function  GetControlInterface: IPanelX;
  protected
    procedure CreateControl;
    procedure InitControlData; override;
  public
    procedure SetCap(Caption: PChar);
    property  ControlInterface: IPanelX read GetControlInterface;
    property  DefaultInterface: IPanelX read GetControlInterface;
    property DoubleBuffered: WordBool index 16 read GetWordBoolProp write SetWordBoolProp;
    property VisibleDockClientCount: Integer index 17 read GetIntegerProp;
  published
    property  ParentFont;
    property  Align;
    property  ParentShowHint;
    property  PopupMenu;
    property  ShowHint;
    property  TabOrder;
    property  OnDragDrop;
    property  OnDragOver;
    property  OnEndDrag;
    property  OnEnter;
    property  OnExit;
    property  OnStartDrag;
    property Alignment: TOleEnum index 1 read GetTOleEnumProp write SetTOleEnumProp stored False;
    property AutoSize: WordBool index 2 read GetWordBoolProp write SetWordBoolProp stored False;
    property BevelInner: TOleEnum index 3 read GetTOleEnumProp write SetTOleEnumProp stored False;
    property BevelOuter: TOleEnum index 4 read GetTOleEnumProp write SetTOleEnumProp stored False;
    property BorderStyle: TOleEnum index 5 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 Ctl3D: WordBool index 6 read GetWordBoolProp write SetWordBoolProp stored False;
    property UseDockManager: WordBool index 7 read GetWordBoolProp write SetWordBoolProp stored False;
    property DockSite: WordBool index 8 read GetWordBoolProp write SetWordBoolProp stored False;
    property DragCursor: Smallint index 9 read GetSmallintProp write SetSmallintProp stored False;
    property DragMode: TOleEnum index 10 read GetTOleEnumProp write SetTOleEnumProp stored False;
    property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp stored False;
    property FullRepaint: WordBool index 11 read GetWordBoolProp write SetWordBoolProp stored False;
    property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
    property Locked: WordBool index 12 read GetWordBoolProp write SetWordBoolProp stored False;
    property ParentColor: WordBool index 13 read GetWordBoolProp write SetWordBoolProp stored False;
    property ParentCtl3D: WordBool index 14 read GetWordBoolProp write SetWordBoolProp stored False;
    property Visible: WordBool index 15 read GetWordBoolProp write SetWordBoolProp stored False;
    property Cursor: Smallint index 26 read GetSmallintProp write SetSmallintProp stored False;
    property MyProp: Integer index 19 read GetIntegerProp write SetIntegerProp stored False;
    property OnCanResize: TPanelXOnCanResize read FOnCanResize write FOnCanResize;
    property OnClick: TNotifyEvent read FOnClick write FOnClick;
    property OnConstrainedResize: TPanelXOnConstrainedResize read FOnConstrainedResize write FOnConstrainedResize;
    property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
    property OnResize: TNotifyEvent read FOnResize write FOnResize;
  end;

procedure Register;

implementation

uses ComObj;

procedure TPanelX.InitControlData;
const
  CEventDispIDs: array [0..4] of DWORD = (
    $00000001, $00000002, $00000003, $00000007, $00000010);
  CTFontIDs: array [0..0] of DWORD = (
    $FFFFFE00);
  CControlData: TControlData2 = (
    ClassID: '{6723410F-B4A4-4E83-B0A6-98543AA08D9E}';
    EventIID: '{8CFD05E7-3210-4580-96F2-4A2DCD36C39B}';
    EventCount: 5;
    EventDispIDs: @CEventDispIDs;
    LicenseKey: nil (*HR:$00000000*);
    Flags: $0000001D;
    Version: 401;
    FontCount: 1;
    FontIDs: @CTFontIDs);
begin
  ControlData := @CControlData;
  TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnCanResize) - Cardinal(Self);
end;

procedure TPanelX.CreateControl;

  procedure DoCreate;
  begin
    FIntf := IUnknown(OleObject) as IPanelX;
  end;

begin
  if FIntf = nil then DoCreate;
end;

function TPanelX.GetControlInterface: IPanelX;
begin
  CreateControl;
  Result := FIntf;
end;

procedure TPanelX.SetCap(Caption: PChar);
begin
  DefaultInterface.SetCap(Caption);
end;

procedure Register;
begin
  RegisterComponents('ActiveX',[TPanelX]);
end;

end.
