mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-01 19:39:24 +01:00
IDE: TTreeFilterEdit: using TTFENodeData
git-svn-id: trunk@41912 -
This commit is contained in:
parent
35903c6be8
commit
a335aef877
@ -20,12 +20,12 @@ uses
|
|||||||
Controls, ComCtrls, EditBtn, LCLType, FileUtil, LazUTF8, AvgLvlTree, fgl;
|
Controls, ComCtrls, EditBtn, LCLType, FileUtil, LazUTF8, AvgLvlTree, fgl;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
TImageIndexEvent = function (Str: String; Data: TObject;
|
TImageIndexEvent = function (Str: String; Data: TObject;
|
||||||
var AIsEnabled: Boolean): Integer of object;
|
var AIsEnabled: Boolean): Integer of object;
|
||||||
|
|
||||||
|
TTreeNodeList = specialize TFPGList<Pointer>;
|
||||||
|
|
||||||
TTreeFilterEdit = class;
|
TTreeFilterEdit = class;
|
||||||
TTreeNodeList = specialize TFPGList<TTreeNode>;
|
|
||||||
|
|
||||||
{ TTreeFilterBranch }
|
{ TTreeFilterBranch }
|
||||||
|
|
||||||
@ -45,7 +45,6 @@ type
|
|||||||
function CompareFNs(AFilename1,AFilename2: string): integer;
|
function CompareFNs(AFilename1,AFilename2: string): integer;
|
||||||
procedure SortAndFilter;
|
procedure SortAndFilter;
|
||||||
procedure ApplyFilter;
|
procedure ApplyFilter;
|
||||||
procedure FreeTVNodeData(Node: TTreeNode);
|
|
||||||
procedure TVDeleteUnneededNodes(p: integer);
|
procedure TVDeleteUnneededNodes(p: integer);
|
||||||
procedure TVClearUnneededAndCreateHierachy(Filename: string);
|
procedure TVClearUnneededAndCreateHierachy(Filename: string);
|
||||||
public
|
public
|
||||||
@ -99,9 +98,16 @@ type
|
|||||||
property OnGetImageIndex: TImageIndexEvent read fOnGetImageIndex write fOnGetImageIndex;
|
property OnGetImageIndex: TImageIndexEvent read fOnGetImageIndex write fOnGetImageIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TTFENodeData - TreeFilterEditNodeData }
|
||||||
|
|
||||||
|
TTFENodeData = class
|
||||||
|
public
|
||||||
|
Node : TObject;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TFileNameItem }
|
{ TFileNameItem }
|
||||||
|
|
||||||
TFileNameItem = class
|
TFileNameItem = class(TTFENodeData)
|
||||||
public
|
public
|
||||||
Data: Pointer;
|
Data: Pointer;
|
||||||
Filename: string;
|
Filename: string;
|
||||||
@ -141,7 +147,6 @@ begin
|
|||||||
FreeAndNil(fNodeTextToDataMap);
|
FreeAndNil(fNodeTextToDataMap);
|
||||||
FreeAndNil(fSortedData);
|
FreeAndNil(fSortedData);
|
||||||
FreeAndNil(fOriginalData);
|
FreeAndNil(fOriginalData);
|
||||||
FreeTVNodeData(fRootNode);
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -197,9 +202,8 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
FileN, s: string;
|
FileN, s: string;
|
||||||
ena: Boolean;
|
ena: Boolean;
|
||||||
|
AObject : TObject;
|
||||||
begin
|
begin
|
||||||
if fNodeTextToFullFilenameMap.Count > 0 then // FilenameMap stores short filename -> long filename
|
|
||||||
FreeTVNodeData(fRootNode); // Free node data now, it will be filled later.
|
|
||||||
if Assigned(fRootNode) then
|
if Assigned(fRootNode) then
|
||||||
fRootNode.DeleteChildren // Delete old tree nodes.
|
fRootNode.DeleteChildren // Delete old tree nodes.
|
||||||
else
|
else
|
||||||
@ -210,49 +214,35 @@ begin
|
|||||||
FileN:=fSortedData[i];
|
FileN:=fSortedData[i];
|
||||||
if fOwner.ShowDirHierarchy then begin
|
if fOwner.ShowDirHierarchy then begin
|
||||||
TVClearUnneededAndCreateHierachy(FileN);
|
TVClearUnneededAndCreateHierachy(FileN);
|
||||||
TVNode:=fTVNodeStack[fTVNodeStack.Count-1];
|
TVNode:=TTreeNode(fTVNodeStack[fTVNodeStack.Count-1]);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
TVNode:=fOwner.fFilteredTreeview.Items.AddChild(fRootNode,FileN);
|
TVNode:=fOwner.fFilteredTreeview.Items.AddChild(fRootNode,FileN);
|
||||||
// Save the long filename to Node.Data
|
// Save the long filename to Node.Data
|
||||||
|
AObject := TObject(fNodeTextToDataMap[FileN]);
|
||||||
|
if AObject.InheritsFrom(TTFENodeData) then
|
||||||
|
TTFENodeData(AObject).Node := TVNode;
|
||||||
if fNodeTextToFullFilenameMap.Count > 0 then begin
|
if fNodeTextToFullFilenameMap.Count > 0 then begin
|
||||||
s:=FileN;
|
s:=FileN;
|
||||||
if fNodeTextToFullFilenameMap.Contains(FileN) then
|
if fNodeTextToFullFilenameMap.Contains(FileN) then
|
||||||
s:=fNodeTextToFullFilenameMap[FileN]; // Full file name.
|
s:=fNodeTextToFullFilenameMap[FileN]; // Full file name.
|
||||||
TVNode.Data:=TFileNameItem.Create(s,fNodeTextToDataMap[FileN]);
|
AObject := TFileNameItem.Create(s, AObject);
|
||||||
|
TTFENodeData(AObject).Node := TVNode;
|
||||||
end;
|
end;
|
||||||
|
TVNode.Data:=AObject;
|
||||||
// Get ImageIndex for Node
|
// Get ImageIndex for Node
|
||||||
ena := True;
|
ena := True;
|
||||||
if Assigned(fOwner.OnGetImageIndex) then
|
if Assigned(fOwner.OnGetImageIndex) then
|
||||||
fImgIndex:=fOwner.OnGetImageIndex(FileN, fSortedData.Objects[i], ena);
|
fImgIndex:=fOwner.OnGetImageIndex(FileN, fSortedData.Objects[i], ena);
|
||||||
TVNode.ImageIndex:=fImgIndex;
|
TVNode.ImageIndex:=fImgIndex;
|
||||||
TVNode.SelectedIndex:=fImgIndex;
|
TVNode.SelectedIndex:=fImgIndex;
|
||||||
// if Assigned(fSelectedPart) then
|
|
||||||
// TVNode.Selected:=fSelectedPart=fSortedData.Objects[i];
|
|
||||||
end;
|
end;
|
||||||
if fOwner.ShowDirHierarchy then // TVDeleteUnneededNodes(0); ?
|
if fOwner.ShowDirHierarchy then
|
||||||
fTVNodeStack.Free;
|
fTVNodeStack.Free;
|
||||||
if Assigned(fRootNode) then
|
if Assigned(fRootNode) then
|
||||||
fRootNode.Expanded:=True;
|
fRootNode.Expanded:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTreeFilterBranch.FreeTVNodeData(Node: TTreeNode);
|
|
||||||
var
|
|
||||||
Child: TTreeNode;
|
|
||||||
begin
|
|
||||||
if Node=nil then exit;
|
|
||||||
if (Node.Data<>nil) then begin
|
|
||||||
TObject(Node.Data).Free;
|
|
||||||
Node.Data:=nil;
|
|
||||||
end;
|
|
||||||
Child:=Node.GetFirstChild;
|
|
||||||
while Child<>nil do
|
|
||||||
begin
|
|
||||||
FreeTVNodeData(Child); // Recursive call.
|
|
||||||
Child:=Child.GetNextSibling;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TTreeFilterBranch.TVDeleteUnneededNodes(p: integer);
|
procedure TTreeFilterBranch.TVDeleteUnneededNodes(p: integer);
|
||||||
// delete all nodes behind the nodes in the stack, and depth>=p
|
// delete all nodes behind the nodes in the stack, and depth>=p
|
||||||
var
|
var
|
||||||
@ -260,7 +250,7 @@ var
|
|||||||
Node: TTreeNode;
|
Node: TTreeNode;
|
||||||
begin
|
begin
|
||||||
for i:=fTVNodeStack.Count-1 downto p do begin
|
for i:=fTVNodeStack.Count-1 downto p do begin
|
||||||
Node:=fTVNodeStack[i];
|
Node:=TTreeNode(fTVNodeStack[i]);
|
||||||
while Node.GetNextSibling<>nil do
|
while Node.GetNextSibling<>nil do
|
||||||
Node.GetNextSibling.Free;
|
Node.GetNextSibling.Free;
|
||||||
end;
|
end;
|
||||||
@ -288,7 +278,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
//debugln(['ClearUnneededAndCreateHierachy FilePart=',FilePart,' Filename=',Filename,' p=',p]);
|
//debugln(['ClearUnneededAndCreateHierachy FilePart=',FilePart,' Filename=',Filename,' p=',p]);
|
||||||
if p < fTVNodeStack.Count then begin
|
if p < fTVNodeStack.Count then begin
|
||||||
Node:=fTVNodeStack[p];
|
Node:=TTreeNode(fTVNodeStack[p]);
|
||||||
if (FilePart=Node.Text) and (Node.Data=nil) then begin
|
if (FilePart=Node.Text) and (Node.Data=nil) then begin
|
||||||
// same sub directory
|
// same sub directory
|
||||||
end
|
end
|
||||||
@ -309,7 +299,7 @@ begin
|
|||||||
Assert(p=fTVNodeStack.Count, Format('TVClearUnneededAndCreateHierachy: p (%d) > fTVNodeStack.Count (%d).',
|
Assert(p=fTVNodeStack.Count, Format('TVClearUnneededAndCreateHierachy: p (%d) > fTVNodeStack.Count (%d).',
|
||||||
[p, fTVNodeStack.Count]));
|
[p, fTVNodeStack.Count]));
|
||||||
if p>0 then
|
if p>0 then
|
||||||
Node:=fTVNodeStack[p-1]
|
Node:=TTreeNode(fTVNodeStack[p-1])
|
||||||
else
|
else
|
||||||
Node:=fRootNode;
|
Node:=fRootNode;
|
||||||
Assert(Assigned(Node), Format('TVClearUnneededAndCreateHierachy: Node=nil, p=%d', [p]));
|
Assert(Assigned(Node), Format('TVClearUnneededAndCreateHierachy: Node=nil, p=%d', [p]));
|
||||||
|
|||||||
@ -23,7 +23,6 @@ object ProjectInspectorForm: TProjectInspectorForm
|
|||||||
RightClickSelect = True
|
RightClickSelect = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnDblClick = ItemsTreeViewDblClick
|
OnDblClick = ItemsTreeViewDblClick
|
||||||
OnGetImageIndex = ItemsTreeViewGetImageIndex
|
|
||||||
OnKeyDown = ItemsTreeViewKeyDown
|
OnKeyDown = ItemsTreeViewKeyDown
|
||||||
OnSelectionChanged = ItemsTreeViewSelectionChanged
|
OnSelectionChanged = ItemsTreeViewSelectionChanged
|
||||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
||||||
@ -50,7 +49,6 @@ object ProjectInspectorForm: TProjectInspectorForm
|
|||||||
AutoSize = True
|
AutoSize = True
|
||||||
Constraints.MinHeight = 25
|
Constraints.MinHeight = 25
|
||||||
Constraints.MinWidth = 25
|
Constraints.MinWidth = 25
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = OpenButtonClick
|
OnClick = OpenButtonClick
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@ -70,7 +68,6 @@ object ProjectInspectorForm: TProjectInspectorForm
|
|||||||
Constraints.MinHeight = 25
|
Constraints.MinHeight = 25
|
||||||
Constraints.MinWidth = 25
|
Constraints.MinWidth = 25
|
||||||
GroupIndex = 1
|
GroupIndex = 1
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = DirectoryHierarchyButtonClick
|
OnClick = DirectoryHierarchyButtonClick
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@ -90,7 +87,6 @@ object ProjectInspectorForm: TProjectInspectorForm
|
|||||||
Constraints.MinHeight = 25
|
Constraints.MinHeight = 25
|
||||||
Constraints.MinWidth = 25
|
Constraints.MinWidth = 25
|
||||||
GroupIndex = 2
|
GroupIndex = 2
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = SortAlphabeticallyButtonClick
|
OnClick = SortAlphabeticallyButtonClick
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@ -101,12 +97,12 @@ object ProjectInspectorForm: TProjectInspectorForm
|
|||||||
AnchorSideTop.Control = SortAlphabeticallyButton
|
AnchorSideTop.Control = SortAlphabeticallyButton
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 91
|
Left = 91
|
||||||
Height = 22
|
Height = 21
|
||||||
Top = 3
|
Top = 4
|
||||||
Width = 311
|
Width = 311
|
||||||
UseFormActivate = True
|
UseFormActivate = True
|
||||||
ButtonWidth = 23
|
ButtonWidth = 23
|
||||||
NumGlyphs = 0
|
NumGlyphs = 1
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 3
|
BorderSpacing.Left = 3
|
||||||
Font.Color = clBtnShadow
|
Font.Color = clBtnShadow
|
||||||
|
|||||||
@ -82,6 +82,17 @@ type
|
|||||||
);
|
);
|
||||||
TProjectInspectorFlags = set of TProjectInspectorFlag;
|
TProjectInspectorFlags = set of TProjectInspectorFlag;
|
||||||
|
|
||||||
|
TProjectNodeType = (pntFile, pntDependency);
|
||||||
|
|
||||||
|
TProjectNodeData = class(TTFENodeData)
|
||||||
|
public
|
||||||
|
Typ: TProjectNodeType;
|
||||||
|
Name: string; // file or package name
|
||||||
|
Data : TObject;
|
||||||
|
Removed : Boolean;
|
||||||
|
Next : TProjectNodeData;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TProjectInspectorForm }
|
{ TProjectInspectorForm }
|
||||||
|
|
||||||
TProjectInspectorForm = class(TForm)
|
TProjectInspectorForm = class(TForm)
|
||||||
@ -103,7 +114,6 @@ type
|
|||||||
procedure DirectoryHierarchyButtonClick(Sender: TObject);
|
procedure DirectoryHierarchyButtonClick(Sender: TObject);
|
||||||
procedure ItemsPopupMenuPopup(Sender: TObject);
|
procedure ItemsPopupMenuPopup(Sender: TObject);
|
||||||
procedure ItemsTreeViewDblClick(Sender: TObject);
|
procedure ItemsTreeViewDblClick(Sender: TObject);
|
||||||
procedure ItemsTreeViewGetImageIndex(Sender: TObject; Node: TTreeNode);
|
|
||||||
procedure ItemsTreeViewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure ItemsTreeViewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure ItemsTreeViewSelectionChanged(Sender: TObject);
|
procedure ItemsTreeViewSelectionChanged(Sender: TObject);
|
||||||
procedure MoveDependencyUpClick(Sender: TObject);
|
procedure MoveDependencyUpClick(Sender: TObject);
|
||||||
@ -148,6 +158,9 @@ type
|
|||||||
ImageIndexBinary: integer;
|
ImageIndexBinary: integer;
|
||||||
ImageIndexDirectory: integer;
|
ImageIndexDirectory: integer;
|
||||||
FFlags: TProjectInspectorFlags;
|
FFlags: TProjectInspectorFlags;
|
||||||
|
FProjectNodeDataList : array [TProjectNodeType] of TProjectNodeData;
|
||||||
|
procedure FreeNodeData(Typ: TProjectNodeType);
|
||||||
|
function CreateNodeData(Typ: TProjectNodeType; aName: string; aRemoved: boolean): TProjectNodeData;
|
||||||
procedure SetDependencyDefaultFilename(AsPreferred: boolean);
|
procedure SetDependencyDefaultFilename(AsPreferred: boolean);
|
||||||
procedure SetIdleConnected(const AValue: boolean);
|
procedure SetIdleConnected(const AValue: boolean);
|
||||||
procedure SetLazProject(const AValue: TProject);
|
procedure SetLazProject(const AValue: TProject);
|
||||||
@ -193,7 +206,7 @@ type
|
|||||||
property ShowDirectoryHierarchy: boolean read FShowDirectoryHierarchy write SetShowDirectoryHierarchy;
|
property ShowDirectoryHierarchy: boolean read FShowDirectoryHierarchy write SetShowDirectoryHierarchy;
|
||||||
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
ProjInspector: TProjectInspectorForm = nil;
|
ProjInspector: TProjectInspectorForm = nil;
|
||||||
|
|
||||||
@ -213,11 +226,6 @@ begin
|
|||||||
OpenButtonClick(Self);
|
OpenButtonClick(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TProjectInspectorForm.ItemsTreeViewGetImageIndex(Sender: TObject; Node: TTreeNode);
|
|
||||||
begin
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TProjectInspectorForm.ItemsTreeViewKeyDown(Sender: TObject;
|
procedure TProjectInspectorForm.ItemsTreeViewKeyDown(Sender: TObject;
|
||||||
var Key: Word; Shift: TShiftState);
|
var Key: Word; Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
@ -628,19 +636,29 @@ end;
|
|||||||
|
|
||||||
function TProjectInspectorForm.ChooseImageIndex(Str: String; Data: TObject;
|
function TProjectInspectorForm.ChooseImageIndex(Str: String; Data: TObject;
|
||||||
var AIsEnabled: Boolean): Integer;
|
var AIsEnabled: Boolean): Integer;
|
||||||
|
Var
|
||||||
|
ANodeData : TProjectNodeData;
|
||||||
|
AObject : TObject;
|
||||||
begin
|
begin
|
||||||
if Data is TUnitInfo then begin
|
Result := -1;
|
||||||
if FilenameIsPascalUnit(TUnitInfo(Data).Filename) then
|
AObject := NIL;
|
||||||
|
ANodeData := TProjectNodeData(Data);
|
||||||
|
If Assigned(ANodeData) Then
|
||||||
|
AObject := ANodeData.Data;
|
||||||
|
if Not Assigned(AObject) Then
|
||||||
|
Exit;
|
||||||
|
if AObject is TUnitInfo then begin
|
||||||
|
if FilenameIsPascalUnit(TUnitInfo(AObject).Filename) then
|
||||||
Result:=ImageIndexUnit
|
Result:=ImageIndexUnit
|
||||||
else if (LazProject<>nil) and (LazProject.MainUnitinfo=Data) then
|
else if (LazProject<>nil) and (LazProject.MainUnitinfo=Data) then
|
||||||
Result:=ImageIndexProject
|
Result:=ImageIndexProject
|
||||||
else
|
else
|
||||||
Result:=ImageIndexText;
|
Result:=ImageIndexText;
|
||||||
end
|
end
|
||||||
else if Data is TPkgDependency then begin
|
else if AObject is TPkgDependency then begin
|
||||||
if TPkgDependency(Data).Removed then
|
if TPkgDependency(AObject).Removed then
|
||||||
Result:=ImageIndexRemovedRequired
|
Result:=ImageIndexRemovedRequired
|
||||||
else if TPkgDependency(Data).LoadPackageResult=lprSuccess then
|
else if TPkgDependency(AObject).LoadPackageResult=lprSuccess then
|
||||||
Result:=ImageIndexRequired
|
Result:=ImageIndexRequired
|
||||||
else
|
else
|
||||||
Result:=ImageIndexConflict;
|
Result:=ImageIndexConflict;
|
||||||
@ -652,7 +670,10 @@ var
|
|||||||
CurFile: TUnitInfo;
|
CurFile: TUnitInfo;
|
||||||
FilesBranch: TTreeFilterBranch;
|
FilesBranch: TTreeFilterBranch;
|
||||||
Filename: String;
|
Filename: String;
|
||||||
|
ANodeData : TProjectNodeData;
|
||||||
begin
|
begin
|
||||||
|
FreeNodeData(pntFile);
|
||||||
|
|
||||||
ItemsTreeView.BeginUpdate;
|
ItemsTreeView.BeginUpdate;
|
||||||
try
|
try
|
||||||
FilesBranch:=FilterEdit.GetBranch(FFilesNode);
|
FilesBranch:=FilterEdit.GetBranch(FFilesNode);
|
||||||
@ -665,8 +686,11 @@ begin
|
|||||||
CurFile:=LazProject.FirstPartOfProject;
|
CurFile:=LazProject.FirstPartOfProject;
|
||||||
while CurFile<>nil do begin
|
while CurFile<>nil do begin
|
||||||
Filename:=CurFile.GetShortFilename(true);
|
Filename:=CurFile.GetShortFilename(true);
|
||||||
if Filename<>'' then
|
if Filename<>'' then Begin
|
||||||
FilesBranch.AddNodeData(Filename, CurFile, CurFile.Filename);
|
ANodeData := CreateNodeData(pntFile, FileName, False);
|
||||||
|
ANodeData.Data := CurFile;
|
||||||
|
FilesBranch.AddNodeData(Filename, ANodeData, CurFile.Filename);
|
||||||
|
end;
|
||||||
CurFile:=CurFile.NextPartOfProject;
|
CurFile:=CurFile.NextPartOfProject;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -681,7 +705,10 @@ var
|
|||||||
Dependency: TPkgDependency;
|
Dependency: TPkgDependency;
|
||||||
RequiredBranch, RemovedBranch: TTreeFilterBranch;
|
RequiredBranch, RemovedBranch: TTreeFilterBranch;
|
||||||
NodeText, AFilename: String;
|
NodeText, AFilename: String;
|
||||||
|
ANodeData : TProjectNodeData;
|
||||||
begin
|
begin
|
||||||
|
FreeNodeData(pntDependency);
|
||||||
|
|
||||||
ItemsTreeView.BeginUpdate;
|
ItemsTreeView.BeginUpdate;
|
||||||
try
|
try
|
||||||
RequiredBranch:=FilterEdit.GetBranch(DependenciesNode);
|
RequiredBranch:=FilterEdit.GetBranch(DependenciesNode);
|
||||||
@ -700,7 +727,9 @@ begin
|
|||||||
NodeText:=Format(lisPckEditDefault, [NodeText, AFilename]);
|
NodeText:=Format(lisPckEditDefault, [NodeText, AFilename]);
|
||||||
end;
|
end;
|
||||||
// Add the required package under the branch
|
// Add the required package under the branch
|
||||||
RequiredBranch.AddNodeData(NodeText, Dependency);
|
ANodeData := CreateNodeData(pntDependency, NodeText, False);
|
||||||
|
ANodeData.Data := Dependency;
|
||||||
|
RequiredBranch.AddNodeData(NodeText, ANodeData);
|
||||||
Dependency:=Dependency.NextRequiresDependency;
|
Dependency:=Dependency.NextRequiresDependency;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -717,7 +746,9 @@ begin
|
|||||||
RemovedBranch:=FilterEdit.GetBranch(RemovedDependenciesNode);
|
RemovedBranch:=FilterEdit.GetBranch(RemovedDependenciesNode);
|
||||||
// Add all removed dependencies under the branch
|
// Add all removed dependencies under the branch
|
||||||
while Dependency<>nil do begin
|
while Dependency<>nil do begin
|
||||||
RemovedBranch.AddNodeData(Dependency.AsString, Dependency);
|
ANodeData := CreateNodeData(pntDependency, Dependency.AsString, True);
|
||||||
|
ANodeData.Data := Dependency;
|
||||||
|
RemovedBranch.AddNodeData(Dependency.AsString, ANodeData);
|
||||||
Dependency:=Dependency.NextRequiresDependency;
|
Dependency:=Dependency.NextRequiresDependency;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -793,15 +824,21 @@ function TProjectInspectorForm.GetSelectedFile: TUnitInfo;
|
|||||||
var
|
var
|
||||||
CurNode: TTreeNode;
|
CurNode: TTreeNode;
|
||||||
Item: TFileNameItem;
|
Item: TFileNameItem;
|
||||||
|
ADataNode : TProjectNodeData;
|
||||||
|
AObject : TObject;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
|
AObject := NIL;
|
||||||
if LazProject=nil then exit;
|
if LazProject=nil then exit;
|
||||||
CurNode:=ItemsTreeView.Selected;
|
CurNode:=ItemsTreeView.Selected;
|
||||||
if (CurNode=nil) then exit;
|
if (CurNode=nil) then exit;
|
||||||
//debugln(['TProjectInspectorForm.GetCurrentFile ',DbgSName(TObject(CurNode.Data)),' ',CurNode.Text]);
|
//debugln(['TProjectInspectorForm.GetCurrentFile ',DbgSName(TObject(CurNode.Data)),' ',CurNode.Text]);
|
||||||
if TObject(CurNode.Data) is TFileNameItem then
|
ADataNode := TProjectNodeData(CurNode.Data);
|
||||||
|
If Assigned(ADataNode) Then
|
||||||
|
AObject := ADataNode;
|
||||||
|
if Assigned(AObject) And (AObject is TFileNameItem) then
|
||||||
begin
|
begin
|
||||||
Item:=TFileNameItem(CurNode.Data);
|
Item:=TFileNameItem(AObject);
|
||||||
//debugln(['TProjectInspectorForm.GetCurrentFile Item=',Item.Filename,' ',Item.IsDirectory]);
|
//debugln(['TProjectInspectorForm.GetCurrentFile Item=',Item.Filename,' ',Item.IsDirectory]);
|
||||||
Result:=LazProject.UnitInfoWithFilename(Item.Filename);
|
Result:=LazProject.UnitInfoWithFilename(Item.Filename);
|
||||||
end;
|
end;
|
||||||
@ -812,8 +849,10 @@ var
|
|||||||
CurNode: TTreeNode;
|
CurNode: TTreeNode;
|
||||||
Branch: TTreeFilterBranch;
|
Branch: TTreeFilterBranch;
|
||||||
AnObject: TObject;
|
AnObject: TObject;
|
||||||
|
ADataNode : TProjectNodeData;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
|
AnObject := Nil;
|
||||||
if LazProject=nil then exit;
|
if LazProject=nil then exit;
|
||||||
CurNode:=ItemsTreeView.Selected;
|
CurNode:=ItemsTreeView.Selected;
|
||||||
if Assigned(CurNode) and Assigned(CurNode.Parent)
|
if Assigned(CurNode) and Assigned(CurNode.Parent)
|
||||||
@ -821,7 +860,9 @@ begin
|
|||||||
then begin
|
then begin
|
||||||
Branch:=FilterEdit.GetExistingBranch(CurNode.Parent);
|
Branch:=FilterEdit.GetExistingBranch(CurNode.Parent);
|
||||||
Assert(Assigned(Branch));
|
Assert(Assigned(Branch));
|
||||||
AnObject := Branch.GetData(CurNode.Index);
|
ADataNode := TProjectNodeData(Branch.GetData(CurNode.Index));
|
||||||
|
If Assigned(ADataNode) Then
|
||||||
|
AnObject := ADataNode.Data;
|
||||||
if (AnObject <> nil) and (AnObject is TPkgDependency) then
|
if (AnObject <> nil) and (AnObject is TPkgDependency) then
|
||||||
Result := TPkgDependency(AnObject);
|
Result := TPkgDependency(AnObject);
|
||||||
end;
|
end;
|
||||||
@ -840,9 +881,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TProjectInspectorForm.Destroy;
|
destructor TProjectInspectorForm.Destroy;
|
||||||
|
var
|
||||||
|
nt: TProjectNodeType;
|
||||||
begin
|
begin
|
||||||
IdleConnected:=false;
|
IdleConnected:=false;
|
||||||
LazProject:=nil;
|
LazProject:=nil;
|
||||||
|
for nt:=Low(TProjectNodeType) to High(TProjectNodeType) do
|
||||||
|
FreeNodeData(nt);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
if ProjInspector=Self then
|
if ProjInspector=Self then
|
||||||
ProjInspector:=nil;
|
ProjInspector:=nil;
|
||||||
@ -942,5 +987,40 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TProjectInspectorForm.FreeNodeData(Typ: TProjectNodeType);
|
||||||
|
var
|
||||||
|
NodeData,
|
||||||
|
n: TProjectNodeData;
|
||||||
|
AObject : TObject;
|
||||||
|
ANode : TTreeNode;
|
||||||
|
begin
|
||||||
|
NodeData:=FProjectNodeDataList[Typ];
|
||||||
|
while NodeData<>nil do begin
|
||||||
|
n:=NodeData;
|
||||||
|
NodeData:=NodeData.Next;
|
||||||
|
If Assigned(n.Node) Then Begin
|
||||||
|
ANode := TTreeNode(n.Node);
|
||||||
|
If Assigned(ANode.Data) Then Begin
|
||||||
|
AObject := TObject(ANode.Data);
|
||||||
|
If AObject is TFileNameItem Then
|
||||||
|
AObject.Free;
|
||||||
|
end;
|
||||||
|
ANode.Data := NIL;
|
||||||
|
end;
|
||||||
|
n.Free;
|
||||||
|
end;
|
||||||
|
FProjectNodeDataList[Typ]:=nil;
|
||||||
|
End;
|
||||||
|
|
||||||
|
function TProjectInspectorForm.CreateNodeData(Typ: TProjectNodeType; aName: string; aRemoved: boolean): TProjectNodeData;
|
||||||
|
Begin
|
||||||
|
Result := TProjectNodeData.Create;
|
||||||
|
Result.Name := aName;
|
||||||
|
Result.Typ := Typ;
|
||||||
|
Result.Removed := aRemoved;
|
||||||
|
Result.Next := FProjectNodeDataList[Typ];
|
||||||
|
FProjectNodeDataList[Typ] := Result;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
inherited PackageEditorForm: TPackageEditorForm
|
object PackageEditorForm: TPackageEditorForm
|
||||||
Left = 338
|
Left = 338
|
||||||
Height = 455
|
Height = 455
|
||||||
Top = 533
|
Top = 533
|
||||||
@ -12,7 +12,8 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
OnClose = PackageEditorFormClose
|
OnClose = PackageEditorFormClose
|
||||||
OnCloseQuery = PackageEditorFormCloseQuery
|
OnCloseQuery = PackageEditorFormCloseQuery
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
object ToolBar: TToolBar[0]
|
LCLVersion = '1.1'
|
||||||
|
object ToolBar: TToolBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 48
|
Height = 48
|
||||||
Top = 0
|
Top = 0
|
||||||
@ -22,10 +23,10 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
ShowCaptions = True
|
ShowCaptions = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object FilePropsGroupBox: TGroupBox[1]
|
object FilePropsGroupBox: TGroupBox
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 118
|
Height = 118
|
||||||
Top = 315
|
Top = 317
|
||||||
Width = 464
|
Width = 464
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Caption = 'FilePropsGroupBox'
|
Caption = 'FilePropsGroupBox'
|
||||||
@ -34,9 +35,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
object CallRegisterProcCheckBox: TCheckBox
|
object CallRegisterProcCheckBox: TCheckBox
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 20
|
Height = 17
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 173
|
Width = 145
|
||||||
Caption = 'CallRegisterProcCheckBox'
|
Caption = 'CallRegisterProcCheckBox'
|
||||||
OnChange = CallRegisterProcCheckBoxChange
|
OnChange = CallRegisterProcCheckBoxChange
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@ -46,10 +47,10 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
object AddToUsesPkgSectionCheckBox: TCheckBox
|
object AddToUsesPkgSectionCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = CallRegisterProcCheckBox
|
AnchorSideLeft.Control = CallRegisterProcCheckBox
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
Left = 183
|
Left = 155
|
||||||
Height = 20
|
Height = 17
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 202
|
Width = 173
|
||||||
BorderSpacing.Left = 10
|
BorderSpacing.Left = 10
|
||||||
Caption = 'AddToUsesPkgSectionCheckBox'
|
Caption = 'AddToUsesPkgSectionCheckBox'
|
||||||
OnChange = AddToUsesPkgSectionCheckBoxChange
|
OnChange = AddToUsesPkgSectionCheckBoxChange
|
||||||
@ -62,9 +63,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
AnchorSideTop.Control = MinVersionEdit
|
AnchorSideTop.Control = MinVersionEdit
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 20
|
Height = 17
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 162
|
Width = 136
|
||||||
Caption = 'UseMinVersionCheckBox'
|
Caption = 'UseMinVersionCheckBox'
|
||||||
OnChange = UseMinVersionCheckBoxChange
|
OnChange = UseMinVersionCheckBoxChange
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
@ -73,8 +74,8 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
AnchorSideLeft.Control = UseMinVersionCheckBox
|
AnchorSideLeft.Control = UseMinVersionCheckBox
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = FilePropsGroupBox
|
AnchorSideTop.Control = FilePropsGroupBox
|
||||||
Left = 172
|
Left = 146
|
||||||
Height = 24
|
Height = 21
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 100
|
Width = 100
|
||||||
BorderSpacing.Left = 10
|
BorderSpacing.Left = 10
|
||||||
@ -87,9 +88,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
AnchorSideTop.Control = MaxVersionEdit
|
AnchorSideTop.Control = MaxVersionEdit
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 20
|
Height = 17
|
||||||
Top = 28
|
Top = 25
|
||||||
Width = 166
|
Width = 140
|
||||||
Caption = 'UseMaxVersionCheckBox'
|
Caption = 'UseMaxVersionCheckBox'
|
||||||
OnChange = UseMaxVersionCheckBoxChange
|
OnChange = UseMaxVersionCheckBoxChange
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
@ -99,9 +100,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = MinVersionEdit
|
AnchorSideTop.Control = MinVersionEdit
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 176
|
Left = 150
|
||||||
Height = 24
|
Height = 21
|
||||||
Top = 26
|
Top = 23
|
||||||
Width = 100
|
Width = 100
|
||||||
BorderSpacing.Left = 10
|
BorderSpacing.Left = 10
|
||||||
BorderSpacing.Top = 2
|
BorderSpacing.Top = 2
|
||||||
@ -114,9 +115,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
AnchorSideTop.Control = MaxVersionEdit
|
AnchorSideTop.Control = MaxVersionEdit
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 24
|
Height = 23
|
||||||
Top = 56
|
Top = 50
|
||||||
Width = 153
|
Width = 145
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Caption = 'ApplyDependencyButton'
|
Caption = 'ApplyDependencyButton'
|
||||||
@ -127,19 +128,19 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
AnchorSideTop.Control = CallRegisterProcCheckBox
|
AnchorSideTop.Control = CallRegisterProcCheckBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 74
|
Height = 77
|
||||||
Top = 26
|
Top = 23
|
||||||
Width = 460
|
Width = 460
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Caption = 'RegisteredPluginsGroupBox'
|
Caption = 'RegisteredPluginsGroupBox'
|
||||||
ClientHeight = 56
|
ClientHeight = 59
|
||||||
ClientWidth = 456
|
ClientWidth = 456
|
||||||
TabOrder = 7
|
TabOrder = 7
|
||||||
object RegisteredListBox: TListBox
|
object RegisteredListBox: TListBox
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 56
|
Height = 59
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 456
|
Width = 456
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@ -153,10 +154,10 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
AnchorSideLeft.Control = AddToUsesPkgSectionCheckBox
|
AnchorSideLeft.Control = AddToUsesPkgSectionCheckBox
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = AddToUsesPkgSectionCheckBox
|
AnchorSideTop.Control = AddToUsesPkgSectionCheckBox
|
||||||
Left = 391
|
Left = 334
|
||||||
Height = 20
|
Height = 17
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 185
|
Width = 159
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
Caption = 'DisableI18NForLFMCheckBox'
|
Caption = 'DisableI18NForLFMCheckBox'
|
||||||
OnChange = DisableI18NForLFMCheckBoxChange
|
OnChange = DisableI18NForLFMCheckBoxChange
|
||||||
@ -165,23 +166,23 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
TabOrder = 8
|
TabOrder = 8
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object StatusBar: TStatusBar[2]
|
object StatusBar: TStatusBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 22
|
Height = 20
|
||||||
Top = 433
|
Top = 435
|
||||||
Width = 464
|
Width = 464
|
||||||
Panels = <>
|
Panels = <>
|
||||||
end
|
end
|
||||||
object Splitter1: TSplitter[3]
|
object Splitter1: TSplitter
|
||||||
Cursor = crVSplit
|
Cursor = crVSplit
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 5
|
Height = 5
|
||||||
Top = 310
|
Top = 312
|
||||||
Width = 464
|
Width = 464
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
ResizeAnchor = akBottom
|
ResizeAnchor = akBottom
|
||||||
end
|
end
|
||||||
object FilterPanel: TPanel[4]
|
object FilterPanel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 28
|
Height = 28
|
||||||
Top = 48
|
Top = 48
|
||||||
@ -208,7 +209,6 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
Constraints.MinHeight = 25
|
Constraints.MinHeight = 25
|
||||||
Constraints.MinWidth = 25
|
Constraints.MinWidth = 25
|
||||||
GroupIndex = 1
|
GroupIndex = 1
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = DirectoryHierarchyButtonClick
|
OnClick = DirectoryHierarchyButtonClick
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@ -229,7 +229,6 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
Constraints.MinHeight = 25
|
Constraints.MinHeight = 25
|
||||||
Constraints.MinWidth = 25
|
Constraints.MinWidth = 25
|
||||||
GroupIndex = 2
|
GroupIndex = 2
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = SortAlphabeticallyButtonClick
|
OnClick = SortAlphabeticallyButtonClick
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@ -241,12 +240,12 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 163
|
Left = 163
|
||||||
Height = 24
|
Height = 21
|
||||||
Top = 2
|
Top = 4
|
||||||
Width = 278
|
Width = 278
|
||||||
UseFormActivate = True
|
UseFormActivate = True
|
||||||
ButtonWidth = 23
|
ButtonWidth = 23
|
||||||
NumGlyphs = 0
|
NumGlyphs = 1
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 11
|
BorderSpacing.Left = 11
|
||||||
Font.Color = clBtnShadow
|
Font.Color = clBtnShadow
|
||||||
@ -270,7 +269,6 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
BorderSpacing.Left = 3
|
BorderSpacing.Left = 3
|
||||||
Constraints.MinHeight = 25
|
Constraints.MinHeight = 25
|
||||||
Constraints.MinWidth = 25
|
Constraints.MinWidth = 25
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = OpenFileMenuItemClick
|
OnClick = OpenFileMenuItemClick
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@ -288,7 +286,6 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
Constraints.MinHeight = 25
|
Constraints.MinHeight = 25
|
||||||
Constraints.MinWidth = 25
|
Constraints.MinWidth = 25
|
||||||
Enabled = False
|
Enabled = False
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = MoveUpBtnClick
|
OnClick = MoveUpBtnClick
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@ -306,15 +303,14 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
Constraints.MinHeight = 25
|
Constraints.MinHeight = 25
|
||||||
Constraints.MinWidth = 25
|
Constraints.MinWidth = 25
|
||||||
Enabled = False
|
Enabled = False
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = MoveDownBtnClick
|
OnClick = MoveDownBtnClick
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object FilesTreeView: TTreeView[5]
|
object FilesTreeView: TTreeView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 233
|
Height = 235
|
||||||
Top = 77
|
Top = 77
|
||||||
Width = 464
|
Width = 464
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@ -330,17 +326,17 @@ inherited PackageEditorForm: TPackageEditorForm
|
|||||||
OnSelectionChanged = FilesTreeViewSelectionChanged
|
OnSelectionChanged = FilesTreeViewSelectionChanged
|
||||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
||||||
end
|
end
|
||||||
object FilesPopupMenu: TPopupMenu[6]
|
object FilesPopupMenu: TPopupMenu
|
||||||
OnPopup = FilesPopupMenuPopup
|
OnPopup = FilesPopupMenuPopup
|
||||||
left = 296
|
left = 296
|
||||||
top = 8
|
top = 8
|
||||||
end
|
end
|
||||||
object UsePopupMenu: TPopupMenu[7]
|
object UsePopupMenu: TPopupMenu
|
||||||
OnPopup = UsePopupMenuPopup
|
OnPopup = UsePopupMenuPopup
|
||||||
left = 184
|
left = 184
|
||||||
top = 8
|
top = 8
|
||||||
end
|
end
|
||||||
object MorePopupMenu: TPopupMenu[8]
|
object MorePopupMenu: TPopupMenu
|
||||||
OnPopup = MorePopupMenuPopup
|
OnPopup = MorePopupMenuPopup
|
||||||
left = 416
|
left = 416
|
||||||
top = 8
|
top = 8
|
||||||
|
|||||||
@ -134,7 +134,7 @@ type
|
|||||||
penDependency
|
penDependency
|
||||||
);
|
);
|
||||||
|
|
||||||
TPENodeData = class
|
TPENodeData = class(TTFENodeData)
|
||||||
public
|
public
|
||||||
Typ: TPENodeType;
|
Typ: TPENodeType;
|
||||||
Name: string; // file or package name
|
Name: string; // file or package name
|
||||||
@ -1088,11 +1088,22 @@ procedure TPackageEditorForm.FreeNodeData(Typ: TPENodeType);
|
|||||||
var
|
var
|
||||||
NodeData: TPENodeData;
|
NodeData: TPENodeData;
|
||||||
n: TPENodeData;
|
n: TPENodeData;
|
||||||
|
AObject : TObject;
|
||||||
|
ANode : TTreeNode;
|
||||||
begin
|
begin
|
||||||
NodeData:=FFirstNodeData[Typ];
|
NodeData:=FFirstNodeData[Typ];
|
||||||
while NodeData<>nil do begin
|
while NodeData<>nil do begin
|
||||||
n:=NodeData;
|
n:=NodeData;
|
||||||
NodeData:=NodeData.Next;
|
NodeData:=NodeData.Next;
|
||||||
|
If Assigned(n.Node) Then Begin
|
||||||
|
ANode := TTreeNode(n.Node);
|
||||||
|
If Assigned(ANode.Data) Then Begin
|
||||||
|
AObject := TObject(ANode.Data);
|
||||||
|
If AObject is TFileNameItem Then
|
||||||
|
AObject.Free;
|
||||||
|
end;
|
||||||
|
ANode.Data := NIL;
|
||||||
|
end;
|
||||||
n.Free;
|
n.Free;
|
||||||
end;
|
end;
|
||||||
FFirstNodeData[Typ]:=nil;
|
FFirstNodeData[Typ]:=nil;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user