////
//  This file was generated by VCL Generator
//  Copyright 1998 - Morgan Martinet
//  06/07/1999 07:59:02
//  it subclasses all classes of the unit ActnList
////

unit Delphi_ActnList;

interface

uses
  Classes,
  Messages,
  ImgList,
  ActnList,
  PythonEngine,
  PyVarArg,
  PyRecords,
  PyDelphiAssoc;

type
  TPyContainedAction = class( TContainedAction )
  protected
    FAssoc : Integer;
  public
    destructor Destroy; override;
  published
    property __assoc__ : Integer read FAssoc write FAssoc;
  end;

  TPyCustomActionList = class( TCustomActionList )
  protected
    FAssoc : Integer;
  public
    destructor Destroy; override;
  published
    property __assoc__ : Integer read FAssoc write FAssoc;
  end;

  TPyActionList = class( TActionList )
  protected
    FAssoc : Integer;
  public
    destructor Destroy; override;
    procedure EventOnChange( Sender : TObject );
    procedure EventOnExecute( Action : TBasicAction; var Handled : Boolean );
    procedure EventOnUpdate( Action : TBasicAction; var Handled : Boolean );
  published
    property __assoc__ : Integer read FAssoc write FAssoc;
  end;

  TPyCustomAction = class( TCustomAction )
  protected
    FAssoc : Integer;
  public
    destructor Destroy; override;
    procedure EventOnHint( var HintStr : string; var CanShow : Boolean );
  published
    property __assoc__ : Integer read FAssoc write FAssoc;
  end;

  TPyAction = class( TAction )
  protected
    FAssoc : Integer;
  public
    destructor Destroy; override;
    procedure EventOnExecute( Sender : TObject );
    procedure EventOnHint( var HintStr : string; var CanShow : Boolean );
    procedure EventOnUpdate( Sender : TObject );
  published
    property __assoc__ : Integer read FAssoc write FAssoc;
  end;

  TPyActionLink = class( TActionLink )
  protected
    FAssoc : Integer;
  public
    destructor Destroy; override;
  published
    property __assoc__ : Integer read FAssoc write FAssoc;
  end;


implementation

Uses Py_Misc;

/////////// class TPyContainedAction /////////////////////

destructor TPyContainedAction.Destroy;
begin
  ClearInterface( TDelphiAssoc(FAssoc) );
  FAssoc := 0;
  inherited;
end;

/////////// class TPyCustomActionList /////////////////////

destructor TPyCustomActionList.Destroy;
begin
  ClearInterface( TDelphiAssoc(FAssoc) );
  FAssoc := 0;
  inherited;
end;

/////////// class TPyActionList /////////////////////

destructor TPyActionList.Destroy;
begin
  ClearInterface( TDelphiAssoc(FAssoc) );
  FAssoc := 0;
  inherited;
end;

procedure TPyActionList.EventOnChange( Sender : TObject );
var
  args, rslt : PPyObject;
  L : TList;
begin
  L := TList.Create;
  try
    L.Add( GetPythonObject( Sender, 'ActnList', 'TActionList' ) ); 
    rslt := ExecuteEvent( 'OnChange', TDelphiAssoc(__assoc__), L, args );
    GetPythonEngine.Py_XDecRef( rslt );
    GetPythonEngine.Py_XDecRef( args );
  finally
    L.Free;
  end;
end;

procedure TPyActionList.EventOnExecute( Action : TBasicAction; var Handled : Boolean );
var
  args, rslt : PPyObject;
  L : TList;
begin
  L := TList.Create;
  try
    L.Add( GetPythonObject( Action, 'ActnList', 'TActionList' ) ); 
    L.Add( CreateVarArg( GetPythonEngine.VariantAsPyObject( Handled ) ).GetSelf ); 
    rslt := ExecuteEvent( 'OnExecute', TDelphiAssoc(__assoc__), L, args );
    Handled := GetPythonEngine.PyObjectAsVariant( ExtractValueOfVarArg( PPyObject(L.Items[1]) ) );
    GetPythonEngine.Py_XDecRef( rslt );
    GetPythonEngine.Py_XDecRef( args );
  finally
    L.Free;
  end;
end;

procedure TPyActionList.EventOnUpdate( Action : TBasicAction; var Handled : Boolean );
var
  args, rslt : PPyObject;
  L : TList;
begin
  L := TList.Create;
  try
    L.Add( GetPythonObject( Action, 'ActnList', 'TActionList' ) ); 
    L.Add( CreateVarArg( GetPythonEngine.VariantAsPyObject( Handled ) ).GetSelf ); 
    rslt := ExecuteEvent( 'OnUpdate', TDelphiAssoc(__assoc__), L, args );
    Handled := GetPythonEngine.PyObjectAsVariant( ExtractValueOfVarArg( PPyObject(L.Items[1]) ) );
    GetPythonEngine.Py_XDecRef( rslt );
    GetPythonEngine.Py_XDecRef( args );
  finally
    L.Free;
  end;
end;

/////////// class TPyCustomAction /////////////////////

destructor TPyCustomAction.Destroy;
begin
  ClearInterface( TDelphiAssoc(FAssoc) );
  FAssoc := 0;
  inherited;
end;

procedure TPyCustomAction.EventOnHint( var HintStr : string; var CanShow : Boolean );
var
  args, rslt : PPyObject;
  L : TList;
begin
  L := TList.Create;
  try
    L.Add( CreateVarArg( GetPythonEngine.VariantAsPyObject( HintStr ) ).GetSelf ); 
    L.Add( CreateVarArg( GetPythonEngine.VariantAsPyObject( CanShow ) ).GetSelf ); 
    rslt := ExecuteEvent( 'OnHint', TDelphiAssoc(__assoc__), L, args );
    HintStr := GetPythonEngine.PyObjectAsVariant( ExtractValueOfVarArg( PPyObject(L.Items[0]) ) );
    CanShow := GetPythonEngine.PyObjectAsVariant( ExtractValueOfVarArg( PPyObject(L.Items[1]) ) );
    GetPythonEngine.Py_XDecRef( rslt );
    GetPythonEngine.Py_XDecRef( args );
  finally
    L.Free;
  end;
end;

/////////// class TPyAction /////////////////////

destructor TPyAction.Destroy;
begin
  ClearInterface( TDelphiAssoc(FAssoc) );
  FAssoc := 0;
  inherited;
end;

procedure TPyAction.EventOnExecute( Sender : TObject );
var
  args, rslt : PPyObject;
  L : TList;
begin
  L := TList.Create;
  try
    L.Add( GetPythonObject( Sender, 'ActnList', 'TAction' ) ); 
    rslt := ExecuteEvent( 'OnExecute', TDelphiAssoc(__assoc__), L, args );
    GetPythonEngine.Py_XDecRef( rslt );
    GetPythonEngine.Py_XDecRef( args );
  finally
    L.Free;
  end;
end;

procedure TPyAction.EventOnHint( var HintStr : string; var CanShow : Boolean );
var
  args, rslt : PPyObject;
  L : TList;
begin
  L := TList.Create;
  try
    L.Add( CreateVarArg( GetPythonEngine.VariantAsPyObject( HintStr ) ).GetSelf ); 
    L.Add( CreateVarArg( GetPythonEngine.VariantAsPyObject( CanShow ) ).GetSelf ); 
    rslt := ExecuteEvent( 'OnHint', TDelphiAssoc(__assoc__), L, args );
    HintStr := GetPythonEngine.PyObjectAsVariant( ExtractValueOfVarArg( PPyObject(L.Items[0]) ) );
    CanShow := GetPythonEngine.PyObjectAsVariant( ExtractValueOfVarArg( PPyObject(L.Items[1]) ) );
    GetPythonEngine.Py_XDecRef( rslt );
    GetPythonEngine.Py_XDecRef( args );
  finally
    L.Free;
  end;
end;

procedure TPyAction.EventOnUpdate( Sender : TObject );
var
  args, rslt : PPyObject;
  L : TList;
begin
  L := TList.Create;
  try
    L.Add( GetPythonObject( Sender, 'ActnList', 'TAction' ) ); 
    rslt := ExecuteEvent( 'OnUpdate', TDelphiAssoc(__assoc__), L, args );
    GetPythonEngine.Py_XDecRef( rslt );
    GetPythonEngine.Py_XDecRef( args );
  finally
    L.Free;
  end;
end;

/////////// class TPyActionLink /////////////////////

destructor TPyActionLink.Destroy;
begin
  ClearInterface( TDelphiAssoc(FAssoc) );
  FAssoc := 0;
  inherited;
end;


end.
