-
Notifications
You must be signed in to change notification settings - Fork 3
/
Easy.diaplugin.pas
74 lines (57 loc) · 1.42 KB
/
Easy.diaplugin.pas
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
unit Easy.diaplugin;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils,
Vcl.Dialogs, Vcl.Forms, Vcl.Controls,
System.Classes, Vcl.ComCtrls, SciSupport, System.Contnrs, System.Math,
NppPlugin, ciUnit;
type
TdiaPlugin = class(TNppPlugin)
private
{ Private declarations }
Fci: Tci;
public
constructor Create;
procedure DoNppnToolbarModification; override;
procedure FuncCiForm;
procedure FuncCiMain;
end;
var
Npp: TdiaPlugin;
implementation
procedure _FuncCiForm; cdecl;
begin
Npp.FuncCiForm;
end;
procedure _FuncCiMain; cdecl;
begin
Npp.FuncCiMain;
end;
{ TdiaPlugin }
procedure TdiaPlugin.FuncCiForm;
begin
if not Assigned(Fci) then Fci := Tci.Create(self, 0);
(Fci as Tci).DoCodeinsp;
end;
procedure TdiaPlugin.FuncCiMain;
begin
if not Assigned(Fci) then Fci := Tci.Create(self, 0);
(Fci as Tci).Show;
end;
constructor TdiaPlugin.Create;
begin
inherited;
PluginName := 'Èíñïåêòîð êîäà';
AddFuncItem('Ïîêàçàòü ðåçóëüòàò', _FuncCiMain);
AddFuncItem('Èíñïåêòèðîâàòü ôàéë', _FuncCiForm);
Sci_Send(SCI_SETMODEVENTMASK,SC_MOD_INSERTTEXT or SC_MOD_DELETETEXT,0);
end;
procedure TdiaPlugin.DoNppnToolbarModification;
var
tb: TToolbarIcons;
begin
tb.ToolbarIcon := 0;
tb.ToolbarBmp := LoadImage(Hinstance, 'BUG', IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE + LR_LOADTRANSPARENT));
Npp_Send(NPPM_ADDTOOLBARICON, WPARAM(self.CmdIdFromDlgId(1)), LPARAM(@tb));
end;
end.