summaryrefslogtreecommitdiff
path: root/plugins/Actman30/iac_settings.pas
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2013-07-16 20:08:30 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2013-07-16 20:08:30 +0000
commit74e738f374f759723daf8920677158712d0ca5c1 (patch)
tree89a93d70f87e950e28d23466d3c84120ead0e770 /plugins/Actman30/iac_settings.pas
parente5c9c0077f7b50bbfe90201154c31c13e1a6fc63 (diff)
- Actman 3 added (not adopted)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5391 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Actman30/iac_settings.pas')
-rw-r--r--plugins/Actman30/iac_settings.pas157
1 files changed, 157 insertions, 0 deletions
diff --git a/plugins/Actman30/iac_settings.pas b/plugins/Actman30/iac_settings.pas
new file mode 100644
index 0000000000..bb2c8efe5a
--- /dev/null
+++ b/plugins/Actman30/iac_settings.pas
@@ -0,0 +1,157 @@
+unit iac_settings;
+
+interface
+
+implementation
+
+uses
+ windows, messages, commctrl,
+ global,iac_global, dlgshare, lowlevelc,
+ m_api, mirutils, dbsettings, common, wrapper;
+
+{$include i_cnst_settings.inc}
+{$resource iac_settings.res}
+
+
+//----- Support functions -----
+
+
+//----- Dialog realization -----
+
+procedure FillServiceModeList(wnd:HWND);
+begin
+ SendMessage(wnd,CB_RESETCONTENT,0,0);
+ InsertString(wnd,0 ,'value');
+ InsertString(wnd,1 ,'name');
+ InsertString(wnd,2 ,'value (name)');
+ InsertString(wnd,3 ,'name ''value''');
+ SendMessage(wnd,CB_SETCURSEL,0,0);
+end;
+
+procedure ClearFields(Dialog:HWND);
+begin
+ CheckDlgButton(Dialog,IDC_CNT_FILTER,BST_UNCHECKED);
+ SetDlgItemTextW(Dialog,IDC_EDIT_FORMAT,'');
+
+ CheckDlgButton(Dialog,IDC_FR_FLAG,BST_UNCHECKED);
+end;
+
+function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+var
+ fCLformat:pWideChar;
+ lp:TLPARAM;
+ stat:integer;
+begin
+ result:=0;
+
+ case hMessage of
+ WM_INITDIALOG: begin
+ TranslateDialogDefault(Dialog);
+
+ OptSetButtonIcon(GetDlgItem(Dialog,IDC_CNT_APPLY),ACI_APPLY);
+
+ OptSetButtonIcon(GetDlgItem(Dialog,IDC_SRV_APPLY),ACI_APPLY);
+ FillServiceModeList(GetDlgItem(Dialog,IDC_SERVICELIST));
+ end;
+
+ WM_ACT_SETVALUE: begin
+ ClearFields(Dialog);
+ end;
+
+ WM_ACT_RESET: begin
+ ClearFields(Dialog);
+ // Contact list settings
+ CheckDlgButton (Dialog,IDC_CNT_FILTER,DBReadByte(0,DBBranch,'CLfilter',BST_UNCHECKED));
+ fCLformat:=DBReadUnicode(0,DBBranch,'CLformat');
+ SetDlgItemTextW(Dialog,IDC_EDIT_FORMAT,fCLformat);
+ mFreeMem(fCLformat);
+
+ // Servicelist mode settings
+ CB_SelectData(Dialog,IDC_SERVICELIST,DBReadByte(0,DBBranch,'SrvListMode'));
+ end;
+
+ WM_SHOWWINDOW: begin
+ // Show window by ShowWindow function
+ if (lParam=0) and (wParam=1) then
+ begin
+ lp:=LV_GetLParam(MacroListWindow);
+ if (lp and ACF_FIRSTRUN)<>0 then
+ stat:=BST_CHECKED
+ else
+ stat:=BST_UNCHECKED;
+ CheckDlgButton(Dialog,IDC_FR_FLAG,stat);
+ end;
+ end;
+
+ WM_COMMAND: begin
+ case wParam shr 16 of
+ BN_CLICKED: begin
+ case loword(wParam) of
+ IDC_SRV_APPLY: begin
+ DBWriteByte(0,DBBranch,'SrvListMode',
+ CB_GetData(GetDlgItem(Dialog,IDC_SERVICELIST)));
+ end;
+
+ IDC_CNT_APPLY: begin
+ fCLformat:=GetDlgText(Dialog,IDC_EDIT_FORMAT);
+ DBWriteUnicode(0,DBBranch,'CLformat',fCLformat);
+ mFreeMem(fCLformat);
+ end;
+
+ IDC_CNT_FILTER: begin
+ DBWriteByte(0,DBBranch,'CLfilter',IsDlgButtonChecked(Dialog,IDC_CNT_FILTER));
+ end;
+
+ IDC_FR_FLAG: begin
+ lp:=LV_GetLParam(MacroListWindow);
+ if IsDlgButtonChecked(Dialog,IDC_FR_FLAG)=BST_UNCHECKED then
+ lp:=lp and not ACF_FIRSTRUN
+ else
+ lp:=lp or ACF_FIRSTRUN;
+ LV_SetLParam(MacroListWindow,lp);
+
+ SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
+ end;
+ end;
+ end;
+ end;
+ end;
+
+ WM_HELP: begin
+ result:=1;
+ end;
+
+ end;
+end;
+
+//----- Export/interface functions -----
+
+var
+ vc:tActModule;
+
+function CreateAction:tBaseAction;
+begin
+ result:=nil;
+end;
+
+function CreateDialog(parent:HWND):HWND;
+begin
+ result:=CreateDialogW(hInstance,'IDD_SETTINGS',parent,@DlgProc);
+end;
+
+procedure Init;
+begin
+ vc.Next :=ModuleLink;
+
+ vc.Name :='Settings';
+ vc.Dialog :=@CreateDialog;
+ vc.Create :=@CreateAction;
+ vc.Icon :='IDI_SETTINGS';
+ vc.Hash :=1;
+
+ ModuleLink :=@vc;
+end;
+
+begin
+ Init;
+end.