This repository has been archived by the owner on Nov 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathregprojectgroup.pp
114 lines (86 loc) · 4.3 KB
/
regprojectgroup.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
unit RegProjectGroup;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, ProjectGroupIntf, MenuIntf, IDECommands, ToolBarIntf,
ProjectGroupStrConst, ProjectGroup, ProjectGroupEditor;
procedure RegisterProjectGroupEditorMenuItems;
procedure Register;
implementation
const
ProjectGroupEditorMenuRootName = 'ProjectGroupEditorMenu';
procedure RegisterProjectGroupEditorMenuItems;
procedure RegisterMenuCmd(out MenuCmd: TIDEMenuCommand;
Section: TIDEMenuSection; const Name, Caption: string);
begin
MenuCmd:=RegisterIDEMenuCommand(Section,Name,Caption);
end;
var
MnuRoot, MnuSection: TIDEMenuSection;
begin
MnuRoot:=RegisterIDEMenuRoot(ProjectGroupEditorMenuRootName);
ProjectGroupEditorMenuRoot:=MnuRoot;
PGEditMenuSectionFiles:=RegisterIDEMenuSection(MnuRoot,'File');
MnuSection:=RegisterIDEMenuSection(MnuRoot,'Compile');
PGEditMenuSectionCompile:=MnuSection;
RegisterMenuCmd(MnuCmdTargetCompile,MnuSection,'TargetCompile',lisTargetCompile);
RegisterMenuCmd(MnuCmdTargetCompileClean,MnuSection,'TargetCompileClean',lisTargetCompileClean);
RegisterMenuCmd(MnuCmdTargetCompileFromHere,MnuSection,'TargetCompileFromHere',lisTargetCompileFromHere);
// ToDo: clean ... -> clean up dialog
// ToDo: set build mode of all projects
MnuSection:=RegisterIDEMenuSection(MnuRoot,'AddRemove');
PGEditMenuSectionAddRemove:=MnuSection;
RegisterMenuCmd(MnuCmdTargetAdd,MnuSection,'TargetAdd',lisTargetAdd);
RegisterMenuCmd(MnuCmdTargetRemove,MnuSection,'TargetRemove',lisTargetRemove);
// ToDo: re-add
MnuSection:=RegisterIDEMenuSection(MnuRoot,'Use');
PGEditMenuSectionUse:=MnuSection;
RegisterMenuCmd(MnuCmdTargetInstall,MnuSection,'TargetInstall',lisTargetInstall);// ToDo
RegisterMenuCmd(MnuCmdTargetUninstall,MnuSection,'TargetUninstall',lisTargetUninstall);// ToDo
RegisterMenuCmd(MnuCmdTargetEarlier,MnuSection,'TargetEarlier',lisTargetEarlier);// ToDo: Ctrl+Up
RegisterMenuCmd(MnuCmdTargetLater,MnuSection,'TargetLater',lisTargetLater);// ToDo: Ctrl+Down
RegisterMenuCmd(MnuCmdTargetActivate,MnuSection,'TargetActivate',lisTargetActivate);
RegisterMenuCmd(MnuCmdTargetOpen,MnuSection,'TargetOpen',lisTargetOpen);
RegisterMenuCmd(MnuCmdTargetRun,MnuSection,'TargetRun',lisTargetRun);
RegisterMenuCmd(MnuCmdTargetProperties,MnuSection,'TargetProperties',lisTargetProperties);
MnuSection:=RegisterIDEMenuSection(MnuRoot,'Misc');
PGEditMenuSectionMisc:=MnuSection;
RegisterMenuCmd(MnuCmdTargetCopyFilename,MnuSection,'CopyFilename',lisTargetCopyFilename);
// ToDo: View source (project)
// ToDo: find in files
// ToDo: find references in files
// ToDo: D&D order compile targets
end;
procedure Register;
procedure RegisterMnuCmd(out Cmd: TIDECommand; out MenuCmd: TIDEMenuCommand;
Section: TIDEMenuSection; const Name, Caption: string;
const OnExecuteMethod: TNotifyEvent);
begin
Cmd:=RegisterIDECommand(PGCmdCategory,Name,Caption,OnExecuteMethod);
MenuCmd:=RegisterIDEMenuCommand(Section,Name,Caption,nil,nil,Cmd);
RegisterIDEButtonCommand(Cmd);
end;
begin
IDEProjectGroupManager:=TIDEProjectGroupManager.Create;
IDEProjectGroupManager.Options.LoadSafe;
PGCmdCategory:=RegisterIDECommandCategory(nil,ProjectGroupCmdCategoryName,lisProjectGroups);
RegisterMnuCmd(CmdNewProjectGroup,MnuCmdNewProjectGroup,itmProjectNewSection,
'New Project Group',lisNewProjectGroupMenuC,@IDEProjectGroupManager.DoNewClick);
RegisterMnuCmd(CmdOpenProjectGroup,MnuCmdOpenProjectGroup,itmProjectOpenSection,
'Open Project Group',lisOpenProjectGroup,@IDEProjectGroupManager.DoOpenClick);
PGOpenRecentSubMenu:=RegisterIDESubMenu(itmProjectOpenSection,
'Open recent Project Group',lisOpenRecentProjectGroup);
RegisterMnuCmd(CmdSaveProjectGroup,MnuCmdSaveProjectGroup,itmProjectSaveSection,
'Save Project Group',lisSaveProjectGroup,@IDEProjectGroupManager.DoSaveClick);
MnuCmdSaveProjectGroup.Enabled:=false;
RegisterMnuCmd(CmdSaveProjectGroupAs,MnuCmdSaveProjectGroupAs,itmProjectSaveSection,
'Save Project Group as',lisSaveProjectGroupAs,@IDEProjectGroupManager.DoSaveAsClick);
MnuCmdSaveProjectGroupAs.Enabled:=false;
RegisterProjectGroupEditorMenuItems;
IDEProjectGroupManager.UpdateRecentProjectGroupMenu;
ProjectGroupManager:=IDEProjectGroupManager;
SetProjectGroupEditorCallBack;
end;
finalization
FreeAndNil(IDEProjectGroupManager);
end.