diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
commit | 864081102a5f252415f41950b3039a896b4ae9c5 (patch) | |
tree | c6b764651e9dd1f8f53b98eab05f16ba4a492a79 /plugins/Watrack/i_opt_0.inc | |
parent | db5149b48346c417e18add5702a9dfe7f6e28dd0 (diff) |
Awkwars's plugins - welcome to our trunk
git-svn-id: http://svn.miranda-ng.org/main/trunk@1822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/i_opt_0.inc')
-rw-r--r-- | plugins/Watrack/i_opt_0.inc | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/plugins/Watrack/i_opt_0.inc b/plugins/Watrack/i_opt_0.inc new file mode 100644 index 0000000000..ab17d6ec0d --- /dev/null +++ b/plugins/Watrack/i_opt_0.inc @@ -0,0 +1,91 @@ +{special tab: parts settings}
+
+function DlgProcOptions0(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
+const
+ hasApply:boolean=false;
+var
+ i:integer;
+ ptr:pwModule;
+ wnd:HWND;
+ rc:TRECT;
+begin
+ result:=0;
+ case hMessage of
+ WM_DESTROY: begin
+ if hasApply then
+ begin
+ ptr:=ModuleLink;
+ while ptr<>nil do
+ begin
+ if ptr^.ModuleName<>nil then
+ begin
+ i:=SendMessageW(ptr^.Button,BM_GETCHECK,0,0);
+ if (i=BST_CHECKED) xor (ptr^.ModuleStat<>0) then
+ begin
+ if i=BST_CHECKED then
+ begin
+ ptr^.ModuleStat:=1;
+ if @ptr^.Init<>nil then
+ if ptr^.Init(false)=0 then
+ ptr^.ModuleStat:=0;
+ end
+ else
+ begin
+ ptr^.ModuleStat:=0;
+ if @ptr^.DeInit<>nil then
+ ptr^.DeInit(true);
+ end;
+ end;
+// if ptr^.ModuleStat then
+ end;
+ ptr:=ptr^.Next;
+ end;
+ end;
+ end;
+
+ WM_INITDIALOG: begin
+
+ hasApply:=false;
+
+ ptr:=ModuleLink;
+ i:=0;
+ while ptr<>nil do
+ begin
+ if ptr^.ModuleName<>nil then
+ begin
+ ptr^.Button:=CreateWindowW('BUTTON',TranslateW(ptr^.ModuleName),
+ WS_CHILD+WS_VISIBLE+BS_AUTOCHECKBOX,
+ 14,20+i*20,150,14,Dialog,0,hInstance,nil);
+ SendMessageW(ptr^.Button,WM_SETFONT,GetStockObject(DEFAULT_GUI_FONT),0);
+ if ptr^.ModuleStat<>0 then
+ SendMessageW(ptr^.Button,BM_SETCHECK,BST_CHECKED,0);
+ inc(i);
+ end;
+ ptr:=ptr^.Next;
+ end;
+ if i>0 then
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_MODULEGROUP);
+ GetWindowRect(wnd,rc);
+ SetWindowPos (wnd,0,0,0,rc.Right-rc.Left,(i+1)*20,
+ SWP_NOMOVE+SWP_NOZORDER+SWP_NOACTIVATE);
+ end;
+
+ TranslateDialogDefault(Dialog);
+ end;
+
+ WM_COMMAND: begin
+ if (wParam shr 16)=BN_CLICKED then
+ SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
+ end;
+
+ WM_NOTIFY: begin
+ if integer(PNMHdr(lParam)^.code)=PSN_APPLY then
+ begin
+ hasApply:=true;
+ end;
+ end;
+ else
+ {result:=}DefWindowProc(Dialog,hMessage,wParam,lParam);
+ end;
+end;
|