From 50e0571b2515aa7f39f4101e3557a64ac230b078 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 11 Jan 2006 00:03:07 +0000 Subject: [PATCH] converted pkg graph explorer to lfm from Darius git-svn-id: trunk@8492 - --- .gitattributes | 2 + packager/pkggraphexplorer.lfm | 129 ++++++++++++++++++++++ packager/pkggraphexplorer.lrs | 42 +++++++ packager/pkggraphexplorer.pas | 201 +++++++++------------------------- packager/pkgmanager.pas | 2 +- 5 files changed, 227 insertions(+), 149 deletions(-) create mode 100644 packager/pkggraphexplorer.lfm create mode 100644 packager/pkggraphexplorer.lrs diff --git a/.gitattributes b/.gitattributes index f40b0ece73..2a5749ca30 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2143,6 +2143,8 @@ 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/pkggraphexplorer.lfm svneol=native#text/plain +packager/pkggraphexplorer.lrs svneol=native#text/plain packager/pkggraphexplorer.pas svneol=native#text/pascal packager/pkgmanager.pas svneol=native#text/pascal packager/pkgoptionsdlg.pas svneol=native#text/pascal diff --git a/packager/pkggraphexplorer.lfm b/packager/pkggraphexplorer.lfm new file mode 100644 index 0000000000..e1039cb441 --- /dev/null +++ b/packager/pkggraphexplorer.lfm @@ -0,0 +1,129 @@ +object PkgGraphExplorerDlg: TPkgGraphExplorerDlg + ActiveControl = InfoMemo + Caption = 'PkgGraphExplorerDlg' + ClientHeight = 413 + ClientWidth = 462 + KeyPreview = True + OnShow = PkgGraphExplorerShow + PixelsPerInch = 112 + Position = poScreenCenter + HorzScrollBar.Page = 461 + VertScrollBar.Page = 412 + Left = 369 + Height = 413 + Top = 239 + Width = 462 + object InfoMemo: TMemo + Align = alBottom + Lines.Strings = ( + 'InfoMemo' + ) + TabOrder = 0 + Height = 79 + Top = 334 + Width = 462 + end + object VerticalSplitter: TSplitter + Align = alBottom + Cursor = crVSplit + Height = 5 + Width = 462 + ResizeAnchor = akBottom + Cursor = crVSplit + Height = 5 + Top = 329 + Width = 462 + end + object PkgListPanel: TPanel + Align = alRight + BevelOuter = bvNone + ClientHeight = 329 + ClientWidth = 229 + TabOrder = 1 + Left = 233 + Height = 329 + Width = 229 + object PkgListLabel: TLabel + Align = alTop + BorderSpacing.Around = 6 + Caption = 'PkgListLabel' + Color = clNone + ParentColor = False + Left = 6 + Height = 13 + Top = 6 + Width = 217 + end + object PkgListBox: TListBox + Align = alClient + ClickOnSelChange = False + OnClick = PkgListBoxClick + OnDblClick = PkgListBoxDblClick + TabOrder = 0 + TopIndex = -1 + Height = 304 + Top = 25 + Width = 229 + end + end + object HorizontalSplitter: TSplitter + Align = alRight + Height = 329 + Width = 4 + ResizeAnchor = akRight + Cursor = crHSplit + Left = 229 + Height = 329 + Width = 4 + end + object PkgTreePanel: TPanel + Align = alClient + BevelOuter = bvNone + ClientHeight = 329 + ClientWidth = 229 + TabOrder = 2 + Height = 329 + Width = 229 + object PkgTreeLabel: TLabel + Align = alTop + BorderSpacing.Around = 6 + Caption = 'PkgTreeLabel' + Color = clNone + ParentColor = False + Left = 6 + Height = 13 + Top = 6 + Width = 217 + end + object PkgTreeView: TTreeView + Align = alClient + DefaultItemHeight = 17 + Images = ImageList + PopupMenu = PkgPopupMenu + RightClickSelect = True + TabOrder = 0 + OnDblClick = PkgTreeViewDblClick + OnExpanding = PkgTreeViewExpanding + OnSelectionChanged = PkgTreeViewSelectionChanged + Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips] + Height = 304 + Top = 25 + Width = 229 + end + end + object ImageList: TImageList + Height = 17 + Width = 17 + left = 32 + top = 8 + end + object PkgPopupMenu: TPopupMenu + OnPopup = PkgPopupMenuPopup + left = 32 + top = 40 + object UninstallMenuItem: TMenuItem + Caption = 'New Item1' + OnClick = UninstallMenuItemClick + end + end +end diff --git a/packager/pkggraphexplorer.lrs b/packager/pkggraphexplorer.lrs new file mode 100644 index 0000000000..50c28d4313 --- /dev/null +++ b/packager/pkggraphexplorer.lrs @@ -0,0 +1,42 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TPkgGraphExplorerDlg','FORMDATA',[ + 'TPF0'#20'TPkgGraphExplorerDlg'#19'PkgGraphExplorerDlg'#13'ActiveControl'#7#8 + +'InfoMemo'#7'Caption'#6#19'PkgGraphExplorerDlg'#12'ClientHeight'#3#157#1#11 + +'ClientWidth'#3#206#1#10'KeyPreview'#9#6'OnShow'#7#20'PkgGraphExplorerShow' + +#13'PixelsPerInch'#2'p'#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Pa' + +'ge'#3#205#1#18'VertScrollBar.Page'#3#156#1#4'Left'#3'q'#1#6'Height'#3#157#1 + +#3'Top'#3#239#0#5'Width'#3#206#1#0#5'TMemo'#8'InfoMemo'#5'Align'#7#8'alBotto' + +'m'#13'Lines.Strings'#1#6#8'InfoMemo'#0#8'TabOrder'#2#0#6'Height'#2'O'#3'Top' + +#3'N'#1#5'Width'#3#206#1#0#0#9'TSplitter'#16'VerticalSplitter'#5'Align'#7#8 + +'alBottom'#6'Cursor'#7#8'crVSplit'#6'Height'#2#5#5'Width'#3#206#1#12'ResizeA' + +'nchor'#7#8'akBottom'#6'Cursor'#7#8'crVSplit'#6'Height'#2#5#3'Top'#3'I'#1#5 + +'Width'#3#206#1#0#0#6'TPanel'#12'PkgListPanel'#5'Align'#7#7'alRight'#10'Beve' + +'lOuter'#7#6'bvNone'#12'ClientHeight'#3'I'#1#11'ClientWidth'#3#229#0#8'TabOr' + +'der'#2#1#4'Left'#3#233#0#6'Height'#3'I'#1#5'Width'#3#229#0#0#6'TLabel'#12'P' + +'kgListLabel'#5'Align'#7#5'alTop'#20'BorderSpacing.Around'#2#6#7'Caption'#6 + +#12'PkgListLabel'#5'Color'#7#6'clNone'#11'ParentColor'#8#4'Left'#2#6#6'Heigh' + +'t'#2#13#3'Top'#2#6#5'Width'#3#217#0#0#0#8'TListBox'#10'PkgListBox'#5'Align' + +#7#8'alClient'#16'ClickOnSelChange'#8#7'OnClick'#7#15'PkgListBoxClick'#10'On' + +'DblClick'#7#18'PkgListBoxDblClick'#8'TabOrder'#2#0#8'TopIndex'#2#255#6'Heig' + +'ht'#3'0'#1#3'Top'#2#25#5'Width'#3#229#0#0#0#0#9'TSplitter'#18'HorizontalSpl' + +'itter'#5'Align'#7#7'alRight'#6'Height'#3'I'#1#5'Width'#2#4#12'ResizeAnchor' + +#7#7'akRight'#6'Cursor'#7#8'crHSplit'#4'Left'#3#229#0#6'Height'#3'I'#1#5'Wid' + +'th'#2#4#0#0#6'TPanel'#12'PkgTreePanel'#5'Align'#7#8'alClient'#10'BevelOuter' + +#7#6'bvNone'#12'ClientHeight'#3'I'#1#11'ClientWidth'#3#229#0#8'TabOrder'#2#2 + +#6'Height'#3'I'#1#5'Width'#3#229#0#0#6'TLabel'#12'PkgTreeLabel'#5'Align'#7#5 + +'alTop'#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'PkgTreeLabel'#5'Color'#7 + +#6'clNone'#11'ParentColor'#8#4'Left'#2#6#6'Height'#2#13#3'Top'#2#6#5'Width'#3 + +#217#0#0#0#9'TTreeView'#11'PkgTreeView'#5'Align'#7#8'alClient'#17'DefaultIte' + +'mHeight'#2#17#6'Images'#7#9'ImageList'#9'PopupMenu'#7#12'PkgPopupMenu'#16'R' + +'ightClickSelect'#9#8'TabOrder'#2#0#10'OnDblClick'#7#19'PkgTreeViewDblClick' + +#11'OnExpanding'#7#20'PkgTreeViewExpanding'#18'OnSelectionChanged'#7#27'PkgT' + +'reeViewSelectionChanged'#7'Options'#11#17'tvoAutoItemHeight'#16'tvoHideSele' + +'ction'#21'tvoKeepCollapsedNodes'#19'tvoRightClickSelect'#14'tvoShowButtons' + +#12'tvoShowLines'#11'tvoShowRoot'#11'tvoToolTips'#0#6'Height'#3'0'#1#3'Top'#2 + +#25#5'Width'#3#229#0#0#0#0#10'TImageList'#9'ImageList'#6'Height'#2#17#5'Widt' + +'h'#2#17#4'left'#2' '#3'top'#2#8#0#0#10'TPopupMenu'#12'PkgPopupMenu'#7'OnPop' + +'up'#7#17'PkgPopupMenuPopup'#4'left'#2' '#3'top'#2'('#0#9'TMenuItem'#17'Unin' + +'stallMenuItem'#7'Caption'#6#9'New Item1'#7'OnClick'#7#22'UninstallMenuItemC' + +'lick'#0#0#0#0 +]); diff --git a/packager/pkggraphexplorer.pas b/packager/pkggraphexplorer.pas index c7049f3dcf..c0b744de26 100644 --- a/packager/pkggraphexplorer.pas +++ b/packager/pkggraphexplorer.pas @@ -29,7 +29,7 @@ Author: Mattias Gaertner Abstract: - TPkgGraphExplorer is the IDE window showing the whole package graph. + TPkgGraphExplorerDlg is the IDE window showing the whole package graph. } unit PkgGraphExplorer; @@ -43,22 +43,27 @@ uses AVL_Tree, IDECommands, LazConf, LazarusIDEStrConsts, IDEProcs, IDEOptionDefs, EnvironmentOpts, - Project, PackageDefs, PackageSystem, PackageEditor; + Project, PackageDefs, PackageSystem, PackageEditor, ExtCtrls; type TOnOpenProject = function(Sender: TObject; AProject: TProject): TModalResult of object; - TPkgGraphExplorer = class(TForm) + { TPkgGraphExplorerDlg } + + TPkgGraphExplorerDlg = class(TForm) ImageList: TImageList; PkgTreeLabel: TLabel; PkgTreeView: TTreeView; + PkgListPanel: TPanel; + PkgTreePanel: TPanel; PkgListLabel: TLabel; PkgListBox: TListBox; InfoMemo: TMemo; PkgPopupMenu: TPopupMenu; + VerticalSplitter: TSplitter; + HorizontalSplitter: TSplitter; UninstallMenuItem: TMenuItem; - procedure PkgGraphExplorerResize(Sender: TObject); procedure PkgGraphExplorerShow(Sender: TObject); procedure PkgListBoxClick(Sender: TObject); procedure PkgListBoxDblClick(Sender: TObject); @@ -115,51 +120,19 @@ type end; var - PackageGraphExplorer: TPkgGraphExplorer; + PackageGraphExplorer: TPkgGraphExplorerDlg; implementation uses Math; -{ TPkgGraphExplorer } - -procedure TPkgGraphExplorer.PkgGraphExplorerResize(Sender: TObject); -var - x: Integer; - y: Integer; - w: Integer; -begin - x:=1; - y:=1; - w:=((ClientWidth-3*x) div 2); - with PkgTreeLabel do - SetBounds(x,y,w,Height); - inc(x,PkgTreeLabel.Width+PkgTreeLabel.Left); - - with PkgListLabel do - SetBounds(x,y,w,Height); - x:=1; - inc(y,PkgTreeLabel.Height+3); - - with PkgTreeView do - SetBounds(x,y,w,Max(Parent.ClientHeight-y-80,10)); - inc(x,PkgTreeView.Width+PkgTreeView.Left); - - with PkgListBox do - SetBounds(x,y,w,PkgTreeView.Height); - x:=1; - inc(y,PkgTreeView.Height+1); - - with InfoMemo do - SetBounds(x,y,Parent.ClientWidth-2*x,Max(10,Parent.ClientHeight-y-x)); -end; - -procedure TPkgGraphExplorer.PkgGraphExplorerShow(Sender: TObject); +{ TPkgGraphExplorerDlg } +procedure TPkgGraphExplorerDlg.PkgGraphExplorerShow(Sender: TObject); begin UpdateAll; end; -procedure TPkgGraphExplorer.PkgListBoxClick(Sender: TObject); +procedure TPkgGraphExplorerDlg.PkgListBoxClick(Sender: TObject); var Dependency: TPkgDependency; begin @@ -173,7 +146,7 @@ begin end; end; -procedure TPkgGraphExplorer.PkgListBoxDblClick(Sender: TObject); +procedure TPkgGraphExplorerDlg.PkgListBoxDblClick(Sender: TObject); var Dependency: TPkgDependency; begin @@ -186,7 +159,7 @@ begin OpenDependencyOwner(Dependency.Owner); end; -procedure TPkgGraphExplorer.PkgPopupMenuPopup(Sender: TObject); +procedure TPkgGraphExplorerDlg.PkgPopupMenuPopup(Sender: TObject); var Pkg: TLazPackage; Dependency: TPkgDependency; @@ -197,7 +170,7 @@ begin UninstallMenuItem.Caption:='Uninstall package '+Pkg.IDAsString; end; -procedure TPkgGraphExplorer.PkgTreeViewDblClick(Sender: TObject); +procedure TPkgGraphExplorerDlg.PkgTreeViewDblClick(Sender: TObject); var Pkg: TLazPackage; Dependency: TPkgDependency; @@ -209,7 +182,7 @@ begin end; end; -procedure TPkgGraphExplorer.PkgTreeViewExpanding(Sender: TObject; +procedure TPkgGraphExplorerDlg.PkgTreeViewExpanding(Sender: TObject; Node: TTreeNode; var AllowExpansion: Boolean); var Pkg, ChildPackage: TLazPackage; @@ -267,13 +240,13 @@ begin end; end; -procedure TPkgGraphExplorer.PkgTreeViewSelectionChanged(Sender: TObject); +procedure TPkgGraphExplorerDlg.PkgTreeViewSelectionChanged(Sender: TObject); begin UpdateInfo; UpdateList; end; -procedure TPkgGraphExplorer.UninstallMenuItemClick(Sender: TObject); +procedure TPkgGraphExplorerDlg.UninstallMenuItemClick(Sender: TObject); var Pkg: TLazPackage; Dependency: TPkgDependency; @@ -284,95 +257,30 @@ begin end; end; -procedure TPkgGraphExplorer.SetupComponents; +procedure TPkgGraphExplorerDlg.SetupComponents; - procedure AddResImg(const ResName: string); + function AddResImg(const ResName: string): integer; var Pixmap: TPixmap; begin Pixmap:=TPixmap.Create; Pixmap.TransparentColor:=clWhite; Pixmap.LoadFromLazarusResource(ResName); - ImageList.Add(Pixmap,nil) + Result:=ImageList.Add(Pixmap,nil) end; begin - ImageList:=TImageList.Create(Self); - with ImageList do begin - Width:=17; - Height:=17; - Name:='ImageList'; - ImgIndexPackage:=Count; - AddResImg('pkg_package'); - ImgIndexInstalledPackage:=Count; - AddResImg('pkg_package_install'); - ImgIndexInstallPackage:=Count; - AddResImg('pkg_package_autoinstall'); - ImgIndexUninstallPackage:=Count; - AddResImg('pkg_package_uninstall'); - ImgIndexCirclePackage:=Count; - AddResImg('pkg_package_circle'); - ImgIndexMissingPackage:=Count; - AddResImg('pkg_conflict'); - end; + ImgIndexPackage:=AddResImg('pkg_package'); + ImgIndexInstalledPackage:=AddResImg('pkg_package_install'); + ImgIndexInstallPackage:=AddResImg('pkg_package_autoinstall'); + ImgIndexUninstallPackage:=AddResImg('pkg_package_uninstall'); + ImgIndexCirclePackage:=AddResImg('pkg_package_circle'); + ImgIndexMissingPackage:=AddResImg('pkg_conflict'); - // popupmenu - PkgPopupMenu:=TPopupMenu.Create(Self); - with PkgPopupMenu do begin - Name:='PkgPopupMenu'; - OnPopup:=@PkgPopupMenuPopup; - end; - - UninstallMenuItem:=TMenuItem.Create(Self); - with UninstallMenuItem do begin - Name:='UninstallMenuItem'; - OnClick:=@UninstallMenuItemClick; - end; - PkgPopupMenu.Items.Add(UninstallMenuItem); - - - PkgTreeLabel:=TLabel.Create(Self); - with PkgTreeLabel do begin - Name:='PkgTreeLabel'; - Parent:=Self; - Caption:=lisPckExplLoadedPackages; - end; - - PkgTreeView:=TTreeView.Create(Self); - with PkgTreeView do begin - Name:='PkgTreeView'; - Parent:=Self; - Options:=Options+[tvoRightClickSelect]; - Images:=Self.ImageList; - PopupMenu:=PkgPopupMenu; - OnExpanding:=@PkgTreeViewExpanding; - OnSelectionChanged:=@PkgTreeViewSelectionChanged; - OnDblClick:=@PkgTreeViewDblClick; - end; - - PkgListLabel:=TLabel.Create(Self); - with PkgListLabel do begin - Name:='PkgListLabel'; - Parent:=Self; - Caption:=lisPckExplIsRequiredBy; - end; - - PkgListBox:=TListBox.Create(Self); - with PkgListBox do begin - Name:='PkgListBox'; - Parent:=Self; - ClickOnSelChange := False; - OnClick:=@PkgListBoxClick; - OnDblClick:=@PkgListBoxDblClick; - end; - - InfoMemo:=TMemo.Create(Self); - with InfoMemo do begin - Name:='InfoMemo'; - Parent:=Self; - end; + PkgTreeLabel.Caption:=lisPckExplLoadedPackages; + PkgListLabel.Caption:=lisPckExplIsRequiredBy; end; -function TPkgGraphExplorer.GetPackageImageIndex(Pkg: TLazPackage): integer; +function TPkgGraphExplorerDlg.GetPackageImageIndex(Pkg: TLazPackage): integer; begin if Pkg.Installed<>pitNope then begin if Pkg.AutoInstall<>pitNope then begin @@ -389,7 +297,7 @@ begin end; end; -procedure TPkgGraphExplorer.GetDependency(ANode: TTreeNode; +procedure TPkgGraphExplorerDlg.GetDependency(ANode: TTreeNode; var Pkg: TLazPackage; var Dependency: TPkgDependency); // if Dependency<>nil then Pkg is the Parent var @@ -424,7 +332,7 @@ begin end; end; -procedure TPkgGraphExplorer.GetCurrentIsUsedBy(var Dependency: TPkgDependency); +procedure TPkgGraphExplorerDlg.GetCurrentIsUsedBy(var Dependency: TPkgDependency); var TreePkg: TLazPackage; TreeDependency: TPkgDependency; @@ -439,7 +347,7 @@ begin end; end; -function TPkgGraphExplorer.SearchParentNodeWithText(ANode: TTreeNode; +function TPkgGraphExplorerDlg.SearchParentNodeWithText(ANode: TTreeNode; const NodeText: string): TTreeNode; begin Result:=ANode; @@ -449,13 +357,13 @@ begin end; end; -procedure TPkgGraphExplorer.KeyUp(var Key: Word; Shift: TShiftState); +procedure TPkgGraphExplorerDlg.KeyUp(var Key: Word; Shift: TShiftState); begin inherited KeyUp(Key, Shift); ExecuteIDEShortCut(Self,Key,Shift,nil); end; -constructor TPkgGraphExplorer.Create(TheOwner: TComponent); +constructor TPkgGraphExplorerDlg.Create(TheOwner: TComponent); var ALayout: TIDEWindowLayout; begin @@ -464,42 +372,38 @@ begin fSortedPackages:=TAVLTree.Create(@CompareLazPackageID); Name:=NonModalIDEWindowNames[nmiwPkgGraphExplorer]; Caption:=lisMenuPackageGraph; - KeyPreview:=true; ALayout:=EnvironmentOptions.IDEWindowLayoutList.ItemByFormID(Name); ALayout.Form:=TForm(Self); ALayout.Apply; SetupComponents; - OnResize:=@PkgGraphExplorerResize; - OnResize(Self); - OnShow:=@PkgGraphExplorerShow; end; -destructor TPkgGraphExplorer.Destroy; +destructor TPkgGraphExplorerDlg.Destroy; begin FreeAndNil(fSortedPackages); inherited Destroy; end; -procedure TPkgGraphExplorer.BeginUpdate; +procedure TPkgGraphExplorerDlg.BeginUpdate; begin inc(FUpdateLock); end; -procedure TPkgGraphExplorer.EndUpdate; +procedure TPkgGraphExplorerDlg.EndUpdate; begin - if FUpdateLock<=0 then RaiseException('TPkgGraphExplorer.EndUpdate'); + if FUpdateLock<=0 then RaiseException('TPkgGraphExplorerDlg.EndUpdate'); dec(FUpdateLock); if FChangedDuringLock then UpdateAll; end; -function TPkgGraphExplorer.IsUpdateLocked: boolean; +function TPkgGraphExplorerDlg.IsUpdateLocked: boolean; begin Result:=FUpdateLock>0; end; -procedure TPkgGraphExplorer.UpdateAll; +procedure TPkgGraphExplorerDlg.UpdateAll; begin if IsUpdateLocked then begin FChangedDuringLock:=true; @@ -512,7 +416,7 @@ begin UpdateInfo; end; -procedure TPkgGraphExplorer.UpdateTree; +procedure TPkgGraphExplorerDlg.UpdateTree; var Cnt: Integer; i: Integer; @@ -562,7 +466,7 @@ begin PkgTreeView.EndUpdate; end; -procedure TPkgGraphExplorer.UpdateList; +procedure TPkgGraphExplorerDlg.UpdateList; var Pkg: TLazPackage; Dependency: TPkgDependency; @@ -587,7 +491,7 @@ begin end; end; -procedure TPkgGraphExplorer.UpdateInfo; +procedure TPkgGraphExplorerDlg.UpdateInfo; var Pkg: TLazPackage; Dependency: TPkgDependency; @@ -624,23 +528,23 @@ begin InfoMemo.Text:=InfoStr; end; -procedure TPkgGraphExplorer.UpdatePackageName(Pkg: TLazPackage; +procedure TPkgGraphExplorerDlg.UpdatePackageName(Pkg: TLazPackage; const OldName: string); begin UpdateAll; end; -procedure TPkgGraphExplorer.UpdatePackageID(Pkg: TLazPackage); +procedure TPkgGraphExplorerDlg.UpdatePackageID(Pkg: TLazPackage); begin UpdateAll; end; -procedure TPkgGraphExplorer.UpdatePackageAdded(Pkg: TLazPackage); +procedure TPkgGraphExplorerDlg.UpdatePackageAdded(Pkg: TLazPackage); begin UpdateAll; end; -procedure TPkgGraphExplorer.SelectPackage(Pkg: TLazPackage); +procedure TPkgGraphExplorerDlg.SelectPackage(Pkg: TLazPackage); var NewNode: TTreeNode; begin @@ -650,7 +554,7 @@ begin PkgTreeView.Selected:=NewNode; end; -procedure TPkgGraphExplorer.OpenDependencyOwner(DependencyOwner: TObject); +procedure TPkgGraphExplorerDlg.OpenDependencyOwner(DependencyOwner: TObject); begin if DependencyOwner is TLazPackage then begin if Assigned(OnOpenPackage) then @@ -661,7 +565,7 @@ begin end; end; -function TPkgGraphExplorer.FindMainNodeWithText(const s: string): TTreeNode; +function TPkgGraphExplorerDlg.FindMainNodeWithText(const s: string): TTreeNode; begin Result:=nil; if PkgTreeView.Items.Count=0 then exit; @@ -669,7 +573,7 @@ begin while (Result<>nil) and (Result.Text<>s) do Result:=Result.GetNextSibling; end; -procedure TPkgGraphExplorer.ShowPath(PathList: TList); +procedure TPkgGraphExplorerDlg.ShowPath(PathList: TList); var AnObject: TObject; CurNode, LastNode: TTreeNode; @@ -713,6 +617,7 @@ end; initialization PackageGraphExplorer:=nil; + {$I pkggraphexplorer.lrs} end. diff --git a/packager/pkgmanager.pas b/packager/pkgmanager.pas index 380a5ac0ee..cccf206007 100644 --- a/packager/pkgmanager.pas +++ b/packager/pkgmanager.pas @@ -2839,7 +2839,7 @@ end; function TPkgManager.DoShowPackageGraph: TModalResult; begin if PackageGraphExplorer=nil then begin - PackageGraphExplorer:=TPkgGraphExplorer.Create(Application); + PackageGraphExplorer:=TPkgGraphExplorerDlg.Create(Application); PackageGraphExplorer.OnOpenPackage:=@PackageGraphExplorerOpenPackage; PackageGraphExplorer.OnOpenProject:=@PackageGraphExplorerOpenProject; PackageGraphExplorer.OnUninstallPackage:=@PackageGraphExplorerUninstallPackage;