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