IDE: clean up

git-svn-id: trunk@48204 -
This commit is contained in:
mattias 2015-03-10 12:50:12 +00:00
parent 6f93b52fa2
commit 26635ba63b
5 changed files with 27 additions and 37 deletions

View File

@ -33,8 +33,8 @@ interface
uses
Classes, SysUtils, LCLProc, Forms, Controls, Buttons, StdCtrls,
Laz2_XMLWrite, lazutf8classes,
SynEdit, SynHighlighterDiff, LCLType, ComCtrls, ExtCtrls,
lazutf8classes,
SynEdit, SynHighlighterDiff, LCLType, ExtCtrls,
FileProcs, CodeToolManager, CodeCache,
Project, DiffPatch, LazarusIDEStrConsts, EnvironmentOpts, EditorOptions,
PackageDefs;
@ -61,10 +61,10 @@ type
Splitter: TSplitter;
SynDiffSyn1: TSynDiffSyn;
procedure DiskDiffsDlgKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FilesListBoxMouseUp(Sender: TOBject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
{%H-}Shift: TShiftState);
procedure FilesListBoxMouseUp(Sender: TOBject; {%H-}Button: TMouseButton;
{%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer);
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
private
FPackageList: TStringList;
FUnitList: TFPList;

View File

@ -34,7 +34,7 @@ uses
Dialogs, StdCtrls, ComCtrls, TreeFilterEdit, ExtCtrls, Buttons,
IDEImagesIntf, ObjectInspector,
CompatibilityRestrictions, IDEOptionDefs, LazarusIDEStrConsts,
EnvironmentOpts, ComponentReg, LazConf;
EnvironmentOpts, LazConf;
type
{ TRestrictionBrowserView }

View File

@ -30,11 +30,11 @@ unit UseUnitDlg;
interface
uses
Classes, SysUtils, Forms, Controls, ComCtrls, StdCtrls, ExtCtrls, Buttons,
ButtonPanel, Dialogs, LCLProc, FileProcs, Graphics, LCLType, EditBtn, StrUtils,
Classes, SysUtils, Forms, Controls, StdCtrls, ExtCtrls, Buttons,
ButtonPanel, Dialogs, LCLProc, FileProcs, Graphics, LCLType, EditBtn,
SourceEditor, LazIDEIntf, IDEImagesIntf, LazarusIDEStrConsts, ProjectIntf,
Project, CodeCache, CodeToolManager, IdentCompletionTool, CodeAtom, CodeTree,
PascalParserTool, ListFilterEdit, LinkScanner;
Project, CodeCache, CodeToolManager, IdentCompletionTool, CodeTree,
ListFilterEdit, LinkScanner;
type
@ -51,7 +51,7 @@ type
procedure FormDestroy(Sender: TObject);
procedure SectionRadioGroupClick(Sender: TObject);
procedure UnitsListBoxDblClick(Sender: TObject);
procedure UnitsListBoxDrawItem(Control: TWinControl; Index: Integer;
procedure UnitsListBoxDrawItem({%H-}Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState);
procedure UnitsListBoxKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
@ -65,7 +65,7 @@ type
procedure CreateOtherUnitsList;
function SelectedUnit: string;
function InterfaceSelected: Boolean;
procedure DetermineUsesSection(ACode: TCodeBuffer; ACursorPos: TPoint);
procedure DetermineUsesSection(ACode: TCodeBuffer);
procedure FillAvailableUnitsList;
public
@ -108,7 +108,7 @@ begin
UseUnitDlg.SectionRadioGroup.Enabled := False
else
// automatic choice of dest uses-section by cursor position
UseUnitDlg.DetermineUsesSection(SrcEdit.CodeBuffer, SrcEdit.GetCursorTextXY);
UseUnitDlg.DetermineUsesSection(SrcEdit.CodeBuffer);
if UseUnitDlg.FilterEdit.Items.Count = 0 then
// no available units from current project => turn on "all units"
@ -392,14 +392,11 @@ begin
Result:=SectionRadioGroup.ItemIndex=0;
end;
procedure TUseUnitDialog.DetermineUsesSection(ACode: TCodeBuffer; ACursorPos: TPoint);
procedure TUseUnitDialog.DetermineUsesSection(ACode: TCodeBuffer);
var
ImplUsesNode: TCodeTreeNode;
i: Integer;
Tool: TCodeTool;
//CursorPos: TCodeXYPosition;
//CleanCursorPos: Integer;
//ImplNode: TCodeTreeNode;
begin
CodeToolBoss.Explore(ACode,Tool,false);
if Tool=nil then exit;
@ -408,14 +405,6 @@ begin
if Assigned(ImplUsesNode) then
for i := 0 to FImplUsedUnits.Count - 1 do
FImplUsedUnits.Objects[i] := ImplUsesNode;
// check if cursor is behind interface section
{Note: now default to interface section always.
CursorPos := CodeXYPosition(ACursorPos.X, ACursorPos.Y, ACode);
Tool.CaretToCleanPos(CursorPos,CleanCursorPos);
ImplNode:=Tool.FindImplementationNode;
if (ImplNode<>nil) and (CleanCursorPos>ImplNode.StartPos) then
SectionRadioGroup.ItemIndex := 1;
}
// update
SectionRadioGroup.OnClick(SectionRadioGroup);
end;

View File

@ -246,8 +246,8 @@ type
function FindAutoInstallDependencyPath(ChildPackage: TLazPackage): TFPList;
function FindAmbiguousUnits(APackage: TLazPackage;
FirstDependency: TPkgDependency;
var File1, File2: TPkgFile;
var ConflictPkg: TLazPackage): boolean;
out File1, File2: TPkgFile;
out ConflictPkg: TLazPackage): boolean;
function FindFPCConflictUnit(APackage: TLazPackage;
FirstDependency: TPkgDependency;
const Directory: string;
@ -2576,8 +2576,8 @@ begin
end;
function TLazPackageGraph.FindAmbiguousUnits(APackage: TLazPackage;
FirstDependency: TPkgDependency; var File1, File2: TPkgFile;
var ConflictPkg: TLazPackage): boolean;
FirstDependency: TPkgDependency; out File1, File2: TPkgFile; out
ConflictPkg: TLazPackage): boolean;
// check if two connected packages have units with the same name
// Connected means here: a Package1 is directly required by a Package2
// or: a Package1 and a Package2 are directly required by a Package3

View File

@ -217,7 +217,7 @@ type
procedure ConnectSourceNotebookEvents; override;
procedure SetupMainBarShortCuts; override;
procedure SetRecentPackagesMenu; override;
procedure AddToMenuRecentPackages(const Filename: string; Save: boolean);
procedure AddToMenuRecentPackages(const Filename: string);
procedure SaveSettings; override;
procedure UpdateVisibleComponentPalette; override;
procedure ProcessCommand(Command: word; var Handled: boolean); override;
@ -3045,8 +3045,7 @@ begin
EnvironmentOptions.RecentPackageFiles,@MainIDEitmOpenRecentPackageClicked);
end;
procedure TPkgManager.AddToMenuRecentPackages(const Filename: string;
Save: boolean);
procedure TPkgManager.AddToMenuRecentPackages(const Filename: string);
begin
AddToRecentList(Filename,EnvironmentOptions.RecentPackageFiles,
EnvironmentOptions.MaxRecentPackageFiles,rltFile);
@ -3179,12 +3178,14 @@ var
end;
function GetPOFilenameParts(const Filename: string;
var AUnitName, Language: string): boolean;
out AUnitName, Language: string): boolean;
var
UnitNameEnd: Integer;
LangEnd: Integer;
begin
Result:=false;
AUnitName:='';
Language:='';
UnitNameEnd:=1;
while (UnitNameEnd<=length(Filename)) and (Filename[UnitNameEnd]<>'.') do
inc(UnitNameEnd);
@ -3548,7 +3549,7 @@ begin
if (pofAddToRecent in Flags) then begin
AFilename:=APackage.Filename;
if FileExistsCached(AFilename) then begin
AddToMenuRecentPackages(AFilename,false);
AddToMenuRecentPackages(AFilename);
end;
end;
@ -3628,7 +3629,7 @@ begin
// add to recent packages
if pofAddToRecent in Flags then begin
AddToMenuRecentPackages(AFilename,false);
AddToMenuRecentPackages(AFilename);
end;
OpenEditor:=not (pofDoNotOpenEditor in Flags);
@ -3807,7 +3808,7 @@ begin
APackage.Modified:=false;
// add to recent
if (psfSaveAs in Flags) then begin
AddToMenuRecentPackages(APackage.Filename,false);
AddToMenuRecentPackages(APackage.Filename);
end;
if APackage.Editor<>nil then