Einzelnen Beitrag anzeigen

Benutzerbild von arbu man
arbu man

Registriert seit: 3. Nov 2004
Ort: Krefeld
1.108 Beiträge
 
Delphi 7 Professional
 
#6

Re: Event zur DesignTime benutzen

  Alt 11. Mär 2008, 21:00
Also ich habe eine normale Komponente die halt eine Collection hat...
Delphi-Quellcode:
type
  TScriptFunctions = class;

  TScriptFunction = class(TCollectionItem)
  private
    FOwner: TScriptFunctions;
    FFunctionName: string;
    FOnExecute: TExecuteFunction;
    FOnAfterCall: TNotifyEvent;
    procedure SetOnAfterCall(const Value: TNotifyEvent);
  protected
    function GetDisplayName: string; override;
  public
    constructor Create(ACollection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
  published
    property FunctionName: string read FFunctionName write FFunctionName;
    property OnExecute: TExecuteFunction read FOnExecute write FOnExecute;
  end;

  { TScriptFunctions }

  TScriptFunctions = class(TCollection)
  private
    function GetItem(Index: Integer): TScriptFunction;
    procedure SetItem(Index: Integer; Value: TScriptFunction);
  public
    constructor Create;
    destructor Destroy; override;
    function Add: TScriptFunction;
    function CountFunctionName(const AFunctionName: string): integer;
    function FindFunctionName(const AFunctionName: string): TScriptFunction;
    procedure ListFunctionName(const AList: TStrings);
    property Items[Index: Integer]: TScriptFunction read GetItem write SetItem; default;
  end;

  TScriptEngine = class(TComponent)
  private
    FFunctions: TScriptFunctions;
  public
    constructor Create(AOwner: TComponent); override;
  published
    property Functions: TScriptFunctions read FFunctions;
  end;
Warum die Komponente unbekannt sein soll kann ich mir nicht erklären, ich ziehe die Komponente über die Palette auf die Form. Vielleicht könnte es daran liegen das die Klassen TScriptFunctions und TScriptFunction nirgentwo Registriert werden, wenn das überhaupt möglich ist diese zu registrieren.
Björn
>> http://bsnx.net <<
Virtual DP Stammtisch v1.0"iw" am 19.09.2007 - ich war dabei!
  Mit Zitat antworten Zitat