mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 13:59:20 +02:00
IDEIntf: added boot handler when transfer macros have been created
git-svn-id: trunk@44168 -
This commit is contained in:
parent
aaf004850f
commit
ba22fe2361
@ -355,33 +355,42 @@ type
|
||||
const OnQuickSyntaxCheckEvent: TModalHandledFunction;
|
||||
AsLast: boolean = false);
|
||||
procedure RemoveHandlerOnQuickSyntaxCheck(
|
||||
const OnQuickSyntaxCheckEvent: TModalHandledFunction);
|
||||
const OnQuickSyntaxCheckEvent: TModalHandledFunction);
|
||||
end;
|
||||
|
||||
var
|
||||
LazarusIDE: TLazIDEInterface = nil; // will be set by the IDE
|
||||
|
||||
procedure AddHandlerLazarusIDEStart(const OnStart: TProcedure);
|
||||
procedure RunHandlersLazarusIDEStart;
|
||||
type
|
||||
TLazarusIDEBootHandlerType = (
|
||||
libhTransferMacrosCreated //
|
||||
);
|
||||
|
||||
procedure AddBootHandler(ht: TLazarusIDEBootHandlerType; const OnBoot: TProcedure);
|
||||
procedure RunBootHandlers(ht: TLazarusIDEBootHandlerType);
|
||||
|
||||
implementation
|
||||
|
||||
type
|
||||
TArrayOfProc = array of TProcedure;
|
||||
var
|
||||
OnLazarusIDEStart: array of TProcedure;
|
||||
BootHandlers: array[TLazarusIDEBootHandlerType] of TArrayOfProc;
|
||||
|
||||
procedure AddHandlerLazarusIDEStart(const OnStart: TProcedure);
|
||||
procedure AddBootHandler(ht: TLazarusIDEBootHandlerType; const OnBoot: TProcedure);
|
||||
var
|
||||
l: Integer;
|
||||
begin
|
||||
SetLength(OnLazarusIDEStart,length(OnLazarusIDEStart)+1);
|
||||
OnLazarusIDEStart[length(OnLazarusIDEStart)-1]:=OnStart;
|
||||
l:=length(BootHandlers);
|
||||
SetLength(BootHandlers[ht],l+1);
|
||||
BootHandlers[ht][l]:=OnBoot;
|
||||
end;
|
||||
|
||||
procedure RunHandlersLazarusIDEStart;
|
||||
procedure RunBootHandlers(ht: TLazarusIDEBootHandlerType);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i:=0 to length(OnLazarusIDEStart)-1 do
|
||||
OnLazarusIDEStart[i]();
|
||||
SetLength(OnLazarusIDEStart,0);
|
||||
for i:=0 to length(BootHandlers[ht])-1 do
|
||||
BootHandlers[ht][i]();
|
||||
end;
|
||||
|
||||
{ TLazIDEInterface }
|
||||
@ -461,7 +470,6 @@ end;
|
||||
constructor TLazIDEInterface.Create(TheOwner: TComponent);
|
||||
begin
|
||||
LazarusIDE:=Self;
|
||||
RunHandlersLazarusIDEStart;
|
||||
inherited Create(TheOwner);
|
||||
end;
|
||||
|
||||
|
@ -423,6 +423,8 @@ begin
|
||||
'PROJECTINCPATH',nil,@CTMacroFuncProjectIncPath);
|
||||
CodeToolBoss.DefineTree.MacroFunctions.AddExtended(
|
||||
'PROJECTSRCPATH',nil,@CTMacroFuncProjectSrcPath);
|
||||
|
||||
RunBootHandlers(libhTransferMacrosCreated);
|
||||
end;
|
||||
|
||||
procedure TBuildManager.TranslateMacros;
|
||||
|
Loading…
Reference in New Issue
Block a user