mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 03:39:18 +02:00
IDE: Minor optimization and formatting.
This commit is contained in:
parent
0f4a7bbc7e
commit
5dc0aebd74
@ -996,11 +996,11 @@ type
|
|||||||
// search
|
// search
|
||||||
function IndexOf(AUnitInfo: TUnitInfo): integer;
|
function IndexOf(AUnitInfo: TUnitInfo): integer;
|
||||||
function IndexOfUnitWithName(const AnUnitName: string;
|
function IndexOfUnitWithName(const AnUnitName: string;
|
||||||
OnlyProjectUnits:boolean; IgnoreUnit: TUnitInfo): integer;
|
OnlyProjectUnits: boolean; IgnoreUnit: TUnitInfo): integer;
|
||||||
function IndexOfUnitWithComponent(AComponent: TComponent;
|
function IndexOfUnitWithComponent(AComponent: TComponent;
|
||||||
OnlyProjectUnits:boolean; IgnoreUnit: TUnitInfo): integer;
|
OnlyProjectUnits: boolean; IgnoreUnit: TUnitInfo): integer;
|
||||||
function IndexOfUnitWithComponentName(const AComponentName: string;
|
function IndexOfUnitWithComponentName(const AComponentName: string;
|
||||||
OnlyProjectUnits:boolean; IgnoreUnit: TUnitInfo): integer;
|
OnlyProjectUnits: boolean; IgnoreUnit: TUnitInfo): integer;
|
||||||
function IndexOfFilename(const AFilename: string): integer;
|
function IndexOfFilename(const AFilename: string): integer;
|
||||||
function IndexOfFilename(const AFilename: string;
|
function IndexOfFilename(const AFilename: string;
|
||||||
SearchFlags: TProjectFileSearchFlags): integer;
|
SearchFlags: TProjectFileSearchFlags): integer;
|
||||||
@ -1037,15 +1037,15 @@ type
|
|||||||
function UpdateIsPartOfProjectFromMainUnit: TModalResult;
|
function UpdateIsPartOfProjectFromMainUnit: TModalResult;
|
||||||
|
|
||||||
// Application.CreateForm statements
|
// Application.CreateForm statements
|
||||||
function AddCreateFormToProjectFile(const AClassName, AName:string): boolean;
|
function AddCreateFormToProjectFile(const AClassName, AName: string): boolean;
|
||||||
function RemoveCreateFormFromProjectFile(const AName: string): boolean;
|
function RemoveCreateFormFromProjectFile(const AName: string): boolean;
|
||||||
function FormIsCreatedInProjectFile(const AClassname, AName:string): boolean;
|
function FormIsCreatedInProjectFile(const AClassname, AName: string): boolean;
|
||||||
function GetAutoCreatedFormsList: TStrings;
|
function GetAutoCreatedFormsList: TStrings;
|
||||||
property TmpAutoCreatedForms: TStrings read FTmpAutoCreatedForms write FTmpAutoCreatedForms;
|
property TmpAutoCreatedForms: TStrings read FTmpAutoCreatedForms write FTmpAutoCreatedForms;
|
||||||
|
|
||||||
// resources
|
// resources
|
||||||
function GetMainResourceFilename(AnUnitInfo: TUnitInfo): string;
|
function GetMainResourceFilename(AnUnitInfo: TUnitInfo): string;
|
||||||
function GetResourceFile(AnUnitInfo: TUnitInfo; Index:integer):TCodeBuffer;
|
function GetResourceFile(AnUnitInfo: TUnitInfo; Index: integer): TCodeBuffer;
|
||||||
procedure LoadDefaultIcon; override;
|
procedure LoadDefaultIcon; override;
|
||||||
|
|
||||||
// filenames and fileinfo
|
// filenames and fileinfo
|
||||||
@ -4310,14 +4310,14 @@ begin
|
|||||||
MainUnitInfo.Modified:=true;
|
MainUnitInfo.Modified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.RemoveCreateFormFromProjectFile(const AName:string):boolean;
|
function TProject.RemoveCreateFormFromProjectFile(const AName: string): boolean;
|
||||||
begin
|
begin
|
||||||
Result:=CodeToolBoss.RemoveCreateFormStatement(MainUnitInfo.Source,AName);
|
Result:=CodeToolBoss.RemoveCreateFormStatement(MainUnitInfo.Source,AName);
|
||||||
if Result then
|
if Result then
|
||||||
MainUnitInfo.Modified:=true;
|
MainUnitInfo.Modified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.FormIsCreatedInProjectFile(const AClassname,AName:string): boolean;
|
function TProject.FormIsCreatedInProjectFile(const AClassname,AName: string): boolean;
|
||||||
var p: integer;
|
var p: integer;
|
||||||
begin
|
begin
|
||||||
Result:=(CodeToolBoss.FindCreateFormStatement(MainUnitInfo.Source,
|
Result:=(CodeToolBoss.FindCreateFormStatement(MainUnitInfo.Source,
|
||||||
@ -4325,14 +4325,13 @@ begin
|
|||||||
if p=0 then ;
|
if p=0 then ;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.IndexOfUnitWithName(const AnUnitName:string;
|
function TProject.IndexOfUnitWithName(const AnUnitName: string;
|
||||||
OnlyProjectUnits:boolean; IgnoreUnit: TUnitInfo):integer;
|
OnlyProjectUnits: boolean; IgnoreUnit: TUnitInfo): integer;
|
||||||
begin
|
begin
|
||||||
if AnUnitName='' then exit(-1);
|
if AnUnitName='' then exit(-1);
|
||||||
Result:=UnitCount-1;
|
Result:=UnitCount-1;
|
||||||
while (Result>=0) do begin
|
while (Result>=0) do begin
|
||||||
if ((OnlyProjectUnits and Units[Result].IsPartOfProject)
|
if (Units[Result].IsPartOfProject or not OnlyProjectUnits)
|
||||||
or (not OnlyProjectUnits))
|
|
||||||
and (IgnoreUnit<>Units[Result])
|
and (IgnoreUnit<>Units[Result])
|
||||||
and (Units[Result].Unit_Name<>'')
|
and (Units[Result].Unit_Name<>'')
|
||||||
then begin
|
then begin
|
||||||
@ -4345,12 +4344,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.IndexOfUnitWithComponent(AComponent: TComponent;
|
function TProject.IndexOfUnitWithComponent(AComponent: TComponent;
|
||||||
OnlyProjectUnits:boolean; IgnoreUnit: TUnitInfo):integer;
|
OnlyProjectUnits: boolean; IgnoreUnit: TUnitInfo): integer;
|
||||||
begin
|
begin
|
||||||
Result:=UnitCount-1;
|
Result:=UnitCount-1;
|
||||||
while (Result>=0) do begin
|
while (Result>=0) do begin
|
||||||
if (OnlyProjectUnits and Units[Result].IsPartOfProject)
|
if (Units[Result].IsPartOfProject or not OnlyProjectUnits)
|
||||||
or (not OnlyProjectUnits)
|
|
||||||
and (IgnoreUnit<>Units[Result]) then begin
|
and (IgnoreUnit<>Units[Result]) then begin
|
||||||
if Units[Result].Component=AComponent then
|
if Units[Result].Component=AComponent then
|
||||||
exit;
|
exit;
|
||||||
@ -4364,8 +4362,7 @@ function TProject.IndexOfUnitWithComponentName(const AComponentName: string;
|
|||||||
begin
|
begin
|
||||||
Result:=UnitCount-1;
|
Result:=UnitCount-1;
|
||||||
while (Result>=0) do begin
|
while (Result>=0) do begin
|
||||||
if ((OnlyProjectUnits and Units[Result].IsPartOfProject)
|
if (Units[Result].IsPartOfProject or not OnlyProjectUnits)
|
||||||
or (not OnlyProjectUnits))
|
|
||||||
and (IgnoreUnit<>Units[Result]) then begin
|
and (IgnoreUnit<>Units[Result]) then begin
|
||||||
if (CompareText(Units[Result].ComponentName,AComponentName)=0)
|
if (CompareText(Units[Result].ComponentName,AComponentName)=0)
|
||||||
or ((Units[Result].Component<>nil)
|
or ((Units[Result].Component<>nil)
|
||||||
@ -4388,7 +4385,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.GetResourceFile(AnUnitInfo: TUnitInfo; Index:integer): TCodeBuffer;
|
function TProject.GetResourceFile(AnUnitInfo: TUnitInfo; Index:integer): TCodeBuffer;
|
||||||
var i, LinkIndex: integer;
|
var
|
||||||
|
i, LinkIndex: integer;
|
||||||
begin
|
begin
|
||||||
LinkIndex:=-1;
|
LinkIndex:=-1;
|
||||||
i:=0;
|
i:=0;
|
||||||
@ -4430,7 +4428,7 @@ begin
|
|||||||
LoadSaveFilenameHandler(AFilename,true);
|
LoadSaveFilenameHandler(AFilename,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.GetMainResourceFilename(AnUnitInfo: TUnitInfo):string;
|
function TProject.GetMainResourceFilename(AnUnitInfo: TUnitInfo): string;
|
||||||
var CodeBuf: TCodeBuffer;
|
var CodeBuf: TCodeBuffer;
|
||||||
begin
|
begin
|
||||||
CodeBuf:=GetResourceFile(AnUnitInfo,1);
|
CodeBuf:=GetResourceFile(AnUnitInfo,1);
|
||||||
|
@ -1202,13 +1202,6 @@ begin
|
|||||||
DoMoveDependency(-1);
|
DoMoveDependency(-1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.OnIdle(Sender: TObject; var Done: Boolean);
|
|
||||||
begin
|
|
||||||
if fUpdateLock>0 then exit;
|
|
||||||
IdleConnected:=false;
|
|
||||||
UpdatePending;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TPackageEditorForm.MoveDownBtnClick(Sender: TObject);
|
procedure TPackageEditorForm.MoveDownBtnClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if SortAlphabetically then exit;
|
if SortAlphabetically then exit;
|
||||||
@ -1218,6 +1211,13 @@ begin
|
|||||||
DoMoveDependency(1)
|
DoMoveDependency(1)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPackageEditorForm.OnIdle(Sender: TObject; var Done: Boolean);
|
||||||
|
begin
|
||||||
|
if fUpdateLock>0 then exit;
|
||||||
|
IdleConnected:=false;
|
||||||
|
UpdatePending;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.OpenButtonClick(Sender: TObject);
|
procedure TPackageEditorForm.OpenButtonClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user