mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 20:30:33 +02:00
IDEIntf: added handler when LazarusIDE is created for registering startup handlers
git-svn-id: trunk@44167 -
This commit is contained in:
parent
87355906e4
commit
aaf004850f
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user