summaryrefslogtreecommitdiff
path: root/plugins/Watrack/i_opt_dlg.inc
blob: e97a3df5f5684874d6e1eb0c58a375ee977804b0 (plain)
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
{$include i_opt_0.inc}
{$include i_opt_1.inc}

function OnOptInitialise(wParam:WPARAM;lParam:LPARAM):int;cdecl;
var
  odp:TOPTIONSDIALOGPAGE;
  ptr:pwModule;
  tmpl:pAnsiChar;
  name:pansiChar;
  proc:pointer;
  i:integer;
begin
  if hwndTooltip<>0 then
    DestroyWindow(hwndTooltip);
  hwndTooltip:=CreateWindowW(TOOLTIPS_CLASS,nil,TTS_ALWAYSTIP,
      integer(CW_USEDEFAULT),integer(CW_USEDEFAULT),
      integer(CW_USEDEFAULT),integer(CW_USEDEFAULT),
      0,0,hInstance,nil);

  SendMessage(hwndTooltip,TTM_SETMAXTIPWIDTH,0,300);

  FillChar(odp,SizeOf(odp),0);
  odp.cbSize     :=SizeOf(odp);
  odp.Position   :=900003000;
  odp.hInstance  :=hInstance;
  odp.szTitle.a  :=PluginName;
  odp.szGroup.a  :='Plugins';

  odp.flags      :=ODPF_BOLDGROUPS or ODPF_EXPERTONLY;
  odp.pszTemplate:='PARTS';
  odp.pfnDlgProc :=@DlgProcOptions0;
  odp.szTab.a    :='Modules';
  CallService(MS_OPT_ADDPAGE,wParam,tlparam(@odp));

  odp.flags      :=ODPF_BOLDGROUPS;
  odp.pszTemplate:='BASIC';
  odp.pfnDlgProc :=@DlgProcOptions1;
  odp.szTab.a    :='Basic';
  CallService(MS_OPT_ADDPAGE,wParam,tlparam(@odp));

  ptr:=ModuleLink;
  while ptr<>nil do
  begin
    if (ptr^.ModuleStat<>0) and (@ptr^.AddOption<>nil) then
    begin
      i:=ptr^.AddOption(tmpl,proc,name);
      odp.pszTemplate:=tmpl;
      odp.pfnDlgProc :=proc;
      odp.szTab.a    :=name;
      CallService(MS_OPT_ADDPAGE,wParam,tlparam(@odp));
      if i>0 then continue;
    end;
    ptr:=ptr^.Next;
  end;

  result:=0;
end;