mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 10:38:15 +02:00
IDE: codebrowser: hints and jump to node, LCL package: script to create the list of LCL units
git-svn-id: trunk@10714 -
This commit is contained in:
parent
7127d2d4d0
commit
f5b6a2e3ba
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -2845,6 +2845,7 @@ packager/packagedefs.pas svneol=native#text/pascal
|
||||
packager/packageeditor.pas svneol=native#text/pascal
|
||||
packager/packagelinks.pas svneol=native#text/pascal
|
||||
packager/packagesystem.pas svneol=native#text/pascal
|
||||
packager/pkgfileslcl.inc svneol=native#text/plain
|
||||
packager/pkggraphexplorer.lfm svneol=native#text/plain
|
||||
packager/pkggraphexplorer.lrs svneol=native#text/plain
|
||||
packager/pkggraphexplorer.pas svneol=native#text/pascal
|
||||
@ -2998,4 +2999,5 @@ tools/lfm_to_lrs.sh svneol=native#text/plain
|
||||
tools/runwait.sh -text svneol=native#application/x-sh
|
||||
tools/svn2revisioninc.lpi svneol=native#text/plain
|
||||
tools/svn2revisioninc.pas svneol=native#text/plain
|
||||
tools/update_pkgfileslcl_inc.sh svneol=native#text/plain
|
||||
tools/updatepofiles.pas svneol=native#text/pascal
|
||||
|
@ -124,6 +124,7 @@ object CodeBrowserView: TCodeBrowserView
|
||||
ShowHint = True
|
||||
ShowRoot = False
|
||||
TabOrder = 3
|
||||
OnMouseDown = BrowseTreeViewMouseDown
|
||||
OnShowHint = BrowseTreeViewShowHint
|
||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoShowButtons, tvoShowLines, tvoToolTips]
|
||||
end
|
||||
|
@ -45,9 +45,10 @@ LazarusResources.Add('TCodeBrowserView','FORMDATA',[
|
||||
+#6'Height'#3#138#1#3'Top'#3#150#0#5'Width'#3'z'#2#5'Align'#7#8'alBottom'#7'A'
|
||||
+'nchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#17'DefaultItemHeight'
|
||||
+#2#16#6'Images'#7#10'ImageList1'#14'ParentShowHint'#8#8'ShowHint'#9#8'ShowRo'
|
||||
+'ot'#8#8'TabOrder'#2#3#10'OnShowHint'#7#22'BrowseTreeViewShowHint'#7'Options'
|
||||
+#11#17'tvoAutoItemHeight'#16'tvoHideSelection'#21'tvoKeepCollapsedNodes'#14
|
||||
+'tvoShowButtons'#12'tvoShowLines'#11'tvoToolTips'#0#0#0#10'TStatusBar'#10'St'
|
||||
+'atusBar1'#6'Height'#2#20#3'Top'#3' '#2#5'Width'#3'z'#2#6'Panels'#14#0#0#0#10
|
||||
+'TImageList'#10'ImageList1'#4'left'#3'*'#1#3'top'#3#196#0#0#0#0
|
||||
+'ot'#8#8'TabOrder'#2#3#11'OnMouseDown'#7#23'BrowseTreeViewMouseDown'#10'OnSh'
|
||||
+'owHint'#7#22'BrowseTreeViewShowHint'#7'Options'#11#17'tvoAutoItemHeight'#16
|
||||
+'tvoHideSelection'#21'tvoKeepCollapsedNodes'#14'tvoShowButtons'#12'tvoShowLi'
|
||||
+'nes'#11'tvoToolTips'#0#0#0#10'TStatusBar'#10'StatusBar1'#6'Height'#2#20#3'T'
|
||||
+'op'#3' '#2#5'Width'#3'z'#2#6'Panels'#14#0#0#0#10'TImageList'#10'ImageList1'
|
||||
+#4'left'#3'*'#1#3'top'#3#196#0#0#0#0
|
||||
]);
|
||||
|
@ -45,7 +45,7 @@ uses
|
||||
CodeAtom, BasicCodeTools, DefineTemplates, CodeTree, CodeCache, CodeToolManager,
|
||||
PascalParserTool, LinkScanner, FileProcs,
|
||||
// IDEIntf
|
||||
LazConfigStorage, Project,
|
||||
LazConfigStorage, Project, PackageIntf, IDECommands, LazIDEIntf,
|
||||
// IDE
|
||||
PackageSystem, PackageDefs, LazarusIDEStrConsts, IDEOptionDefs,
|
||||
EnvironmentOpts;
|
||||
@ -61,19 +61,20 @@ type
|
||||
private
|
||||
FCBUnit: TCodeBrowserUnit;
|
||||
FChildNodes: TAvgLvlTree;
|
||||
FCodePos: TCodePosition;
|
||||
FDesc: TCodeTreeNodeDesc;
|
||||
FDescription: string;
|
||||
FNode: TCodeTreeNode;
|
||||
FParentNode: TCodeBrowserNode;
|
||||
public
|
||||
constructor Create(TheUnit: TCodeBrowserUnit; TheNode: TCodeTreeNode;
|
||||
constructor Create(TheUnit: TCodeBrowserUnit;
|
||||
TheParent: TCodeBrowserNode;
|
||||
const TheDescription: string);
|
||||
destructor Destroy; override;
|
||||
procedure Clear;
|
||||
function AddNode(CTNode: TCodeTreeNode;
|
||||
const Description: string): TCodeBrowserNode;
|
||||
function AddNode(const Description: string): TCodeBrowserNode;
|
||||
property CBUnit: TCodeBrowserUnit read FCBUnit;
|
||||
property Node: TCodeTreeNode read FNode;
|
||||
property Desc: TCodeTreeNodeDesc read FDesc write FDesc;
|
||||
property CodePos: TCodePosition read FCodePos write FCodePos;
|
||||
property ParentNode: TCodeBrowserNode read FParentNode;
|
||||
property ChildNodes: TAvgLvlTree read FChildNodes;
|
||||
property Description: string read FDescription;
|
||||
@ -101,8 +102,7 @@ type
|
||||
constructor Create(const TheFilename: string);
|
||||
destructor Destroy; override;
|
||||
procedure Clear;
|
||||
function AddNode(CTNode: TCodeTreeNode;
|
||||
const Description: string): TCodeBrowserNode;
|
||||
function AddNode(const Description: string): TCodeBrowserNode;
|
||||
property Filename: string read FFilename;
|
||||
property CodeBuffer: TCodeBuffer read FCodeBuffer write SetCodeBuffer;
|
||||
property CodeTool: TCodeTool read FCodeTool write SetCodeTool;
|
||||
@ -222,6 +222,8 @@ type
|
||||
ScopeGroupBox: TGroupBox;
|
||||
BrowseTreeView: TTreeView;
|
||||
StatusBar1: TStatusBar;
|
||||
procedure BrowseTreeViewMouseDown(Sender: TOBject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure BrowseTreeViewShowHint(Sender: TObject; HintInfo: PHintInfo);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
@ -243,6 +245,7 @@ type
|
||||
FScannedLines: PtrInt;
|
||||
FScannedPackages: integer;
|
||||
FScannedUnits: integer;
|
||||
FUpdateNeeded: boolean;
|
||||
FViewRoot: TObject;
|
||||
FWorkingParserRoot: TCodeBrowserUnitList;
|
||||
fUpdateCount: integer;
|
||||
@ -276,6 +279,7 @@ type
|
||||
procedure SetScannedLines(const AValue: PtrInt);
|
||||
procedure SetScannedPackages(const AValue: integer);
|
||||
procedure SetScannedUnits(const AValue: integer);
|
||||
procedure SetUpdateNeeded(const AValue: boolean);
|
||||
procedure Work;
|
||||
procedure WorkGetOptions;
|
||||
procedure WorkGatherPackages;
|
||||
@ -312,6 +316,7 @@ type
|
||||
property ScannedLines: PtrInt read FScannedLines write SetScannedLines;
|
||||
property ScannedBytes: PtrInt read FScannedBytes write SetScannedBytes;
|
||||
property ScannedIdentifiers: PtrInt read FScannedIdentifiers write SetScannedIdentifiers;
|
||||
property UpdateNeeded: boolean read FUpdateNeeded write SetUpdateNeeded;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -391,7 +396,7 @@ begin
|
||||
InitImageList;
|
||||
LoadOptions;
|
||||
|
||||
fStage:=cbwsGetOptions;
|
||||
UpdateNeeded:=true;
|
||||
Application.AddOnIdleHandler(@OnIdle);
|
||||
end;
|
||||
|
||||
@ -553,6 +558,14 @@ begin
|
||||
FScannedUnits:=AValue;
|
||||
end;
|
||||
|
||||
procedure TCodeBrowserView.SetUpdateNeeded(const AValue: boolean);
|
||||
begin
|
||||
if FUpdateNeeded=AValue then exit;
|
||||
FUpdateNeeded:=AValue;
|
||||
if FUpdateNeeded then
|
||||
fStage:=cbwsGetOptions;
|
||||
end;
|
||||
|
||||
procedure TCodeBrowserView.Work;
|
||||
// do some work
|
||||
// This is called during OnIdle, so progress in small steps
|
||||
@ -570,6 +583,7 @@ begin
|
||||
cbwsUpdateUnits: WorkUpdateUnits;
|
||||
cbwsUpdateTreeView: WorkUpdateTreeView;
|
||||
else
|
||||
UpdateNeeded:=false;
|
||||
exit;
|
||||
end;
|
||||
if ord(OldStage)<ord(cbwsFinished) then begin
|
||||
@ -580,19 +594,25 @@ end;
|
||||
procedure TCodeBrowserView.WorkGetOptions;
|
||||
var
|
||||
i: Integer;
|
||||
NewLevels: TStringList;
|
||||
begin
|
||||
DebugLn(['TCodeBrowserView.WorkGetOptions START']);
|
||||
Options.WithRequiredPackages:=ScopeWithRequiredPackagesCheckBox.Checked;
|
||||
Options.Scope:=ScopeComboBox.Text;
|
||||
Options.ShowPrivate:=ShowPrivateCheckBox.Checked;
|
||||
Options.ShowProtected:=ShowProtectedCheckBox.Checked;
|
||||
Options.Levels.Clear;
|
||||
NewLevels:=TStringList.Create;
|
||||
for i:=0 to LevelsCheckGroup.Items.Count-1 do
|
||||
if LevelsCheckGroup.Checked[i] then
|
||||
Options.Levels.Add(CodeBrowserLevelNames[TCodeBrowserLevel(i)]);
|
||||
NewLevels.Add(CodeBrowserLevelNames[TCodeBrowserLevel(i)]);
|
||||
Options.Levels:=NewLevels;
|
||||
NewLevels.Free;
|
||||
|
||||
// this stage finished -> next stage
|
||||
fStage:=cbwsGatherPackages;
|
||||
if UpdateNeeded or Options.Modified then
|
||||
fStage:=cbwsGatherPackages
|
||||
else
|
||||
fStage:=cbwsFinished;
|
||||
end;
|
||||
|
||||
procedure TCodeBrowserView.WorkGatherPackages;
|
||||
@ -1240,6 +1260,8 @@ var
|
||||
ChildCTNode: TCodeTreeNode;
|
||||
|
||||
procedure AddChildNode(const ChildDescription: string);
|
||||
var
|
||||
NewChildNode: TCodeBrowserNode;
|
||||
begin
|
||||
//DebugLn(['AddChildNode ',ChildCTNode.DescAsString,' ',ChildDescription]);
|
||||
if (ChildCTNode.Parent.Desc=ctnClassPrivate) and (not ShowPrivate) then
|
||||
@ -1247,13 +1269,21 @@ var
|
||||
if (ChildCTNode.Parent.Desc=ctnClassProtected) and (not ShowProtected)
|
||||
then
|
||||
exit;
|
||||
NewNode.AddNode(ChildCTNode,ChildDescription);
|
||||
NewChildNode:=NewNode.AddNode(ChildDescription);
|
||||
if NewChildNode<>nil then begin
|
||||
NewChildNode.Desc:=ChildCTNode.Desc;
|
||||
Tool.CleanPosToCodePos(ChildCTNode.StartPos,NewChildNode.FCodePos);
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
AddUnit;
|
||||
//DebugLn(['AddIdentifierNode ',CTNode.DescAsString,' Description="',Description,'"']);
|
||||
NewNode:=TCodeBrowserUnit(DestUnit).AddNode(CTNode,Description);
|
||||
NewNode:=TCodeBrowserUnit(DestUnit).AddNode(Description);
|
||||
NewNode.Desc:=CTNode.Desc;
|
||||
Tool.CleanPosToCodePos(CTNode.StartPos,NewNode.FCodePos);
|
||||
//DebugLn(['AddIdentifierNode Code=',NewNode.FCodePos.Code<>nil,' P=',NewNode.FCodePos.P]);
|
||||
|
||||
if (CTNode.Desc=ctnTypeDefinition)
|
||||
and (CTNode.FirstChild<>nil)
|
||||
and (CTNode.FirstChild.Desc in [ctnClass,ctnClassInterface,ctnRecordType,
|
||||
@ -1289,7 +1319,7 @@ var
|
||||
CTNode: TCodeTreeNode;
|
||||
begin
|
||||
if SrcUnit=nil then exit;
|
||||
DebugLn(['AddUnitNodes SrcUnit.Filename="',SrcUnit.Filename,'"']);
|
||||
//DebugLn(['AddUnitNodes SrcUnit.Filename="',SrcUnit.Filename,'"']);
|
||||
Tool:=GetCodeTool(SrcUnit);
|
||||
if Tool=nil then exit;
|
||||
if Tool.Tree=nil then exit;
|
||||
@ -1336,7 +1366,7 @@ var
|
||||
NewUnit: TCodeBrowserUnit;
|
||||
begin
|
||||
if SrcList=nil then exit;
|
||||
DebugLn(['AddUnits SrcList.Owner="',SrcList.Owner,'" HasUnits=',SrcList.Units<>nil]);
|
||||
//DebugLn(['AddUnits SrcList.Owner="',SrcList.Owner,'" HasUnits=',SrcList.Units<>nil]);
|
||||
if SrcList.Units<>nil then begin
|
||||
Node:=SrcList.Units.FindLowest;
|
||||
NewUnit:=nil;
|
||||
@ -1372,7 +1402,7 @@ var
|
||||
NewList: TCodeBrowserUnitList;
|
||||
begin
|
||||
if SrcList=nil then exit;
|
||||
DebugLn(['AddUnitLists SrcList.Owner="',SrcList.Owner,'"']);
|
||||
//DebugLn(['AddUnitLists SrcList.Owner="',SrcList.Owner,'"']);
|
||||
// create node
|
||||
if ShowPackages then begin
|
||||
if DestParentList=nil then begin
|
||||
@ -1589,39 +1619,37 @@ begin
|
||||
Result:=ImgIDPackage;
|
||||
end else if CodeNode is TCodeBrowserNode then begin
|
||||
Node:=TCodeBrowserNode(CodeNode);
|
||||
if Node.Node<>nil then begin
|
||||
case Node.Node.Desc of
|
||||
ctnProgram,ctnLibrary,ctnPackage:
|
||||
Result:=ImgIDProgramCode;
|
||||
ctnUnit:
|
||||
Result:=ImgIDUnitCode;
|
||||
ctnInterface:
|
||||
Result:=ImgIDInterfaceSection;
|
||||
ctnImplementation:
|
||||
Result:=ImgIDImplementation;
|
||||
ctnInitialization:
|
||||
Result:=ImgIDInitialization;
|
||||
ctnFinalization:
|
||||
Result:=ImgIDFinalization;
|
||||
ctnTypeSection:
|
||||
Result:=ImgIDTypeSection;
|
||||
ctnTypeDefinition:
|
||||
Result:=ImgIDType;
|
||||
ctnVarSection:
|
||||
Result:=ImgIDVarSection;
|
||||
ctnVarDefinition:
|
||||
Result:=ImgIDVariable;
|
||||
ctnConstSection,ctnResStrSection:
|
||||
Result:=ImgIDConstSection;
|
||||
ctnConstDefinition:
|
||||
Result:=ImgIDConst;
|
||||
ctnClass:
|
||||
Result:=ImgIDClass;
|
||||
ctnProcedure:
|
||||
Result:=ImgIDProc;
|
||||
ctnProperty:
|
||||
Result:=ImgIDProperty;
|
||||
end;
|
||||
case Node.Desc of
|
||||
ctnProgram,ctnLibrary,ctnPackage:
|
||||
Result:=ImgIDProgramCode;
|
||||
ctnUnit:
|
||||
Result:=ImgIDUnitCode;
|
||||
ctnInterface:
|
||||
Result:=ImgIDInterfaceSection;
|
||||
ctnImplementation:
|
||||
Result:=ImgIDImplementation;
|
||||
ctnInitialization:
|
||||
Result:=ImgIDInitialization;
|
||||
ctnFinalization:
|
||||
Result:=ImgIDFinalization;
|
||||
ctnTypeSection:
|
||||
Result:=ImgIDTypeSection;
|
||||
ctnTypeDefinition:
|
||||
Result:=ImgIDType;
|
||||
ctnVarSection:
|
||||
Result:=ImgIDVarSection;
|
||||
ctnVarDefinition:
|
||||
Result:=ImgIDVariable;
|
||||
ctnConstSection,ctnResStrSection:
|
||||
Result:=ImgIDConstSection;
|
||||
ctnConstDefinition:
|
||||
Result:=ImgIDConst;
|
||||
ctnClass:
|
||||
Result:=ImgIDClass;
|
||||
ctnProcedure:
|
||||
Result:=ImgIDProc;
|
||||
ctnProperty:
|
||||
Result:=ImgIDProperty;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1631,10 +1659,12 @@ var
|
||||
NodeData: TObject;
|
||||
CurUnit: TCodeBrowserUnit;
|
||||
Node: TCodeBrowserNode;
|
||||
Line, Column: integer;
|
||||
begin
|
||||
Result:='';
|
||||
if (TVNode=nil) or (TVNode.Data=nil) then exit;
|
||||
NodeData:=TObject(TVNode.Data);
|
||||
//DebugLn(['TCodeBrowserView.GetTVNodeHint ',DbgSName(NodeData)]);
|
||||
if NodeData is TCodeBrowserUnitList then begin
|
||||
|
||||
end else if NodeData is TCodeBrowserUnit then begin
|
||||
@ -1643,8 +1673,11 @@ begin
|
||||
Result:=CurUnit.Filename;
|
||||
end else if NodeData is TCodeBrowserNode then begin
|
||||
Node:=TCodeBrowserNode(NodeData);
|
||||
if Node.Node<>nil then begin
|
||||
|
||||
if Node.CodePos.Code<>nil then begin
|
||||
Result:=Node.CodePos.Code.Filename;
|
||||
Node.CodePos.Code.AbsoluteToLineCol(Node.CodePos.P,Line,Column);
|
||||
if Line>0 then
|
||||
Result:=Result+' ('+IntToStr(Line)+','+IntToStr(Column)+')';
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1671,28 +1704,76 @@ procedure TCodeBrowserView.BrowseTreeViewShowHint(Sender: TObject;
|
||||
HintInfo: PHintInfo);
|
||||
var
|
||||
TVNode: TTreeNode;
|
||||
NodeData: TObject;
|
||||
HintStr: String;
|
||||
MousePos: TPoint;
|
||||
begin
|
||||
DebugLn(['TCodeBrowserView.BrowseTreeViewShowHint ']);
|
||||
TVNode:=BrowseTreeView.Selected;
|
||||
//DebugLn(['TCodeBrowserView.BrowseTreeViewShowHint ',dbgs(HintInfo^.CursorPos)]);
|
||||
HintStr:='';
|
||||
MousePos:=HintInfo^.CursorPos;
|
||||
TVNode:=BrowseTreeView.GetNodeAt(MousePos.X,MousePos.Y);
|
||||
if TVNode<>nil then begin
|
||||
NodeData:=TObject(TVNode.Data);
|
||||
if NodeData<>nil then begin
|
||||
HintStr:=GetTVNodeHint(TVNode);
|
||||
//DebugLn(['TCodeBrowserView.BrowseTreeViewShowHint HintStr="',HintStr,'"']);
|
||||
end;
|
||||
HintInfo^.HintStr:=HintStr;
|
||||
end;
|
||||
|
||||
procedure TCodeBrowserView.BrowseTreeViewMouseDown(Sender: TOBject;
|
||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
NodeData: TObject;
|
||||
Node: TCodeBrowserNode;
|
||||
CurUnit: TCodeBrowserUnit;
|
||||
Line, Column: integer;
|
||||
TVNode: TTreeNode;
|
||||
List: TCodeBrowserUnitList;
|
||||
APackage: TLazPackage;
|
||||
begin
|
||||
if ssDouble in Shift then begin
|
||||
TVNode:=BrowseTreeView.GetNodeAt(X,Y);
|
||||
if (TVNode=nil) or (TVNode.Data=nil) then exit;
|
||||
NodeData:=TObject(TVNode.Data);
|
||||
if NodeData is TCodeBrowserUnitList then begin
|
||||
List:=TCodeBrowserUnitList(NodeData);
|
||||
DebugLn(['TCodeBrowserView.BrowseTreeViewMouseDown "',List.Owner,'=',CodeBrowserProjectName,'"']);
|
||||
if List.Owner=CodeBrowserProjectName then begin
|
||||
// open project inspector
|
||||
DebugLn(['TCodeBrowserView.BrowseTreeViewMouseDown open project inspector']);
|
||||
ExecuteIDECommand(Self,ecProjectInspector);
|
||||
end else if List.Owner=CodeBrowserIDEName then begin
|
||||
// open the IDE -> already open
|
||||
end else if List.Owner=CodeBrowserHidden then begin
|
||||
// nothing
|
||||
end else begin
|
||||
// open package
|
||||
APackage:=PackageGraph.FindAPackageWithName(List.Owner,nil);
|
||||
if APackage<>nil then begin
|
||||
PackageEditingInterface.DoOpenPackageFile(APackage.Filename,[]);
|
||||
end;
|
||||
end;
|
||||
end else if NodeData is TCodeBrowserUnit then begin
|
||||
CurUnit:=TCodeBrowserUnit(NodeData);
|
||||
if CurUnit.Filename<>'' then begin
|
||||
LazarusIDE.DoOpenEditorFile(CurUnit.Filename,-1,[ofOnlyIfExists]);
|
||||
end;
|
||||
end else if NodeData is TCodeBrowserNode then begin
|
||||
Node:=TCodeBrowserNode(NodeData);
|
||||
if (Node.CodePos.Code<>nil)
|
||||
and (Node.CodePos.Code.Filename<>'') then begin
|
||||
Node.CodePos.Code.AbsoluteToLineCol(Node.CodePos.P,Line,Column);
|
||||
LazarusIDE.DoOpenFileAndJumpToPos(Node.CodePos.Code.Filename,
|
||||
Point(Column,Line),-1,-1,[ofOnlyIfExists]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// cancel
|
||||
HintInfo^.HintStr:='';
|
||||
end;
|
||||
|
||||
{ TCodeBrowserNode }
|
||||
|
||||
constructor TCodeBrowserNode.Create(TheUnit: TCodeBrowserUnit;
|
||||
TheNode: TCodeTreeNode; TheParent: TCodeBrowserNode;
|
||||
const TheDescription: string);
|
||||
TheParent: TCodeBrowserNode; const TheDescription: string);
|
||||
begin
|
||||
FCBUnit:=TheUnit;
|
||||
FNode:=TheNode;
|
||||
FParentNode:=TheParent;
|
||||
FDescription:=TheDescription;
|
||||
end;
|
||||
@ -1710,10 +1791,9 @@ begin
|
||||
FreeAndNil(FChildNodes);
|
||||
end;
|
||||
|
||||
function TCodeBrowserNode.AddNode(CTNode: TCodeTreeNode;
|
||||
const Description: string): TCodeBrowserNode;
|
||||
function TCodeBrowserNode.AddNode(const Description: string): TCodeBrowserNode;
|
||||
begin
|
||||
Result:=TCodeBrowserNode.Create(nil,CTNode,Self,Description);
|
||||
Result:=TCodeBrowserNode.Create(nil,Self,Description);
|
||||
if FChildNodes=nil then
|
||||
FChildNodes:=TAvgLvlTree.Create(@CompareNodeDescriptions);
|
||||
FChildNodes.Add(Result);
|
||||
@ -1766,10 +1846,9 @@ begin
|
||||
FreeAndNil(FChildNodes);
|
||||
end;
|
||||
|
||||
function TCodeBrowserUnit.AddNode(CTNode: TCodeTreeNode;
|
||||
const Description: string): TCodeBrowserNode;
|
||||
function TCodeBrowserUnit.AddNode(const Description: string): TCodeBrowserNode;
|
||||
begin
|
||||
Result:=TCodeBrowserNode.Create(Self,CTNode,nil,Description);
|
||||
Result:=TCodeBrowserNode.Create(Self,nil,Description);
|
||||
if FChildNodes=nil then
|
||||
FChildNodes:=TAvgLvlTree.Create(@CompareNodeDescriptions);
|
||||
FChildNodes.Add(Result);
|
||||
|
@ -2511,6 +2511,9 @@ begin
|
||||
ecViewForms:
|
||||
DoViewUnitsAndForms(true);
|
||||
|
||||
ecProjectInspector:
|
||||
DoShowProjectInspector;
|
||||
|
||||
ecConfigCustomComps:
|
||||
PkgBoss.ShowConfigureCustomComponents;
|
||||
|
||||
|
@ -1146,7 +1146,7 @@ begin
|
||||
Filename:=SetDirSeparators('$(LazarusDir)/lcl/');
|
||||
Version.SetValues(1,0,0,0);
|
||||
Author:='Lazarus';
|
||||
License:='LGPL-2';
|
||||
License:='modified LGPL-2';
|
||||
AutoInstall:=pitStatic;
|
||||
AutoUpdate:=pupManually;
|
||||
Description:=lisPkgSysTheLCLLazarusComponentLibraryContainsAllBase;
|
||||
@ -1159,39 +1159,9 @@ begin
|
||||
// add requirements
|
||||
AddRequiredDependency(FCLPackage.CreateDependencyWithOwner(Result));
|
||||
|
||||
// add registering units
|
||||
AddFile('menus.pp','Menus',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('buttons.pp','Buttons',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('stdctrls.pp','StdCtrls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('extctrls.pp','ExtCtrls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('comctrls.pp','ComCtrls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('maskedit.pp','MaskEdit',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('checklst.pas','CheckLst',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('forms.pp','Forms',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('graphics.pp','Graphics',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('grids.pas','Grids',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('controls.pp','Controls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('dialogs.pp','Dialogs',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('lazhelphtml.pas','LazHelpHTML',pftUnit,[],cpBase);
|
||||
AddFile('spin.pp','Spin',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('arrow.pp','Arrow',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('calendar.pp','Calendar',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('pairsplitter.pas','PairSplitter',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('extdlgs.pas','ExtDlgs',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('dbctrls.pp','DBCtrls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('dbgrids.pas','DBGrids',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('editbtn.pas','EditBtn',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('actnlist.pas','ActnList',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('stdactns.pas','StdActns',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('dbactns.pas','DBActns',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('filectrl.pp','FileCtrl',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('xmlpropstorage.pas','XMLPropStorage',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('inipropstorage.pas','IniPropStorage',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('chart.pp','Chart',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('colorbox.pas','ColorBox',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('buttonpanel.pas','ButtonPanel',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('lresources.pp','LResources',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('lclstrconsts.pas','LCLStrConsts',pftUnit,[],cpBase);
|
||||
// register files
|
||||
{$I pkgfileslcl.inc}
|
||||
|
||||
// increase priority by one, so that the LCL components are inserted to the
|
||||
// left in the palette
|
||||
for i:=0 to FileCount-1 do
|
||||
|
110
packager/pkgfileslcl.inc
Normal file
110
packager/pkgfileslcl.inc
Normal file
@ -0,0 +1,110 @@
|
||||
{%MainUnit packagesystem.pas}
|
||||
// automatically created by tools/update_pkgfileslcl_inc.sh
|
||||
AddFile('actnlist.pas','ActnList',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('alllclunits.pp','AllLCLUnits',pftUnit,[],cpBase);
|
||||
AddFile('arrow.pp','Arrow',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('asyncprocess.pp','AsyncProcess',pftUnit,[],cpBase);
|
||||
AddFile('avglvltree.pas','AvgLvlTree',pftUnit,[],cpBase);
|
||||
AddFile('buttonpanel.pas','ButtonPanel',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('buttons.pp','Buttons',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('calendar.pp','Calendar',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('chart.pp','Chart',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('checklst.pas','CheckLst',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('clipbrd.pp','Clipbrd',pftUnit,[],cpBase);
|
||||
AddFile('clistbox.pp','CListBox',pftUnit,[],cpBase);
|
||||
AddFile('colorbox.pas','ColorBox',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('comctrls.pp','ComCtrls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('commctrl.pp','CommCtrl',pftUnit,[],cpBase);
|
||||
AddFile('controls.pp','Controls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('customtimer.pas','CustomTimer',pftUnit,[],cpBase);
|
||||
AddFile('dbactns.pp','DBActns',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('dbctrls.pp','DbCtrls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('dbgrids.pas','DBGrids',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('defaulttranslator.pas','DefaultTranslator',pftUnit,[],cpBase);
|
||||
AddFile('dialogs.pp','Dialogs',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('dirsel.pas','DirSel',pftUnit,[],cpBase);
|
||||
AddFile('dynamicarray.pas','DynamicArray',pftUnit,[],cpBase);
|
||||
AddFile('dynhasharray.pp','DynHashArray',pftUnit,[],cpBase);
|
||||
AddFile('dynqueue.pas','DynQueue',pftUnit,[],cpBase);
|
||||
AddFile('editbtn.pas','EditBtn',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('extctrls.pp','ExtCtrls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('extdlgs.pas','ExtDlgs',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('extendedstrings.pas','ExtendedStrings',pftUnit,[],cpBase);
|
||||
AddFile('extgraphics.pas','extgraphics',pftUnit,[],cpBase);
|
||||
AddFile('filectrl.pp','FileCtrl',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('fileutil.pas','FileUtil',pftUnit,[],cpBase);
|
||||
AddFile('forms.pp','Forms',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('fpcadds.pas','FPCAdds',pftUnit,[],cpBase);
|
||||
AddFile('graphics.pp','Graphics',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('graphmath.pp','GraphMath',pftUnit,[],cpBase);
|
||||
AddFile('graphtype.pp','GraphType',pftUnit,[],cpBase);
|
||||
AddFile('grids.pas','Grids',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('helpintfs.pas','HelpIntfs',pftUnit,[],cpBase);
|
||||
AddFile('imglist.pp','ImgList',pftUnit,[],cpBase);
|
||||
AddFile('inipropstorage.pas','IniPropStorage',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('interfacebase.pp','InterfaceBase',pftUnit,[],cpBase);
|
||||
AddFile('intfgraphics.pas','IntfGraphics',pftUnit,[],cpBase);
|
||||
AddFile('lazconfigstorage.pas','LazConfigStorage',pftUnit,[],cpBase);
|
||||
AddFile('lazhelphtml.pas','LazHelpHTML',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('lazhelpintf.pas','LazHelpIntf',pftUnit,[],cpBase);
|
||||
AddFile('lazlinkedlist.pas','LazLinkedList',pftUnit,[],cpBase);
|
||||
AddFile('lclclasses.pp','LCLClasses',pftUnit,[],cpBase);
|
||||
AddFile('lclintf.pas','LCLIntf',pftUnit,[],cpBase);
|
||||
AddFile('lclmemmanager.pas','LCLMemManager',pftUnit,[],cpBase);
|
||||
AddFile('lclmessageglue.pas','LCLMessageGlue',pftUnit,[],cpBase);
|
||||
AddFile('lclproc.pas','LCLProc',pftUnit,[],cpBase);
|
||||
AddFile('lclrescache.pas','LCLResCache',pftUnit,[],cpBase);
|
||||
AddFile('lclstrconsts.pas','LCLStrConsts',pftUnit,[],cpBase);
|
||||
AddFile('lcltype.pp','LCLType',pftUnit,[],cpBase);
|
||||
AddFile('lconv.pas','LConv',pftUnit,[],cpBase);
|
||||
AddFile('ldockctrledit.pas','LDockCtrlEdit',pftUnit,[],cpBase);
|
||||
AddFile('ldockctrl.pas','LDockCtrl',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('ldocktree.pas','LDockTree',pftUnit,[],cpBase);
|
||||
AddFile('lmessages.pp','LMessages',pftUnit,[],cpBase);
|
||||
AddFile('lresources.pp','LResources',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('maps.pp','maps',pftUnit,[],cpBase);
|
||||
AddFile('maskedit.pp','MaskEdit',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('menus.pp','Menus',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('nonwin32/messages.pp','Messages',pftUnit,[],cpBase);
|
||||
AddFile('pairsplitter.pas','PairSplitter',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('postscriptcanvas.pas','PostscriptCanvas',pftUnit,[],cpBase);
|
||||
AddFile('postscriptprinter.pas','PostScriptPrinter',pftUnit,[],cpBase);
|
||||
AddFile('printers.pas','Printers',pftUnit,[],cpBase);
|
||||
AddFile('propertystorage.pas','PropertyStorage',pftUnit,[],cpBase);
|
||||
AddFile('spin.pp','Spin',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('stdactns.pas','StdActns',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('stdctrls.pp','StdCtrls',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
AddFile('stringhashlist.pas','StringHashList',pftUnit,[],cpBase);
|
||||
AddFile('textstrings.pas','TextStrings',pftUnit,[],cpBase);
|
||||
AddFile('toolwin.pp','Toolwin',pftUnit,[],cpBase);
|
||||
AddFile('translations.pas','Translations',pftUnit,[],cpBase);
|
||||
AddFile('utrace.pp','UTrace',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsactnlist.pp','WSActnList',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsarrow.pp','WSArrow',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsbuttons.pp','WSButtons',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wscalendar.pp','WSCalendar',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wschecklst.pp','WSCheckLst',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsclistbox.pp','WSCListBox',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wscomctrls.pp','WSComCtrls',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wscontrols.pp','WSControls',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsdbctrls.pp','WSDbCtrls',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsdbgrids.pp','WSDBGrids',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsdialogs.pp','WSDialogs',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsdirsel.pp','WSDirSel',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wseditbtn.pp','WSEditBtn',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsextctrls.pp','WSExtCtrls',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsextdlgs.pp','WSExtDlgs',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsfilectrl.pp','WSFileCtrl',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsforms.pp','WSForms',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsgrids.pp','WSGrids',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsimglist.pp','WSImgList',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wslclclasses.pp','WSLCLClasses',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsmaskedit.pp','WSMaskEdit',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsmenus.pp','WSMenus',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wspairsplitter.pp','WSPairSplitter',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsproc.pp','WSProc',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsspin.pp','WSSpin',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wsstdctrls.pp','WSStdCtrls',pftUnit,[],cpBase);
|
||||
AddFile('widgetset/wstoolwin.pp','WSToolwin',pftUnit,[],cpBase);
|
||||
AddFile('xmlpropstorage.pas','XMLPropStorage',pftUnit,[pffHasRegisterProc],cpBase);
|
||||
|
47
tools/update_pkgfileslcl_inc.sh
Executable file
47
tools/update_pkgfileslcl_inc.sh
Executable file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Author: Mattias Gaertner
|
||||
#
|
||||
# Abstract:
|
||||
# Updates the list of files of the LCL package:
|
||||
# lazarus/packager/pkgfileslcl.inc
|
||||
|
||||
#set -x
|
||||
set -e
|
||||
|
||||
# find the lazarus directory
|
||||
PrgPath=$0
|
||||
if [ "${PrgPath:0:1}" != "/" ]; then
|
||||
# path does not start with / => relative
|
||||
PrgPath=$(pwd)/$PrgPath
|
||||
fi
|
||||
LazarusDir=${PrgPath%/tools/*}/
|
||||
|
||||
OutputFile=$LazarusDir"packager/pkgfileslcl.inc"
|
||||
echo "{%MainUnit packagesystem.pas}" > $OutputFile
|
||||
echo "// automatically created by tools/update_pkgfileslcl_inc.sh" >> $OutputFile
|
||||
|
||||
# cd into the lcl directory
|
||||
cd $LazarusDir/lcl
|
||||
|
||||
# scan every LCL .pas/.pp file
|
||||
for file in $(ls -1 *.pp *.pas widgetset/*.pp nonwin32/*.pp); do
|
||||
echo $file
|
||||
# get unit name
|
||||
Unitname=$(egrep -i '^unit .*;' $file | sed -e 's/unit \+//I' -e 's/;.*//')
|
||||
if [ -n "$Unitname" ]; then
|
||||
# check if 'procedure Register;' exists
|
||||
Flags=""
|
||||
if [ -n "$(egrep -i 'procedure register;' $file)" ]; then
|
||||
Flags="pffHasRegisterProc"
|
||||
fi
|
||||
Line="AddFile('"$file"','"$Unitname"',pftUnit,["$Flags"],cpBase);"
|
||||
echo $Line >> $OutputFile
|
||||
fi
|
||||
done
|
||||
|
||||
echo "" >> $OutputFile
|
||||
|
||||
# end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user