IDEIntf: added handler when LazarusIDE is created for registering startup handlers

git-svn-id: trunk@44167 -
This commit is contained in:
mattias 2014-02-19 14:22:55 +00:00
parent 87355906e4
commit aaf004850f

View File

@ -361,8 +361,29 @@ type
var
LazarusIDE: TLazIDEInterface = nil; // will be set by the IDE
procedure AddHandlerLazarusIDEStart(const OnStart: TProcedure);
procedure RunHandlersLazarusIDEStart;
implementation
var
OnLazarusIDEStart: array of TProcedure;
procedure AddHandlerLazarusIDEStart(const OnStart: TProcedure);
begin
SetLength(OnLazarusIDEStart,length(OnLazarusIDEStart)+1);
OnLazarusIDEStart[length(OnLazarusIDEStart)-1]:=OnStart;
end;
procedure RunHandlersLazarusIDEStart;
var
i: Integer;
begin
for i:=0 to length(OnLazarusIDEStart)-1 do
OnLazarusIDEStart[i]();
SetLength(OnLazarusIDEStart,0);
end;
{ TLazIDEInterface }
procedure TLazIDEInterface.AddHandler(HandlerType: TLazarusIDEHandlerType;
@ -440,6 +461,7 @@ end;
constructor TLazIDEInterface.Create(TheOwner: TComponent);
begin
LazarusIDE:=Self;
RunHandlersLazarusIDEStart;
inherited Create(TheOwner);
end;