diff options
Diffstat (limited to 'plugins/TabSRMM/src/msgoptions.cpp')
-rw-r--r-- | plugins/TabSRMM/src/msgoptions.cpp | 960 |
1 files changed, 466 insertions, 494 deletions
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index f4abde6c78..039b9e1cb0 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -380,7 +380,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L SendMessage(hwndDlg, WM_COMMAND, IDC_RELOADSKIN, 0);
}
else if (lr == 0) { // selected the <no skin> entry
- DBDeleteContactSetting(0, SRMSGMOD_T, "ContainerSkin");
+ db_unset(0, SRMSGMOD_T, "ContainerSkin");
Skin->Unload();
SendMessage(hwndTabConfig, WM_USER + 100, 0, 0);
}
@@ -564,27 +564,28 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, DWORD dwFlags = M->GetDword("mwflags", MWF_LOG_DEFAULT);
switch (msg) {
- case WM_INITDIALOG: {
+ case WM_INITDIALOG:
+ {
TVINSERTSTRUCT tvi = {0};
int i;
DWORD maxhist = M->GetDword("maxhist", 0);
TranslateDialogDefault(hwndDlg);
switch (M->GetByte(SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
- case LOADHISTORY_UNREAD:
- CheckDlgButton(hwndDlg, IDC_LOADUNREAD, BST_CHECKED);
- break;
- case LOADHISTORY_COUNT:
- CheckDlgButton(hwndDlg, IDC_LOADCOUNT, BST_CHECKED);
- Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTN, TRUE);
- Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTSPIN, TRUE);
- break;
- case LOADHISTORY_TIME:
- CheckDlgButton(hwndDlg, IDC_LOADTIME, BST_CHECKED);
- Utils::enableDlgControl(hwndDlg, IDC_LOADTIMEN, TRUE);
- Utils::enableDlgControl(hwndDlg, IDC_LOADTIMESPIN, TRUE);
- Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, TRUE);
- break;
+ case LOADHISTORY_UNREAD:
+ CheckDlgButton(hwndDlg, IDC_LOADUNREAD, BST_CHECKED);
+ break;
+ case LOADHISTORY_COUNT:
+ CheckDlgButton(hwndDlg, IDC_LOADCOUNT, BST_CHECKED);
+ Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTN, TRUE);
+ Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTSPIN, TRUE);
+ break;
+ case LOADHISTORY_TIME:
+ CheckDlgButton(hwndDlg, IDC_LOADTIME, BST_CHECKED);
+ Utils::enableDlgControl(hwndDlg, IDC_LOADTIMEN, TRUE);
+ Utils::enableDlgControl(hwndDlg, IDC_LOADTIMESPIN, TRUE);
+ Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, TRUE);
+ break;
}
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LOGOPTIONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LOGOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
@@ -620,7 +621,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)lvItems[i].lParam, lvItems[i].id) ? 3 : 2); // NOTE: was 2 : 1 without state image mask
lvItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_LOGOPTIONS), &tvi);
}
-
+
SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_SETPOS, 0, DBGetContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT));
SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_SETRANGE, 0, MAKELONG(24 * 60, 0));
@@ -667,162 +668,167 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, }
SetDlgItemText(hwndDlg, IDC_EXPLAINMSGLOGSETTINGS, TranslateT("You have chosen to use an external plugin for displaying the message history in the chat window. Most of the settings on this page are for the standard message log viewer only and will have no effect. To change the appearance of the message log, you must configure either IEView or History++."));
SendMessage(hwndDlg, WM_USER + 100, 0, 0);
- return TRUE;
}
+ return TRUE;
+
/*
- * configure the option page - hide most of the settings here when either IEView
- * or H++ is set as the global message log viewer. Showing these options may confuse
- * the user, because they are not working and the user needs to configure the 3rd
- * party plugin.
- */
- case WM_USER + 100: {
+ * configure the option page - hide most of the settings here when either IEView
+ * or H++ is set as the global message log viewer. Showing these options may confuse
+ * the user, because they are not working and the user needs to configure the 3rd
+ * party plugin.
+ */
+ case WM_USER + 100:
+ {
LRESULT r = SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_GETCURSEL, 0, 0);
Utils::showDlgControl(hwndDlg, IDC_EXPLAINMSGLOGSETTINGS, r == 0 ? SW_HIDE : SW_SHOW);
Utils::showDlgControl(hwndDlg, IDC_LOGOPTIONS, r == 0 ? SW_SHOW : SW_HIDE);
Utils::enableDlgControl(GetDlgItem(hwndDlg, IDC_MSGLOGDIDSPLAY),r == 0 ? FALSE : TRUE);
for (int i=0; i < SIZEOF(__ctrls); i++)
Utils::enableDlgControl(hwndDlg, __ctrls[i], r == 0 ? TRUE : FALSE);
- return 0;
}
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_ALWAYSTRIM:
- Utils::enableDlgControl(hwndDlg, IDC_TRIMSPIN, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM));
- Utils::enableDlgControl(hwndDlg, IDC_TRIM, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM));
- break;
- case IDC_LOADUNREAD:
- case IDC_LOADCOUNT:
- case IDC_LOADTIME:
- Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTN, IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT));
- Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTSPIN, IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT));
- Utils::enableDlgControl(hwndDlg, IDC_LOADTIMEN, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
- Utils::enableDlgControl(hwndDlg, IDC_LOADTIMESPIN, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
- Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
- break;
- case IDC_INDENTAMOUNT:
- case IDC_LOADCOUNTN:
- case IDC_LOADTIMEN:
- case IDC_RIGHTINDENT:
- case IDC_TRIM:
- if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
- return TRUE;
- break;
- case IDC_MODIFY: {
- TemplateEditorNew teNew = {0, 0, hwndDlg};
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_TEMPLATEEDIT), hwndDlg, DlgProcTemplateEditor, (LPARAM)&teNew);
- break;
- }
- case IDC_RTLMODIFY: {
- TemplateEditorNew teNew = {0, TRUE, hwndDlg};
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_TEMPLATEEDIT), hwndDlg, DlgProcTemplateEditor, (LPARAM)&teNew);
- break;
- }
- case IDC_MSGLOGDIDSPLAY:
- SendMessage(hwndDlg, WM_USER + 100, 0, 0);
- break;
+ return 0;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_ALWAYSTRIM:
+ Utils::enableDlgControl(hwndDlg, IDC_TRIMSPIN, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM));
+ Utils::enableDlgControl(hwndDlg, IDC_TRIM, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM));
+ break;
+ case IDC_LOADUNREAD:
+ case IDC_LOADCOUNT:
+ case IDC_LOADTIME:
+ Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTN, IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT));
+ Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTSPIN, IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT));
+ Utils::enableDlgControl(hwndDlg, IDC_LOADTIMEN, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
+ Utils::enableDlgControl(hwndDlg, IDC_LOADTIMESPIN, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
+ Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
+ break;
+ case IDC_INDENTAMOUNT:
+ case IDC_LOADCOUNTN:
+ case IDC_LOADTIMEN:
+ case IDC_RIGHTINDENT:
+ case IDC_TRIM:
+ if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
+ return TRUE;
+ break;
+ case IDC_MODIFY:
+ {
+ TemplateEditorNew teNew = {0, 0, hwndDlg};
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_TEMPLATEEDIT), hwndDlg, DlgProcTemplateEditor, (LPARAM)&teNew);
}
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- case WM_NOTIFY:
- switch (((LPNMHDR) lParam)->idFrom) {
- case IDC_LOGOPTIONS:
- if (((LPNMHDR)lParam)->code == NM_CLICK || (((LPNMHDR)lParam)->code == TVN_KEYDOWN && ((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)) {
- TVHITTESTINFO hti;
- TVITEM item = {0};
-
- item.mask = TVIF_HANDLE | TVIF_STATE;
- item.stateMask = TVIS_STATEIMAGEMASK | TVIS_BOLD;
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti) || ((LPNMHDR)lParam)->code == TVN_KEYDOWN) {
- if (((LPNMHDR)lParam)->code == TVN_KEYDOWN) {
- hti.flags |= TVHT_ONITEMSTATEICON;
- item.hItem = TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom);
- } else
- item.hItem = (HTREEITEM)hti.hItem;
- SendDlgItemMessageA(hwndDlg, IDC_LOGOPTIONS, TVM_GETITEMA, 0, (LPARAM)&item);
- if (item.state & TVIS_BOLD && hti.flags & TVHT_ONITEMSTATEICON) {
- item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_BOLD;
- SendDlgItemMessageA(hwndDlg, IDC_LOGOPTIONS, TVM_SETITEMA, 0, (LPARAM)&item);
- } else if (hti.flags & TVHT_ONITEMSTATEICON) {
+ case IDC_RTLMODIFY:
+ {
+ TemplateEditorNew teNew = {0, TRUE, hwndDlg};
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_TEMPLATEEDIT), hwndDlg, DlgProcTemplateEditor, (LPARAM)&teNew);
+ }
+ break;
+ case IDC_MSGLOGDIDSPLAY:
+ SendMessage(hwndDlg, WM_USER + 100, 0, 0);
+ break;
+ }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
- if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 3) {
- item.state = INDEXTOSTATEIMAGEMASK(1);
- SendDlgItemMessageA(hwndDlg, IDC_LOGOPTIONS, TVM_SETITEMA, 0, (LPARAM)&item);
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case IDC_LOGOPTIONS:
+ if (((LPNMHDR)lParam)->code == NM_CLICK || (((LPNMHDR)lParam)->code == TVN_KEYDOWN && ((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)) {
+ TVHITTESTINFO hti;
+ TVITEM item = {0};
+
+ item.mask = TVIF_HANDLE | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK | TVIS_BOLD;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti) || ((LPNMHDR)lParam)->code == TVN_KEYDOWN) {
+ if (((LPNMHDR)lParam)->code == TVN_KEYDOWN) {
+ hti.flags |= TVHT_ONITEMSTATEICON;
+ item.hItem = TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom);
+ } else
+ item.hItem = (HTREEITEM)hti.hItem;
+ SendDlgItemMessageA(hwndDlg, IDC_LOGOPTIONS, TVM_GETITEMA, 0, (LPARAM)&item);
+ if (item.state & TVIS_BOLD && hti.flags & TVHT_ONITEMSTATEICON) {
+ item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_BOLD;
+ SendDlgItemMessageA(hwndDlg, IDC_LOGOPTIONS, TVM_SETITEMA, 0, (LPARAM)&item);
+ } else if (hti.flags & TVHT_ONITEMSTATEICON) {
+
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 3) {
+ item.state = INDEXTOSTATEIMAGEMASK(1);
+ SendDlgItemMessageA(hwndDlg, IDC_LOGOPTIONS, TVM_SETITEMA, 0, (LPARAM)&item);
}
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- break;
- default:
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY: {
- int i;
- TVITEM item = {0};
- LRESULT msglogmode = SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_GETCURSEL, 0, 0);
-
- dwFlags &= ~(MWF_LOG_ALL);
-
- if (IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT))
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
- else if (IsDlgButtonChecked(hwndDlg, IDC_LOADTIME))
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
- else
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
-
- M->WriteDword(SRMSGMOD_T, "IndentAmount", (DWORD) GetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, &translated, FALSE));
- M->WriteDword(SRMSGMOD_T, "RightIndent", (DWORD) GetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, &translated, FALSE));
-
- M->WriteByte(SRMSGMOD_T, "default_ieview", 0);
- M->WriteByte(SRMSGMOD_T, "default_hpp", 0);
- switch(msglogmode) {
- case 0:
- break;
- case 1:
- if (have_ieview)
- M->WriteByte(SRMSGMOD_T, "default_ieview", 1);
- else
- M->WriteByte(SRMSGMOD_T, "default_hpp", 1);
- break;
- case 2:
- M->WriteByte(SRMSGMOD_T, "default_hpp", 1);
- break;
- }
+ }
+ }
+ break;
- /*
- * scan the tree view and obtain the options...
- */
-
- TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_LOG);
- for (i=0; lvItems[i].szName != NULL; i++) {
- item.mask = TVIF_HANDLE | TVIF_STATE;
- item.hItem = (HTREEITEM)lvItems[i].handle;
- item.stateMask = TVIS_STATEIMAGEMASK;
+ default:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY:
+ int i;
+ TVITEM item = {0};
+ LRESULT msglogmode = SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_GETCURSEL, 0, 0);
- SendDlgItemMessageA(hwndDlg, IDC_LOGOPTIONS, TVM_GETITEMA, 0, (LPARAM)&item);
- if (lvItems[i].uType == LOI_TYPE_FLAG)
- dwFlags |= (item.state >> 12) == 3/*2*/ ? lvItems[i].lParam : 0;
- else if (lvItems[i].uType == LOI_TYPE_SETTING)
- M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)((item.state >> 12) == 3/*2*/ ? 1 : 0)); // NOTE: state image masks changed
- }
+ dwFlags &= ~(MWF_LOG_ALL);
- M->WriteDword(SRMSGMOD_T, "mwflags", dwFlags);
- if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM))
- M->WriteDword(SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
- else
- M->WriteDword(SRMSGMOD_T, "maxhist", 0);
- PluginConfig.reloadSettings();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
- return TRUE;
- }
- }
+ if (IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT))
+ M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
+ else if (IsDlgButtonChecked(hwndDlg, IDC_LOADTIME))
+ M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
+ else
+ M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
+ DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
+
+ M->WriteDword(SRMSGMOD_T, "IndentAmount", (DWORD) GetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, &translated, FALSE));
+ M->WriteDword(SRMSGMOD_T, "RightIndent", (DWORD) GetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, &translated, FALSE));
+
+ M->WriteByte(SRMSGMOD_T, "default_ieview", 0);
+ M->WriteByte(SRMSGMOD_T, "default_hpp", 0);
+ switch(msglogmode) {
+ case 0:
+ break;
+ case 1:
+ if (have_ieview)
+ M->WriteByte(SRMSGMOD_T, "default_ieview", 1);
+ else
+ M->WriteByte(SRMSGMOD_T, "default_hpp", 1);
+ break;
+ case 2:
+ M->WriteByte(SRMSGMOD_T, "default_hpp", 1);
break;
+ }
+
+ /*
+ * scan the tree view and obtain the options...
+ */
+
+ TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_LOG);
+ for (i=0; lvItems[i].szName != NULL; i++) {
+ item.mask = TVIF_HANDLE | TVIF_STATE;
+ item.hItem = (HTREEITEM)lvItems[i].handle;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+
+ SendDlgItemMessageA(hwndDlg, IDC_LOGOPTIONS, TVM_GETITEMA, 0, (LPARAM)&item);
+ if (lvItems[i].uType == LOI_TYPE_FLAG)
+ dwFlags |= (item.state >> 12) == 3/*2*/ ? lvItems[i].lParam : 0;
+ else if (lvItems[i].uType == LOI_TYPE_SETTING)
+ M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)((item.state >> 12) == 3/*2*/ ? 1 : 0)); // NOTE: state image masks changed
+ }
+
+ M->WriteDword(SRMSGMOD_T, "mwflags", dwFlags);
+ if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM))
+ M->WriteDword(SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
+ else
+ M->WriteDword(SRMSGMOD_T, "maxhist", 0);
+ PluginConfig.reloadSettings();
+ M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
+ return TRUE;
}
- break;
+ }
+ break;
}
return FALSE;
}
@@ -889,110 +895,109 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam static HANDLE hItemNew, hItemUnknown;
switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- {
- CLCINFOITEM cii = { 0 };
- cii.cbSize = sizeof(cii);
- cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
- cii.pszText = TranslateT("** New contacts **");
- hItemNew = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
- cii.pszText = TranslateT("** Unknown contacts **");
- hItemUnknown = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
- }
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE) | (CLS_SHOWHIDDEN));
- ResetCList(hwndDlg);
- RebuildList(hwndDlg, hItemNew, hItemUnknown);
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ {
+ CLCINFOITEM cii = { 0 };
+ cii.cbSize = sizeof(cii);
+ cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
+ cii.pszText = TranslateT("** New contacts **");
+ hItemNew = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
+ cii.pszText = TranslateT("** Unknown contacts **");
+ hItemUnknown = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
+ }
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE) | (CLS_SHOWHIDDEN));
+ ResetCList(hwndDlg);
+ RebuildList(hwndDlg, hItemNew, hItemUnknown);
- CheckDlgButton(hwndDlg, IDC_SHOWNOTIFY, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING));
- CheckDlgButton(hwndDlg, IDC_TYPEFLASHWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH));
+ CheckDlgButton(hwndDlg, IDC_SHOWNOTIFY, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING));
+ CheckDlgButton(hwndDlg, IDC_TYPEFLASHWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH));
- CheckDlgButton(hwndDlg, IDC_TYPENOWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1));
- CheckDlgButton(hwndDlg, IDC_TYPEWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1));
- CheckDlgButton(hwndDlg, IDC_NOTIFYTRAY, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST));
- CheckDlgButton(hwndDlg, IDC_NOTIFYBALLOON, M->GetByte(SRMSGMOD, "ShowTypingBalloon", 0));
+ CheckDlgButton(hwndDlg, IDC_TYPENOWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1));
+ CheckDlgButton(hwndDlg, IDC_TYPEWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1));
+ CheckDlgButton(hwndDlg, IDC_NOTIFYTRAY, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST));
+ CheckDlgButton(hwndDlg, IDC_NOTIFYBALLOON, M->GetByte(SRMSGMOD, "ShowTypingBalloon", 0));
- CheckDlgButton(hwndDlg, IDC_NOTIFYPOPUP, M->GetByte(SRMSGMOD, "ShowTypingPopup", 0));
+ CheckDlgButton(hwndDlg, IDC_NOTIFYPOPUP, M->GetByte(SRMSGMOD, "ShowTypingPopup", 0));
- Utils::enableDlgControl(hwndDlg, IDC_TYPEWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
- Utils::enableDlgControl(hwndDlg, IDC_TYPENOWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
- Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY) &&
- (IsDlgButtonChecked(hwndDlg, IDC_TYPEWIN) || IsDlgButtonChecked(hwndDlg, IDC_TYPENOWIN)));
+ Utils::enableDlgControl(hwndDlg, IDC_TYPEWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
+ Utils::enableDlgControl(hwndDlg, IDC_TYPENOWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
+ Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY) &&
+ (IsDlgButtonChecked(hwndDlg, IDC_TYPEWIN) || IsDlgButtonChecked(hwndDlg, IDC_TYPENOWIN)));
- Utils::enableDlgControl(hwndDlg, IDC_TYPEFLASHWIN, IsDlgButtonChecked(hwndDlg, IDC_SHOWNOTIFY));
- Utils::enableDlgControl(hwndDlg, IDC_MTN_POPUPMODE, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYPOPUP));
+ Utils::enableDlgControl(hwndDlg, IDC_TYPEFLASHWIN, IsDlgButtonChecked(hwndDlg, IDC_SHOWNOTIFY));
+ Utils::enableDlgControl(hwndDlg, IDC_MTN_POPUPMODE, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYPOPUP));
- if (!ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
- Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, FALSE);
- SetWindowText(GetDlgItem(hwndDlg, IDC_NOTIFYBALLOON), TranslateT("Show balloon popup (unsupported system)"));
- }
+ if (!ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
+ Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, FALSE);
+ SetWindowText(GetDlgItem(hwndDlg, IDC_NOTIFYBALLOON), TranslateT("Show balloon popup (unsupported system)"));
+ }
- SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always"));
- SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always, but no popup when window is focused"));
- SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Only when no message window is open"));
+ SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always"));
+ SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always, but no popup when window is focused"));
+ SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Only when no message window is open"));
- SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_SETCURSEL, (WPARAM)M->GetByte("MTN_PopupMode", 0), 0);
+ SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_SETCURSEL, (WPARAM)M->GetByte("MTN_PopupMode", 0), 0);
- if (!PluginConfig.g_PopupAvail) {
- Utils::showDlgControl(hwndDlg, IDC_NOTIFYPOPUP, SW_HIDE);
- Utils::showDlgControl(hwndDlg, IDC_STATIC111, SW_HIDE);
- Utils::showDlgControl(hwndDlg, IDC_MTN_POPUPMODE, SW_HIDE);
- }
+ if (!PluginConfig.g_PopupAvail) {
+ Utils::showDlgControl(hwndDlg, IDC_NOTIFYPOPUP, SW_HIDE);
+ Utils::showDlgControl(hwndDlg, IDC_STATIC111, SW_HIDE);
+ Utils::showDlgControl(hwndDlg, IDC_MTN_POPUPMODE, SW_HIDE);
+ }
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_NOTIFYTRAY:
+ Utils::enableDlgControl(hwndDlg, IDC_TYPEWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
+ Utils::enableDlgControl(hwndDlg, IDC_TYPENOWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
+ Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
break;
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_NOTIFYTRAY:
- Utils::enableDlgControl(hwndDlg, IDC_TYPEWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
- Utils::enableDlgControl(hwndDlg, IDC_TYPENOWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
- Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
- break;
- case IDC_SHOWNOTIFY:
- Utils::enableDlgControl(hwndDlg, IDC_TYPEFLASHWIN, IsDlgButtonChecked(hwndDlg, IDC_SHOWNOTIFY));
- break;
- case IDC_NOTIFYPOPUP:
- Utils::enableDlgControl(hwndDlg, IDC_MTN_POPUPMODE, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYPOPUP));
- break;
- case IDC_TYPEWIN:
- case IDC_TYPENOWIN:
- Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY) &&
- (IsDlgButtonChecked(hwndDlg, IDC_TYPEWIN) || IsDlgButtonChecked(hwndDlg, IDC_TYPENOWIN)));
- break;
- case IDC_MTN_HELP:
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://wiki.miranda.or.at/TabSRMM/TypingNotifications");
- return 0;
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ case IDC_SHOWNOTIFY:
+ Utils::enableDlgControl(hwndDlg, IDC_TYPEFLASHWIN, IsDlgButtonChecked(hwndDlg, IDC_SHOWNOTIFY));
break;
- case WM_NOTIFY:
- switch (((NMHDR *) lParam)->idFrom) {
- case IDC_CLIST:
- switch (((NMHDR *) lParam)->code) {
- case CLN_OPTIONSCHANGED:
- ResetCList(hwndDlg);
- break;
- case CLN_CHECKCHANGED:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
- break;
- case 0:
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY: {
- SaveList(hwndDlg, hItemNew, hItemUnknown);
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPING, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWNOTIFY));
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPEFLASHWIN));
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPENOWIN));
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPEWIN));
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
- M->WriteByte(SRMSGMOD, "ShowTypingBalloon", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYBALLOON));
- M->WriteByte(SRMSGMOD, "ShowTypingPopup",(BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYPOPUP));
- M->WriteByte(SRMSGMOD_T, "MTN_PopupMode", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
- PluginConfig.reloadSettings();
- }
- }
- break;
+ case IDC_NOTIFYPOPUP:
+ Utils::enableDlgControl(hwndDlg, IDC_MTN_POPUPMODE, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYPOPUP));
+ break;
+ case IDC_TYPEWIN:
+ case IDC_TYPENOWIN:
+ Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY) &&
+ (IsDlgButtonChecked(hwndDlg, IDC_TYPEWIN) || IsDlgButtonChecked(hwndDlg, IDC_TYPENOWIN)));
+ break;
+ case IDC_MTN_HELP:
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://wiki.miranda.or.at/TabSRMM/TypingNotifications");
+ return 0;
+ }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_NOTIFY:
+ switch (((NMHDR *) lParam)->idFrom) {
+ case IDC_CLIST:
+ switch (((NMHDR *) lParam)->code) {
+ case CLN_OPTIONSCHANGED:
+ ResetCList(hwndDlg);
+ break;
+ case CLN_CHECKCHANGED:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
}
break;
+ case 0:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY:
+ SaveList(hwndDlg, hItemNew, hItemUnknown);
+ M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPING, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWNOTIFY));
+ M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPEFLASHWIN));
+ M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPENOWIN));
+ M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPEWIN));
+ M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
+ M->WriteByte(SRMSGMOD, "ShowTypingBalloon", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYBALLOON));
+ M->WriteByte(SRMSGMOD, "ShowTypingPopup",(BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYPOPUP));
+ M->WriteByte(SRMSGMOD_T, "MTN_PopupMode", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
+ PluginConfig.reloadSettings();
+ }
+ }
}
return FALSE;
}
@@ -1148,92 +1153,87 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar static INT_PTR CALLBACK DlgProcContainerSettings(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
- case WM_INITDIALOG: {
- DBVARIANT dbv = {0};
-
- TranslateDialogDefault(hwndDlg);
-
- CheckDlgButton(hwndDlg, IDC_CONTAINERGROUPMODE, M->GetByte("useclistgroups", 0));
- CheckDlgButton(hwndDlg, IDC_LIMITTABS, M->GetByte("limittabs", 0));
-
- SendDlgItemMessage(hwndDlg, IDC_TABLIMITSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 1));
- SendDlgItemMessage(hwndDlg, IDC_TABLIMITSPIN, UDM_SETPOS, 0, (int)M->GetDword("maxtabs", 1));
- SetDlgItemInt(hwndDlg, IDC_TABLIMIT, (int)M->GetDword("maxtabs", 1), FALSE);
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_CONTAINERGROUPMODE, M->GetByte("useclistgroups", 0));
+ CheckDlgButton(hwndDlg, IDC_LIMITTABS, M->GetByte("limittabs", 0));
+
+ SendDlgItemMessage(hwndDlg, IDC_TABLIMITSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 1));
+ SendDlgItemMessage(hwndDlg, IDC_TABLIMITSPIN, UDM_SETPOS, 0, (int)M->GetDword("maxtabs", 1));
+ SetDlgItemInt(hwndDlg, IDC_TABLIMIT, (int)M->GetDword("maxtabs", 1), FALSE);
+ Utils::enableDlgControl(hwndDlg, IDC_TABLIMIT, IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS));
+ CheckDlgButton(hwndDlg, IDC_SINGLEWINDOWMODE, M->GetByte("singlewinmode", 0));
+ CheckDlgButton(hwndDlg, IDC_DEFAULTCONTAINERMODE, !(IsDlgButtonChecked(hwndDlg, IDC_CONTAINERGROUPMODE) || IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS) || IsDlgButtonChecked(hwndDlg, IDC_SINGLEWINDOWMODE)));
+
+ SetDlgItemInt(hwndDlg, IDC_NRFLASH, M->GetByte("nrflash", 4), FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_NRFLASHSPIN, UDM_SETRANGE, 0, MAKELONG(255, 1));
+ SendDlgItemMessage(hwndDlg, IDC_NRFLASHSPIN, UDM_SETPOS, 0, (int)M->GetByte("nrflash", 4));
+
+ SetDlgItemInt(hwndDlg, IDC_FLASHINTERVAL, M->GetDword("flashinterval", 1000), FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETRANGE, 0, MAKELONG(10000, 500));
+ SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETPOS, 0, (int)M->GetDword("flashinterval", 1000));
+ SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETACCEL, 0, (int)M->GetDword("flashinterval", 1000));
+ CheckDlgButton(hwndDlg, IDC_USEAERO, M->GetByte("useAero", 1));
+ CheckDlgButton(hwndDlg, IDC_USEAEROPEEK, M->GetByte("useAeroPeek", 1));
+ for (int i = 0; i < CSkin::AERO_EFFECT_LAST; i++)
+ SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_INSERTSTRING, -1, (LPARAM)TranslateTS(CSkin::m_aeroEffects[i].tszName));
+
+ SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_SETCURSEL, (WPARAM)CSkin::m_aeroEffect, 0);
+ Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, PluginConfig.m_bIsVista ? TRUE : FALSE);
+ Utils::enableDlgControl(hwndDlg, IDC_USEAERO, PluginConfig.m_bIsVista ? TRUE : FALSE);
+ Utils::enableDlgControl(hwndDlg, IDC_USEAEROPEEK, PluginConfig.m_bIsWin7 ? TRUE : FALSE);
+ if (PluginConfig.m_bIsVista)
+ Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_TABLIMIT:
+ if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
+ return TRUE;
+ break;
+ case IDC_USEAERO:
+ Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
+ break;
+ case IDC_LIMITTABS:
+ case IDC_SINGLEWINDOWMODE:
+ case IDC_CONTAINERGROUPMODE:
+ case IDC_DEFAULTCONTAINERMODE:
Utils::enableDlgControl(hwndDlg, IDC_TABLIMIT, IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS));
- CheckDlgButton(hwndDlg, IDC_SINGLEWINDOWMODE, M->GetByte("singlewinmode", 0));
- CheckDlgButton(hwndDlg, IDC_DEFAULTCONTAINERMODE, !(IsDlgButtonChecked(hwndDlg, IDC_CONTAINERGROUPMODE) || IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS) || IsDlgButtonChecked(hwndDlg, IDC_SINGLEWINDOWMODE)));
-
- SetDlgItemInt(hwndDlg, IDC_NRFLASH, M->GetByte("nrflash", 4), FALSE);
- SendDlgItemMessage(hwndDlg, IDC_NRFLASHSPIN, UDM_SETRANGE, 0, MAKELONG(255, 1));
- SendDlgItemMessage(hwndDlg, IDC_NRFLASHSPIN, UDM_SETPOS, 0, (int)M->GetByte("nrflash", 4));
-
- SetDlgItemInt(hwndDlg, IDC_FLASHINTERVAL, M->GetDword("flashinterval", 1000), FALSE);
- SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETRANGE, 0, MAKELONG(10000, 500));
- SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETPOS, 0, (int)M->GetDword("flashinterval", 1000));
- SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETACCEL, 0, (int)M->GetDword("flashinterval", 1000));
- CheckDlgButton(hwndDlg, IDC_USEAERO, M->GetByte("useAero", 1));
- CheckDlgButton(hwndDlg, IDC_USEAEROPEEK, M->GetByte("useAeroPeek", 1));
- for (int i = 0; i < CSkin::AERO_EFFECT_LAST; i++)
- SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_INSERTSTRING, -1, (LPARAM)TranslateTS(CSkin::m_aeroEffects[i].tszName));
-
- SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_SETCURSEL, (WPARAM)CSkin::m_aeroEffect, 0);
- Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, PluginConfig.m_bIsVista ? TRUE : FALSE);
- Utils::enableDlgControl(hwndDlg, IDC_USEAERO, PluginConfig.m_bIsVista ? TRUE : FALSE);
- Utils::enableDlgControl(hwndDlg, IDC_USEAEROPEEK, PluginConfig.m_bIsWin7 ? TRUE : FALSE);
- if (PluginConfig.m_bIsVista)
- Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
-
- return TRUE;
- }
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_TABLIMIT:
- if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
- return TRUE;
- break;
- case IDC_USEAERO:
- Utils::enableDlgControl(hwndDlg, IDC_AEROEFFECT, IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
- break;
- case IDC_LIMITTABS:
- case IDC_SINGLEWINDOWMODE:
- case IDC_CONTAINERGROUPMODE:
- case IDC_DEFAULTCONTAINERMODE:
- Utils::enableDlgControl(hwndDlg, IDC_TABLIMIT, IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS));
- break;
- case IDC_HELP_CONTAINERS:
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://wiki.miranda.or.at/TabSRMM/Containers");
- break;
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- case WM_NOTIFY:
- switch (((LPNMHDR) lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY: {
- BOOL translated;
+ case IDC_HELP_CONTAINERS:
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://wiki.miranda.or.at/TabSRMM/Containers");
+ break;
+ }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
- bool fOldAeroState = M->getAeroState();
- M->WriteByte(SRMSGMOD_T, "useclistgroups", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CONTAINERGROUPMODE)));
- M->WriteByte(SRMSGMOD_T, "limittabs", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS)));
- M->WriteDword(SRMSGMOD_T, "maxtabs", GetDlgItemInt(hwndDlg, IDC_TABLIMIT, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, "singlewinmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SINGLEWINDOWMODE)));
- M->WriteDword(SRMSGMOD_T, "flashinterval", GetDlgItemInt(hwndDlg, IDC_FLASHINTERVAL, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, "nrflash", (BYTE)(GetDlgItemInt(hwndDlg, IDC_NRFLASH, &translated, FALSE)));
- M->WriteByte(0, SRMSGMOD_T, "useAero", IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
- M->WriteByte(0, SRMSGMOD_T, "useAeroPeek", IsDlgButtonChecked(hwndDlg, IDC_USEAEROPEEK) ? 1 : 0);
- CSkin::setAeroEffect(SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_GETCURSEL, 0, 0));
-
- if (M->getAeroState() != fOldAeroState) {
- SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOMPOSITIONCHANGED, 0, 0); // simulate aero state change
- SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOLORIZATIONCOLORCHANGED, 0, 0); // simulate aero state change
- }
- BuildContainerMenu();
- return TRUE;
- }
- }
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY:
+ BOOL translated;
+ bool fOldAeroState = M->getAeroState();
+ M->WriteByte(SRMSGMOD_T, "useclistgroups", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CONTAINERGROUPMODE)));
+ M->WriteByte(SRMSGMOD_T, "limittabs", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS)));
+ M->WriteDword(SRMSGMOD_T, "maxtabs", GetDlgItemInt(hwndDlg, IDC_TABLIMIT, &translated, FALSE));
+ M->WriteByte(SRMSGMOD_T, "singlewinmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SINGLEWINDOWMODE)));
+ M->WriteDword(SRMSGMOD_T, "flashinterval", GetDlgItemInt(hwndDlg, IDC_FLASHINTERVAL, &translated, FALSE));
+ M->WriteByte(SRMSGMOD_T, "nrflash", (BYTE)(GetDlgItemInt(hwndDlg, IDC_NRFLASH, &translated, FALSE)));
+ M->WriteByte(0, SRMSGMOD_T, "useAero", IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
+ M->WriteByte(0, SRMSGMOD_T, "useAeroPeek", IsDlgButtonChecked(hwndDlg, IDC_USEAEROPEEK) ? 1 : 0);
+ CSkin::setAeroEffect(SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_GETCURSEL, 0, 0));
+
+ if (M->getAeroState() != fOldAeroState) {
+ SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOMPOSITIONCHANGED, 0, 0); // simulate aero state change
+ SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOLORIZATIONCOLORCHANGED, 0, 0); // simulate aero state change
+ }
+ BuildContainerMenu();
+ return TRUE;
}
- break;
+ }
+ break;
}
return FALSE;
}
@@ -1393,11 +1393,9 @@ struct OptCheckBox DWORD OptCheckBox_LoadValue(struct OptCheckBox *cb)
{
- switch (cb->valueType)
- {
+ switch (cb->valueType) {
case CBVT_NONE:
- switch (cb->dbType)
- {
+ switch (cb->dbType) {
case DBVT_BYTE:
return M->GetByte(cb->dbModule, cb->dbSetting, cb->defValue);
case DBVT_WORD:
@@ -1433,14 +1431,12 @@ void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb) {
DWORD value = IsDlgButtonChecked(hwnd, cb->idc) == BST_CHECKED;
- if (cb->dwBit)
- {
+ if (cb->dwBit) {
DWORD curValue = OptCheckBox_LoadValue(cb);
value = value ? (curValue | cb->dwBit) : (curValue & ~cb->dwBit);
}
- switch (cb->dbType)
- {
+ switch (cb->dbType) {
case DBVT_BYTE:
M->WriteByte(cb->dbModule, cb->dbSetting, (BYTE)value);
break;
@@ -1452,8 +1448,7 @@ void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb) break;
}
- switch (cb->valueType)
- {
+ switch (cb->valueType) {
case CBVT_CHAR:
*cb->charValue = (char)value;
break;
@@ -1494,38 +1489,35 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR static BOOL bInit = TRUE;
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
{
- int i = 0;
DWORD maxhist = M->GetDword("maxhist", 0);
bInit = TRUE;
- TranslateDialogDefault(hwndDlg);
-
- for (i=0; i < SIZEOF(opts); ++i)
+ for (int i=0; i < SIZEOF(opts); ++i)
OptCheckBox_Load(hwndDlg, opts+i);
// Always on!
CheckDlgButton(hwndDlg, IDC_SENDCTRLENTER, BST_CHECKED);
switch (M->GetByte(SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
- case LOADHISTORY_UNREAD:
- CheckDlgButton(hwndDlg, IDC_LOADUNREAD, BST_CHECKED);
- break;
- case LOADHISTORY_COUNT:
- CheckDlgButton(hwndDlg, IDC_LOADCOUNT, BST_CHECKED);
- Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTN, TRUE);
- Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTSPIN, TRUE);
- break;
- case LOADHISTORY_TIME:
- CheckDlgButton(hwndDlg, IDC_LOADTIME, BST_CHECKED);
- Utils::enableDlgControl(hwndDlg, IDC_LOADTIMEN, TRUE);
- Utils::enableDlgControl(hwndDlg, IDC_LOADTIMESPIN, TRUE);
- Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, TRUE);
- break;
+ case LOADHISTORY_UNREAD:
+ CheckDlgButton(hwndDlg, IDC_LOADUNREAD, BST_CHECKED);
+ break;
+ case LOADHISTORY_COUNT:
+ CheckDlgButton(hwndDlg, IDC_LOADCOUNT, BST_CHECKED);
+ Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTN, TRUE);
+ Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTSPIN, TRUE);
+ break;
+ case LOADHISTORY_TIME:
+ CheckDlgButton(hwndDlg, IDC_LOADTIME, BST_CHECKED);
+ Utils::enableDlgControl(hwndDlg, IDC_LOADTIMEN, TRUE);
+ Utils::enableDlgControl(hwndDlg, IDC_LOADTIMESPIN, TRUE);
+ Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, TRUE);
+ break;
}
SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
@@ -1539,104 +1531,91 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR Utils::enableDlgControl(hwndDlg, IDC_TRIM, maxhist != 0);
CheckDlgButton(hwndDlg, IDC_ALWAYSTRIM, maxhist != 0);
- {
- BOOL bTabOptGroups = M->GetByte("useclistgroups", 0);
- BOOL bTabOptLimit = M->GetByte("limittabs", 0);
- BOOL bTabOptSingle = M->GetByte("singlewinmode", 0);
-
- if (bTabOptSingle && !bTabOptGroups && !bTabOptLimit)
- CheckDlgButton(hwndDlg, IDC_USETABS, BST_UNCHECKED);
- else if (!bTabOptSingle && !bTabOptGroups && !bTabOptLimit)
- CheckDlgButton(hwndDlg, IDC_USETABS, BST_CHECKED);
- else
- {
- LONG s = (GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_USETABS), GWL_STYLE) & ~BS_TYPEMASK) | BS_AUTO3STATE;
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_USETABS), GWL_STYLE, s);
- CheckDlgButton(hwndDlg, IDC_USETABS, BST_INDETERMINATE);
- }
- }
+ BOOL bTabOptGroups = M->GetByte("useclistgroups", 0);
+ BOOL bTabOptLimit = M->GetByte("limittabs", 0);
+ BOOL bTabOptSingle = M->GetByte("singlewinmode", 0);
- bInit = FALSE;
- return TRUE;
+ if (bTabOptSingle && !bTabOptGroups && !bTabOptLimit)
+ CheckDlgButton(hwndDlg, IDC_USETABS, BST_UNCHECKED);
+ else if (!bTabOptSingle && !bTabOptGroups && !bTabOptLimit)
+ CheckDlgButton(hwndDlg, IDC_USETABS, BST_CHECKED);
+ else {
+ LONG s = (GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_USETABS), GWL_STYLE) & ~BS_TYPEMASK) | BS_AUTO3STATE;
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_USETABS), GWL_STYLE, s);
+ CheckDlgButton(hwndDlg, IDC_USETABS, BST_INDETERMINATE);
+ }
}
+ bInit = FALSE;
+ return TRUE;
- case WM_DESTROY:
- bInit = TRUE;
- break;
+ case WM_DESTROY:
+ bInit = TRUE;
+ break;
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_LOADUNREAD:
- case IDC_LOADCOUNT:
- case IDC_LOADTIME:
- Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTN, IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT));
- Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTSPIN, IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT));
- Utils::enableDlgControl(hwndDlg, IDC_LOADTIMEN, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
- Utils::enableDlgControl(hwndDlg, IDC_LOADTIMESPIN, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
- Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
- break;
- case IDC_ALWAYSTRIM:
- Utils::enableDlgControl(hwndDlg, IDC_TRIMSPIN, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM));
- Utils::enableDlgControl(hwndDlg, IDC_TRIM, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM));
- break;
- case IDC_TRIM:
- if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
- return TRUE;
- break;
- }
- if (!bInit)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_LOADUNREAD:
+ case IDC_LOADCOUNT:
+ case IDC_LOADTIME:
+ Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTN, IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT));
+ Utils::enableDlgControl(hwndDlg, IDC_LOADCOUNTSPIN, IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT));
+ Utils::enableDlgControl(hwndDlg, IDC_LOADTIMEN, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
+ Utils::enableDlgControl(hwndDlg, IDC_LOADTIMESPIN, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
+ Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, IsDlgButtonChecked(hwndDlg, IDC_LOADTIME));
+ break;
+ case IDC_ALWAYSTRIM:
+ Utils::enableDlgControl(hwndDlg, IDC_TRIMSPIN, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM));
+ Utils::enableDlgControl(hwndDlg, IDC_TRIM, IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM));
+ break;
+ case IDC_TRIM:
+ if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
+ return TRUE;
break;
+ }
+ if (!bInit)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
- case WM_NOTIFY:
- {
- switch (((LPNMHDR) lParam)->idFrom)
- {
- case 0:
- switch (((LPNMHDR) lParam)->code)
- {
- case PSN_APPLY:
- {
- int i;
- for (i=0; i < SIZEOF(opts); ++i)
- OptCheckBox_Save(hwndDlg, opts+i);
-
- if (IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT))
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
- else if (IsDlgButtonChecked(hwndDlg, IDC_LOADTIME))
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
- else
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
-
- if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM))
- M->WriteDword(SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
- else
- M->WriteDword(SRMSGMOD_T, "maxhist", 0);
-
- switch (IsDlgButtonChecked(hwndDlg, IDC_USETABS))
- {
- case BST_UNCHECKED:
- M->WriteByte(SRMSGMOD_T, "useclistgroups", 0);
- M->WriteByte(SRMSGMOD_T, "limittabs", 0);
- M->WriteByte(SRMSGMOD_T, "singlewinmode", 1);
- break;
- case BST_CHECKED:
- M->WriteByte(SRMSGMOD_T, "useclistgroups", 0);
- M->WriteByte(SRMSGMOD_T, "limittabs", 0);
- M->WriteByte(SRMSGMOD_T, "singlewinmode", 0);
- break;
- }
- PluginConfig.reloadSettings();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
- return TRUE;
- }
- }
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY:
+ for (int i=0; i < SIZEOF(opts); ++i)
+ OptCheckBox_Save(hwndDlg, opts+i);
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT))
+ M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
+ else if (IsDlgButtonChecked(hwndDlg, IDC_LOADTIME))
+ M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
+ else
+ M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
+ DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM))
+ M->WriteDword(SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
+ else
+ M->WriteDword(SRMSGMOD_T, "maxhist", 0);
+
+ switch (IsDlgButtonChecked(hwndDlg, IDC_USETABS)) {
+ case BST_UNCHECKED:
+ M->WriteByte(SRMSGMOD_T, "useclistgroups", 0);
+ M->WriteByte(SRMSGMOD_T, "limittabs", 0);
+ M->WriteByte(SRMSGMOD_T, "singlewinmode", 1);
+ break;
+ case BST_CHECKED:
+ M->WriteByte(SRMSGMOD_T, "useclistgroups", 0);
+ M->WriteByte(SRMSGMOD_T, "limittabs", 0);
+ M->WriteByte(SRMSGMOD_T, "singlewinmode", 0);
break;
+ }
+ PluginConfig.reloadSettings();
+ M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
+ return TRUE;
}
- break;
}
+ break;
}
return FALSE;
@@ -1685,64 +1664,57 @@ INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM wParam, static HWND hwndParent = 0;
switch (msg) {
- case WM_INITDIALOG: {
- int i;
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+ dwStatusMask = lParam;
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- dwStatusMask = lParam;
-
- SetWindowText(hwndDlg, TranslateT("Choose status modes"));
- for (i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ SetWindowText(hwndDlg, TranslateT("Choose status modes"));
+ {
+ for (int i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
SetWindowText(GetDlgItem(hwndDlg, i), (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, GSMDF_TCHAR));
if (dwStatusMask != -1 && (dwStatusMask & (1 << (i - ID_STATUS_ONLINE))))
CheckDlgButton(hwndDlg, i, TRUE);
Utils::enableDlgControl(hwndDlg, i, dwStatusMask != -1);
}
- if (dwStatusMask == -1)
- CheckDlgButton(hwndDlg, IDC_ALWAYS, TRUE);
- ShowWindow(hwndDlg, SW_SHOWNORMAL);
- return TRUE;
}
- case DM_SETPARENTDIALOG:
- hwndParent = (HWND)lParam;
- break;
- case DM_GETSTATUSMASK: {
- if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYS))
- dwNewStatusMask = -1;
- else {
- int i;
- dwNewStatusMask = 0;
- for (i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- dwNewStatusMask |= (IsDlgButtonChecked(hwndDlg, i) ? (1 << (i - ID_STATUS_ONLINE)) : 0);
- }
- break;
+ if (dwStatusMask == -1)
+ CheckDlgButton(hwndDlg, IDC_ALWAYS, TRUE);
+ ShowWindow(hwndDlg, SW_SHOWNORMAL);
+ return TRUE;
+
+ case DM_SETPARENTDIALOG:
+ hwndParent = (HWND)lParam;
+ break;
+ case DM_GETSTATUSMASK:
+ if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYS))
+ dwNewStatusMask = -1;
+ else {
+ dwNewStatusMask = 0;
+ for (int i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ dwNewStatusMask |= (IsDlgButtonChecked(hwndDlg, i) ? (1 << (i - ID_STATUS_ONLINE)) : 0);
}
- case WM_COMMAND: {
- switch (LOWORD(wParam)) {
- case IDOK:
- case IDCANCEL:
- if (LOWORD(wParam) == IDOK) {
- SendMessage(hwndDlg, DM_GETSTATUSMASK, 0, 0);
- SendMessage(hwndParent, DM_STATUSMASKSET, 0, (LPARAM)dwNewStatusMask);
- }
- DestroyWindow(hwndDlg);
- break;
- case IDC_ALWAYS: {
- int i;
- for (i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- Utils::enableDlgControl(hwndDlg, i, !IsDlgButtonChecked(hwndDlg, IDC_ALWAYS));
- break;
- }
- default:
- break;
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDOK:
+ case IDCANCEL:
+ if (LOWORD(wParam) == IDOK) {
+ SendMessage(hwndDlg, DM_GETSTATUSMASK, 0, 0);
+ SendMessage(hwndParent, DM_STATUSMASKSET, 0, (LPARAM)dwNewStatusMask);
}
- }
- case WM_DESTROY:
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
+ DestroyWindow(hwndDlg);
break;
- default:
+ case IDC_ALWAYS:
+ for (int i=ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ Utils::enableDlgControl(hwndDlg, i, !IsDlgButtonChecked(hwndDlg, IDC_ALWAYS));
break;
+ }
+
+ case WM_DESTROY:
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
+ break;
}
return FALSE;
}
|