mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 14:49:29 +02:00
IDEIntf: added events: lihtOnProjectBuilding, lihtOnProjectDependenciesCompiling, lihtOnProjectDependenciesCompiled
git-svn-id: trunk@19363 -
This commit is contained in:
parent
5ab96d4df6
commit
b38cff5c4d
11
ide/main.pp
11
ide/main.pp
@ -9347,8 +9347,7 @@ var
|
||||
begin
|
||||
if Project1.MainUnitInfo=nil then begin
|
||||
// this project has not source to compile
|
||||
Result:=mrCancel;
|
||||
exit;
|
||||
exit(mrCancel);
|
||||
end;
|
||||
|
||||
Result:=PrepareForCompile;
|
||||
@ -9373,6 +9372,10 @@ begin
|
||||
SourceNotebook.ClearErrorLines;
|
||||
DoArrangeSourceEditorAndMessageView(false);
|
||||
|
||||
// now building can start: call handler
|
||||
Result:=DoCallModalFunctionHandler(lihtOnProjectBuilding);
|
||||
if Result<>mrOk then exit;
|
||||
|
||||
// get main source filename
|
||||
if not Project1.IsVirtual then begin
|
||||
WorkingDir:=Project1.ProjectDirectory;
|
||||
@ -9384,6 +9387,8 @@ begin
|
||||
|
||||
// compile required packages
|
||||
if not (pbfDoNotCompileDependencies in Flags) then begin
|
||||
Result:=DoCallModalFunctionHandler(lihtOnProjectDependenciesCompiling);
|
||||
if Result<>mrOk then exit;
|
||||
PkgFlags:=[pcfDoNotSaveEditorFiles];
|
||||
if pbfCompileDependenciesClean in Flags then
|
||||
Include(PkgFlags,pcfCompileDependenciesClean);
|
||||
@ -9393,6 +9398,8 @@ begin
|
||||
PutExitInfoBuilder(lisInfoBuildError);
|
||||
exit;
|
||||
end;
|
||||
Result:=DoCallModalFunctionHandler(lihtOnProjectDependenciesCompiled);
|
||||
if Result<>mrOk then exit;
|
||||
end;
|
||||
|
||||
CompilerFilename:=Project1.GetCompilerFilename;
|
||||
|
@ -122,7 +122,10 @@ type
|
||||
lihtOnSavingAll, // called before IDE saves everything
|
||||
lihtOnSavedAll, // called after IDE saved everything
|
||||
lihtOnProjectOpened,// called after IDE opened a project
|
||||
lihtOnProjectClose // called before IDE closes a project
|
||||
lihtOnProjectClose, // called before IDE closes a project
|
||||
lihtOnProjectBuilding, // called before IDE builds the project
|
||||
lihtOnProjectDependenciesCompiling, // called before IDE compiles dependencies of project
|
||||
lihtOnProjectDependenciesCompiled // called after IDE compiled dependencies of project
|
||||
);
|
||||
|
||||
{ TLazIDEInterface }
|
||||
@ -253,6 +256,21 @@ type
|
||||
AsLast: boolean = false);
|
||||
procedure RemoveHandlerOnProjectClose(
|
||||
const OnProjectCloseEvent: TLazProjectChangedFunction);
|
||||
procedure AddHandlerOnProjectBuilding(
|
||||
const OnProjBuildingEvent: TModalResultFunction;
|
||||
AsLast: boolean = false);
|
||||
procedure RemoveHandlerOnProjectBuilding(
|
||||
const OnProjBuildingEvent: TModalResultFunction);
|
||||
procedure AddHandlerOnProjectDependenciesCompiling(
|
||||
const OnProjDependenciesCompilingEvent: TModalResultFunction;
|
||||
AsLast: boolean = false);
|
||||
procedure RemoveHandlerOnProjectDependenciesCompiling(
|
||||
const OnProjDependenciesCompilingEvent: TModalResultFunction);
|
||||
procedure AddHandlerOnProjectDependenciesCompiled(
|
||||
const OnProjDependenciesCompiledEvent: TModalResultFunction;
|
||||
AsLast: boolean = false);
|
||||
procedure RemoveHandlerOnProjectDependenciesCompiled(
|
||||
const OnProjDependenciesCompiledEvent: TModalResultFunction);
|
||||
end;
|
||||
|
||||
var
|
||||
@ -397,6 +415,47 @@ begin
|
||||
RemoveHandler(lihtOnProjectClose,TMethod(OnProjectCloseEvent));
|
||||
end;
|
||||
|
||||
procedure TLazIDEInterface.AddHandlerOnProjectBuilding(
|
||||
const OnProjBuildingEvent: TModalResultFunction; AsLast: boolean);
|
||||
begin
|
||||
AddHandler(lihtOnProjectBuilding,TMethod(OnProjBuildingEvent));
|
||||
end;
|
||||
|
||||
procedure TLazIDEInterface.RemoveHandlerOnProjectBuilding(
|
||||
const OnProjBuildingEvent: TModalResultFunction);
|
||||
begin
|
||||
RemoveHandler(lihtOnProjectBuilding,TMethod(OnProjBuildingEvent));
|
||||
end;
|
||||
|
||||
procedure TLazIDEInterface.AddHandlerOnProjectDependenciesCompiling(
|
||||
const OnProjDependenciesCompilingEvent: TModalResultFunction; AsLast: boolean);
|
||||
begin
|
||||
AddHandler(lihtOnProjectDependenciesCompiling,
|
||||
TMethod(OnProjDependenciesCompilingEvent));
|
||||
end;
|
||||
|
||||
procedure TLazIDEInterface.RemoveHandlerOnProjectDependenciesCompiling(
|
||||
const OnProjDependenciesCompilingEvent: TModalResultFunction);
|
||||
begin
|
||||
RemoveHandler(lihtOnProjectDependenciesCompiling,
|
||||
TMethod(OnProjDependenciesCompilingEvent));
|
||||
end;
|
||||
|
||||
procedure TLazIDEInterface.AddHandlerOnProjectDependenciesCompiled(
|
||||
const OnProjDependenciesCompiledEvent: TModalResultFunction; AsLast: boolean
|
||||
);
|
||||
begin
|
||||
AddHandler(lihtOnProjectDependenciesCompiled,
|
||||
TMethod(OnProjDependenciesCompiledEvent));
|
||||
end;
|
||||
|
||||
procedure TLazIDEInterface.RemoveHandlerOnProjectDependenciesCompiled(
|
||||
const OnProjDependenciesCompiledEvent: TModalResultFunction);
|
||||
begin
|
||||
RemoveHandler(lihtOnProjectDependenciesCompiled,
|
||||
TMethod(OnProjDependenciesCompiledEvent));
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterPropertyEditor(TypeInfo(AnsiString),
|
||||
THTMLBrowserHelpViewer,'BrowserPath',TFileNamePropertyEditor);
|
||||
|
Loading…
Reference in New Issue
Block a user