summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/tabmodplus
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-04 20:37:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-04 20:37:42 +0000
commitc56d8aa7eb2dcaed8420770df76b79747b6c2247 (patch)
treeafcec8962f13912c388b4c02b373b781c290cd3e /plugins/TabSRMM/tabmodplus
parent6cc150354bd07c0e7f6e50bd5eca489fe71b63c0 (diff)
more translation fixes for tabs
git-svn-id: http://svn.miranda-ng.org/main/trunk@307 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/tabmodplus')
-rw-r--r--plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp268
1 files changed, 125 insertions, 143 deletions
diff --git a/plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp b/plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp
index 7b2c19bd26..ecacf9af49 100644
--- a/plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp
+++ b/plugins/TabSRMM/tabmodplus/msgoptions_plus.cpp
@@ -41,167 +41,149 @@ extern HINSTANCE hinstance;
extern BOOL g_bIMGtagButton;
extern HIMAGELIST g_himlOptions, CreateStateImageList();
+static void FillDialog(HWND hwndDlg)
+{
+ TVINSERTSTRUCT tvi = {0};
+ int i;
+
+ TOptionListGroup *lvGroups = CTranslator::getGroupTree(CTranslator::TREE_MODPLUS);
+ for (i=0; lvGroups[i].szName != NULL; i++) {
+ tvi.hParent = 0;
+ tvi.hInsertAfter = TVI_LAST;
+ tvi.item.mask = TVIF_TEXT | TVIF_STATE;
+ tvi.item.pszText = TranslateTS(lvGroups[i].szName);
+ tvi.item.stateMask = TVIS_STATEIMAGEMASK | TVIS_EXPANDED | TVIS_BOLD;
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_EXPANDED | TVIS_BOLD;
+ lvGroups[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), &tvi);
+ }
+
+ TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_MODPLUS);
+ for (i=0; lvItems[i].szName != 0; i++) {
+ tvi.hParent = (HTREEITEM)lvGroups[lvItems[i].uGroup].handle;
+ tvi.hInsertAfter = TVI_LAST;
+ tvi.item.pszText = TranslateTS(lvItems[i].szName);
+ tvi.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_PARAM;
+ tvi.item.lParam = i;
+ tvi.item.stateMask = TVIS_STATEIMAGEMASK;
+ if (lvItems[i].uType == LOI_TYPE_SETTING)
+ 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_PLUS_CHECKTREE), &tvi);
+ }
+
+ PluginConfig.g_bClientInStatusBar = M->GetByte("adv_ClientIconInStatusBar", 0);
+
+ SendDlgItemMessage(hwndDlg, IDC_TIMEOUTSPIN, UDM_SETRANGE, 0, MAKELONG(300, SRMSGSET_MSGTIMEOUT_MIN / 1000));
+ SendDlgItemMessage(hwndDlg, IDC_TIMEOUTSPIN, UDM_SETPOS, 0, PluginConfig.m_MsgTimeout / 1000);
+
+ SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_SETRANGE, 0, MAKELONG(255, 15));
+ SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_SETPOS, 0, (int)M->GetByte("historysize", 0));
+}
+
INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg) {
-
- case WM_INITDIALOG: {
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
-
- g_himlOptions = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_PLUS_CHECKTREE, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
- ImageList_Destroy(g_himlOptions);
-
- /*
- * fill the list box, create groups first, then add items
- */
-
- SendMessage(hwndDlg, WM_USER + 100, 0, 0);
-
- return TRUE;
- }
- case WM_NOTIFY:
- switch (((LPNMHDR) lParam)->idFrom) {
- case IDC_PLUS_CHECKTREE:
- 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_PLUS_CHECKTREE, TVM_GETITEMA, 0, (LPARAM)&item);
- if (item.state & TVIS_BOLD && hti.flags & TVHT_ONITEMSTATEICON) {
- item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_BOLD;
- SendDlgItemMessageA(hwndDlg, IDC_PLUS_CHECKTREE, 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_PLUS_CHECKTREE, TVM_SETITEMA, 0, (LPARAM)&item);
- }
-
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
+
+ g_himlOptions = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_PLUS_CHECKTREE, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
+ ImageList_Destroy(g_himlOptions);
+
+ FillDialog(hwndDlg);
+ return TRUE;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case IDC_PLUS_CHECKTREE:
+ 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_PLUS_CHECKTREE, TVM_GETITEMA, 0, (LPARAM)&item);
+ if (item.state & TVIS_BOLD && hti.flags & TVHT_ONITEMSTATEICON) {
+ item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_BOLD;
+ SendDlgItemMessageA(hwndDlg, IDC_PLUS_CHECKTREE, 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_PLUS_CHECKTREE, TVM_SETITEMA, 0, (LPARAM)&item);
}
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- break;
- default:
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY: {
- int i = 0;
- TVITEM item = {0};
- DWORD msgTimeout;
- /*
- * scan the tree view and obtain the options...
- */
- TOptionListItem* lvItems = CTranslator::getTree(CTranslator::TREE_MODPLUS);
-
- while (lvItems[i].szName != NULL) {
- item.mask = TVIF_HANDLE | TVIF_STATE;
- item.hItem = (HTREEITEM)lvItems[i].handle;
- item.stateMask = TVIS_STATEIMAGEMASK;
-
- SendDlgItemMessageA(hwndDlg, IDC_PLUS_CHECKTREE, TVM_GETITEMA, 0, (LPARAM)&item);
- 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
- i++;
- }
-
- msgTimeout = 1000 * GetDlgItemInt(hwndDlg, IDC_SECONDS, NULL, FALSE);
- PluginConfig.m_MsgTimeout = msgTimeout >= SRMSGSET_MSGTIMEOUT_MIN ? msgTimeout : SRMSGSET_MSGTIMEOUT_MIN;
- M->WriteDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, PluginConfig.m_MsgTimeout);
-
- M->WriteByte(SRMSGMOD_T, "historysize", (BYTE)SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_GETPOS, 0, 0));
- PluginConfig.reloadAdv();
- return TRUE;
- }
- }
- break;
}
- break;
- case WM_COMMAND: {
- if(LOWORD(wParam) == IDC_PLUS_HELP) {
- CallService(MS_UTILS_OPENURL, 0, (LPARAM)"http://wiki.miranda.or.at/TabSRMM/AdvancedTweaks");
- break;
}
- else if(LOWORD(wParam) == IDC_PLUS_REVERT) { // revert to defaults...
- int i = 0;
+ break;
- TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_MODPLUS);
+ default:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY: {
+ TVITEM item = {0};
+ DWORD msgTimeout;
+ /*
+ * scan the tree view and obtain the options...
+ */
+ TOptionListItem* lvItems = CTranslator::getTree(CTranslator::TREE_MODPLUS);
+
+ for (int 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_PLUS_CHECKTREE, TVM_GETITEMA, 0, (LPARAM)&item);
+ 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
+ }
+
+ msgTimeout = 1000 * GetDlgItemInt(hwndDlg, IDC_SECONDS, NULL, FALSE);
+ PluginConfig.m_MsgTimeout = msgTimeout >= SRMSGSET_MSGTIMEOUT_MIN ? msgTimeout : SRMSGSET_MSGTIMEOUT_MIN;
+ M->WriteDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, PluginConfig.m_MsgTimeout);
- while(lvItems[i].szName) {
- if(lvItems[i].uType == LOI_TYPE_SETTING)
- M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)lvItems[i].id);
- i++;
+ M->WriteByte(SRMSGMOD_T, "historysize", (BYTE)SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_GETPOS, 0, 0));
+ PluginConfig.reloadAdv();
+ return TRUE;
}
- TreeView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE));
- SendMessage(hwndDlg, WM_USER + 100, 0, 0); // fill dialog
- break;
}
- if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
- return TRUE;
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
- /*
- * fill dialog
- */
- case WM_USER + 100: {
- TVINSERTSTRUCT tvi = {0};
- int i = 0;
-
- TOptionListGroup *lvGroups = CTranslator::getGroupTree(CTranslator::TREE_MODPLUS);
-
- while (lvGroups[i].szName != NULL) {
- tvi.hParent = 0;
- tvi.hInsertAfter = TVI_LAST;
- tvi.item.mask = TVIF_TEXT | TVIF_STATE;
- tvi.item.pszText = lvGroups[i].szName;
- tvi.item.stateMask = TVIS_STATEIMAGEMASK | TVIS_EXPANDED | TVIS_BOLD;
- tvi.item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_EXPANDED | TVIS_BOLD;
- lvGroups[i++].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), &tvi);
- }
-
- i = 0;
+ break;
+ case WM_COMMAND:
+ if(LOWORD(wParam) == IDC_PLUS_HELP) {
+ CallService(MS_UTILS_OPENURL, 0, (LPARAM)"http://wiki.miranda.or.at/TabSRMM/AdvancedTweaks");
+ break;
+ }
+ else if(LOWORD(wParam) == IDC_PLUS_REVERT) { // revert to defaults...
TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_MODPLUS);
- while (lvItems[i].szName != 0) {
- tvi.hParent = (HTREEITEM)lvGroups[lvItems[i].uGroup].handle;
- tvi.hInsertAfter = TVI_LAST;
- tvi.item.pszText = lvItems[i].szName;
- tvi.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_PARAM;
- tvi.item.lParam = i;
- tvi.item.stateMask = TVIS_STATEIMAGEMASK;
- //if (lvItems[i].uType == LOI_TYPE_FLAG)
- // tvi.item.state = INDEXTOSTATEIMAGEMASK((dwFlags & (UINT)lvItems[i].lParam) ? 3 : 2);
- if (lvItems[i].uType == LOI_TYPE_SETTING)
- 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_PLUS_CHECKTREE), &tvi);
- i++;
- }
- PluginConfig.g_bClientInStatusBar = M->GetByte("adv_ClientIconInStatusBar", 0);
+ for (int i=0; lvItems[i].szName; i++)
+ if(lvItems[i].uType == LOI_TYPE_SETTING)
+ M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)lvItems[i].id);
- SendDlgItemMessage(hwndDlg, IDC_TIMEOUTSPIN, UDM_SETRANGE, 0, MAKELONG(300, SRMSGSET_MSGTIMEOUT_MIN / 1000));
- SendDlgItemMessage(hwndDlg, IDC_TIMEOUTSPIN, UDM_SETPOS, 0, PluginConfig.m_MsgTimeout / 1000);
+ TreeView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE));
+ FillDialog(hwndDlg);
+ break;
+ }
+ if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
+ return TRUE;
- SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_SETRANGE, 0, MAKELONG(255, 15));
- SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_SETPOS, 0, (int)M->GetByte("historysize", 0));
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
- return 0;
- }
- case WM_CLOSE:
- EndDialog(hwndDlg,0);
- return 0;
- }
+ case WM_CLOSE:
+ EndDialog(hwndDlg,0);
+ return 0;
+ }
return 0;
}