-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildLogReg.pas
More file actions
97 lines (75 loc) · 1.99 KB
/
Copy pathBuildLogReg.pas
File metadata and controls
97 lines (75 loc) · 1.99 KB
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
unit BuildLogReg;
{
Delphi-Package-Registrierung.
Fuegt unter "Ansicht" (View) den Menuepunkt "Build Log" ein.
Ein Klick darauf oeffnet das dockbare IDE-Toolfenster.
}
interface
procedure Register;
implementation
uses
System.SysUtils,
Vcl.Menus,
ToolsAPI,
BuildLogIDEWin;
{ --------------------------------------------------------------------------- }
type
TBuildLogMenuAction = class
procedure OnMenuClick(Sender: TObject);
end;
procedure TBuildLogMenuAction.OnMenuClick(Sender: TObject);
begin
ShowBuildLogWindow;
end;
var
GMenuAction: TBuildLogMenuAction = nil;
GMenuItem: TMenuItem = nil;
{ --------------------------------------------------------------------------- }
procedure Register;
var
NTASvc: INTAServices;
MainMenu: TMainMenu;
ViewMenu: TMenuItem;
Item: TMenuItem;
I: Integer;
Caption: string;
begin
RegisterBuildLogWindow;
if not Supports(BorlandIDEServices, INTAServices, NTASvc) then Exit;
MainMenu := NTASvc.MainMenu;
ViewMenu := nil;
{ "Ansicht"- bzw. "View"-Menue suchen (unabhaengig von Sprachversion) }
for I := 0 to MainMenu.Items.Count - 1 do
begin
Caption := StringReplace(MainMenu.Items[I].Caption, '&', '', [rfReplaceAll]);
if SameText(Caption, 'View') or SameText(Caption, 'Ansicht') then
begin
ViewMenu := MainMenu.Items[I];
Break;
end;
end;
if ViewMenu = nil then Exit;
if GMenuAction = nil then
GMenuAction := TBuildLogMenuAction.Create;
Item := TMenuItem.Create(nil);
Item.Caption := '&Build Log Stats';
Item.Name := 'miBuildLog';
Item.OnClick := GMenuAction.OnMenuClick;
ViewMenu.Add(Item);
GMenuItem := Item;
end;
initialization
finalization
UnregisterBuildLogWindow;
if Assigned(GMenuItem) then
begin
try
if Assigned(GMenuItem.Parent) then
GMenuItem.Parent.Remove(GMenuItem);
except
{ IDE kann beim Shutdown bereits teilweise freigegeben sein }
end;
FreeAndNil(GMenuItem);
end;
FreeAndNil(GMenuAction);
end.