diff options
-rw-r--r-- | plugins/Clist_modern/src/modern_skinopt.cpp | 251 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/moduletree.cpp | 3 | ||||
-rw-r--r-- | plugins/IEView/src/Options.cpp | 326 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/options.cpp | 3 | ||||
-rw-r--r-- | plugins/StopSpamPlus/src/opt_proto.cpp | 21 | ||||
-rw-r--r-- | plugins/TabSRMM/src/buttonsbar.cpp | 10 | ||||
-rw-r--r-- | plugins/TipperYM/src/options.cpp | 1468 | ||||
-rw-r--r-- | plugins/TopToolBar/src/ttbopt.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/contacts.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/genmenuopt.cpp | 144 | ||||
-rw-r--r-- | src/modules/clist/protocolorder.cpp | 4 | ||||
-rw-r--r-- | src/modules/extraicons/options_ei.cpp | 3 | ||||
-rw-r--r-- | src/modules/fonts/FontOptions.cpp | 20 | ||||
-rw-r--r-- | src/modules/icolib/skin2opts.cpp | 22 | ||||
-rw-r--r-- | src/modules/skin/sounds.cpp | 3 |
15 files changed, 1030 insertions, 1256 deletions
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 7dd64c6a5e..2a9fe1b69e 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -79,25 +79,23 @@ int ModernSkinOptInit(WPARAM wParam, LPARAM) } INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - switch (msg) - { + switch (msg) { case WM_DESTROY: - { - if (hPreviewBitmap) ske_UnloadGlyphImage(hPreviewBitmap); + if (hPreviewBitmap) + ske_UnloadGlyphImage(hPreviewBitmap); break; - } case WM_INITDIALOG: - { TranslateDialogDefault(hwndDlg); SetDlgItemText(hwndDlg, IDC_SKINFOLDERLABEL, SkinsFolder); - HTREEITEM it = FillAvailableSkinList(hwndDlg); - HWND wnd = GetDlgItem(hwndDlg, IDC_TREE1); - TreeView_SelectItem(wnd, it); - } - return 0; + { + HTREEITEM it = FillAvailableSkinList(hwndDlg); + HWND wnd = GetDlgItem(hwndDlg, IDC_TREE1); + TreeView_SelectItem(wnd, it); + } + return 0; + case WM_COMMAND: - { switch (LOWORD(wParam)) { case IDC_COLOUR_MENUNORMAL: case IDC_COLOUR_MENUSELECTED: @@ -107,44 +105,42 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break; case IDC_BUTTON_INFO: - { - TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000]; - SkinListData *sd = NULL; - HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1)); - if (hti == 0) return 0; { - TVITEM tvi = { 0 }; - tvi.hItem = hti; - tvi.mask = TVIF_HANDLE | TVIF_PARAM; - TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi); - sd = (SkinListData*)(tvi.lParam); - } - if (!sd) return 0; - if (sd->File && !_tcschr(sd->File, _T('%'))) - { - GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File); - GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File); - GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File); - GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File); - mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), - sd->Name, Description, Author, Contact, URL, sd->File); - } - else - { - mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), - TranslateT("reVista for Modern v0.5"), - TranslateT("This is second default Modern Contact list skin in Vista Aero style"), - TranslateT("Angeli-Ka (graphics), FYR (template)"), - _T("JID: fyr@jabber.ru"), - _T("fyr.mirandaim.ru"), - TranslateT("Inside library")); + TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000]; + SkinListData *sd = NULL; + HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1)); + if (hti == 0) return 0; + { + TVITEM tvi = { 0 }; + tvi.hItem = hti; + tvi.mask = TVIF_HANDLE | TVIF_PARAM; + TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi); + sd = (SkinListData*)(tvi.lParam); + } + if (!sd) return 0; + if (sd->File && !_tcschr(sd->File, _T('%'))) { + GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File); + GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File); + GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File); + GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File); + mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), + sd->Name, Description, Author, Contact, URL, sd->File); + } + else { + mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), + TranslateT("reVista for Modern v0.5"), + TranslateT("This is second default Modern Contact list skin in Vista Aero style"), + TranslateT("Angeli-Ka (graphics), FYR (template)"), + _T("JID: fyr@jabber.ru"), + _T("fyr.mirandaim.ru"), + TranslateT("Inside library")); + } + MessageBox(hwndDlg, text, TranslateT("Skin information"), MB_OK | MB_ICONINFORMATION); } - MessageBox(hwndDlg, text, TranslateT("Skin information"), MB_OK | MB_ICONINFORMATION); - } - break; + break; + case IDC_BUTTON_APPLY_SKIN: - if (HIWORD(wParam) == BN_CLICKED) - { + if (HIWORD(wParam) == BN_CLICKED) { SkinListData *sd = NULL; HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1)); if (hti == 0) return 0; @@ -168,8 +164,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara GetWindowRect(hwnd, &rc); Sync(CLUIFrames_OnMoving, hwnd, &rc); } - if (g_hCLUIOptionsWnd) - { + if (g_hCLUIOptionsWnd) { SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "LeftClientMargin", SETTING_LEFTCLIENTMARIGN_DEFAULT)); SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_RIGHTMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "RightClientMargin", SETTING_RIGHTCLIENTMARIGN_DEFAULT)); SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_TOPMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "TopClientMargin", SETTING_TOPCLIENTMARIGN_DEFAULT)); @@ -177,16 +172,16 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara } } break; + case IDC_BUTTON_RESCAN: - if (HIWORD(wParam) == BN_CLICKED) - { + if (HIWORD(wParam) == BN_CLICKED) { HTREEITEM it = FillAvailableSkinList(hwndDlg); HWND wnd = GetDlgItem(hwndDlg, IDC_TREE1); TreeView_SelectItem(wnd, it); } } break; - } + case WM_DRAWITEM: if (wParam == IDC_PREVIEW) { @@ -235,90 +230,88 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case WM_NOTIFY: switch (((LPNMHDR)lParam)->idFrom) { case IDC_TREE1: - { - NMTREEVIEW * nmtv = (NMTREEVIEW *)lParam; - if (nmtv == NULL) - return 0; - - if (nmtv->hdr.code == TVN_SELCHANGEDA || nmtv->hdr.code == TVN_SELCHANGEDW) { - SkinListData * sd = NULL; - if (hPreviewBitmap) { - ske_UnloadGlyphImage(hPreviewBitmap); - hPreviewBitmap = NULL; - } + { + NMTREEVIEW * nmtv = (NMTREEVIEW *)lParam; + if (nmtv == NULL) + return 0; + + if (nmtv->hdr.code == TVN_SELCHANGED) { + SkinListData * sd = NULL; + if (hPreviewBitmap) { + ske_UnloadGlyphImage(hPreviewBitmap); + hPreviewBitmap = NULL; + } - if (nmtv->itemNew.lParam) { - sd = (SkinListData*)nmtv->itemNew.lParam; - - TCHAR buf[MAX_PATH]; - PathToRelativeT(sd->File, buf); - SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, buf); - - TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 }; - GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF(imfn), sd->File); - IniParser::GetSkinFolder(sd->File, skinfolder); - mir_sntprintf(prfn, SIZEOF(prfn), _T("%s\\%s"), skinfolder, imfn); - PathToAbsoluteT(prfn, imfn); - hPreviewBitmap = ske_LoadGlyphImage(imfn); - - EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), TRUE); - if (hPreviewBitmap) - InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEW), NULL, TRUE); - else { //prepare text - TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000]; - SkinListData* sd = NULL; - HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1)); - if (hti == 0) return 0; - { - TVITEM tvi = { 0 }; - tvi.hItem = hti; - tvi.mask = TVIF_HANDLE | TVIF_PARAM; - TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi); - sd = (SkinListData*)(tvi.lParam); - } - if (!sd) return 0; - - if (sd->File && !_tcschr(sd->File, _T('%'))) - { - GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File); - GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File); - GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File); - GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File); - mir_sntprintf(text, SIZEOF(text), TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"), - sd->Name, Description, Author, Contact, URL); - } - else - { - mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"), - TranslateT("reVista for Modern v0.5"), - TranslateT("This is second default Modern Contact list skin in Vista Aero style"), - TranslateT("graphics by Angeli-Ka\ntemplate by FYR"), - _T("JID: fyr@jabber.ru"), - _T("fyr.mirandaim.ru")); + if (nmtv->itemNew.lParam) { + sd = (SkinListData*)nmtv->itemNew.lParam; + + TCHAR buf[MAX_PATH]; + PathToRelativeT(sd->File, buf); + SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, buf); + + TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 }; + GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF(imfn), sd->File); + IniParser::GetSkinFolder(sd->File, skinfolder); + mir_sntprintf(prfn, SIZEOF(prfn), _T("%s\\%s"), skinfolder, imfn); + PathToAbsoluteT(prfn, imfn); + hPreviewBitmap = ske_LoadGlyphImage(imfn); + + EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), TRUE); + if (hPreviewBitmap) + InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEW), NULL, TRUE); + else { //prepare text + TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000]; + SkinListData* sd = NULL; + HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1)); + if (hti == 0) return 0; + { + TVITEM tvi = { 0 }; + tvi.hItem = hti; + tvi.mask = TVIF_HANDLE | TVIF_PARAM; + TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi); + sd = (SkinListData*)(tvi.lParam); + } + if (!sd) return 0; + + if (sd->File && !_tcschr(sd->File, _T('%'))) { + GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File); + GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File); + GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File); + GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File); + mir_sntprintf(text, SIZEOF(text), TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"), + sd->Name, Description, Author, Contact, URL); + } + else { + mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"), + TranslateT("reVista for Modern v0.5"), + TranslateT("This is second default Modern Contact list skin in Vista Aero style"), + TranslateT("graphics by Angeli-Ka\ntemplate by FYR"), + _T("JID: fyr@jabber.ru"), + _T("fyr.mirandaim.ru")); + } + ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg, IDC_STATIC_INFO), SW_SHOW); + SetDlgItemText(hwndDlg, IDC_STATIC_INFO, text); } + } + else { + //no selected + SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, TranslateT("Select skin from list")); + EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), FALSE); + SetDlgItemText(hwndDlg, IDC_STATIC_INFO, TranslateT("Please select skin to apply")); ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), SW_HIDE); - ShowWindow(GetDlgItem(hwndDlg, IDC_STATIC_INFO), SW_SHOW); - SetDlgItemText(hwndDlg, IDC_STATIC_INFO, text); } + ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), hPreviewBitmap ? SW_SHOW : SW_HIDE); + return 0; } - else { - //no selected - SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, TranslateT("Select skin from list")); - EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), FALSE); - SetDlgItemText(hwndDlg, IDC_STATIC_INFO, TranslateT("Please select skin to apply")); - ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), SW_HIDE); + else if (nmtv->hdr.code == TVN_DELETEITEM) { + mir_free_and_nil(nmtv->itemOld.lParam); + return 0; } - ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), hPreviewBitmap ? SW_SHOW : SW_HIDE); - return 0; - } - else if (nmtv->hdr.code == TVN_DELETEITEMA || nmtv->hdr.code == TVN_DELETEITEMW) { - mir_free_and_nil(nmtv->itemOld.lParam); - return 0; } - } - break; + break; case 0: switch (((LPNMHDR)lParam)->code) { diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp index 106f46c737..62044be21e 100644 --- a/plugins/DbEditorPP/src/moduletree.cpp +++ b/plugins/DbEditorPP/src/moduletree.cpp @@ -579,8 +579,7 @@ void moduleListWM_NOTIFY(HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)// hwnd h }
break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
+ case TVN_SELCHANGED:
{
ModuleTreeInfoStruct *mtis;
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 8cf97390bb..7d5528eb9d 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -492,7 +492,6 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w {
switch (msg) {
case WM_INITDIALOG:
- {
MarkInitialized(1);
TranslateDialogDefault(hwndDlg);
if (Options::getGeneralFlags() & Options::GENERAL_ENABLE_BBCODES) {
@@ -512,33 +511,34 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w }
EnableWindow(GetDlgItem(hwndDlg, IDC_SMILEYS_IN_NAMES), Options::isSmileyAdd());
EnableWindow(GetDlgItem(hwndDlg, IDC_EMBED_SIZE), IsDlgButtonChecked(hwndDlg, IDC_ENABLE_EMBED));
- TCHAR* size[] = { _T("320 x 205"), _T("480 x 385"), _T("560 x 349"), _T("640 x 390") };
- for (int i = 0; i < SIZEOF(size); ++i){
- int item = SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(size[i]));
- SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_SETITEMDATA, item, 0);
+ {
+ TCHAR* size[] = { _T("320 x 205"), _T("480 x 385"), _T("560 x 349"), _T("640 x 390") };
+ for (int i = 0; i < SIZEOF(size); ++i) {
+ int item = SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(size[i]));
+ SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_SETITEMDATA, item, 0);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_SETCURSEL, Options::getEmbedsize(), 0);
}
- SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_SETCURSEL, Options::getEmbedsize(), 0);
return TRUE;
- }
+
case WM_COMMAND:
- {
- switch (LOWORD(wParam)) {
- case IDC_ENABLE_BBCODES:
- case IDC_ENABLE_FLASH:
- case IDC_SMILEYS_IN_NAMES:
- case IDC_NO_BORDER:
- case IDC_EMBED_SIZE:
- MarkChanges(1, hwndDlg);
- break;
- case IDC_ENABLE_EMBED:
- MarkChanges(1, hwndDlg);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EMBED_SIZE), IsDlgButtonChecked(hwndDlg, IDC_ENABLE_EMBED));
- break;
+ {
+ switch (LOWORD(wParam)) {
+ case IDC_ENABLE_BBCODES:
+ case IDC_ENABLE_FLASH:
+ case IDC_SMILEYS_IN_NAMES:
+ case IDC_NO_BORDER:
+ case IDC_EMBED_SIZE:
+ MarkChanges(1, hwndDlg);
+ break;
+ case IDC_ENABLE_EMBED:
+ MarkChanges(1, hwndDlg);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EMBED_SIZE), IsDlgButtonChecked(hwndDlg, IDC_ENABLE_EMBED));
+ break;
+ }
}
- }
- break;
+ break;
case WM_NOTIFY:
- {
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
int i = 0;
@@ -562,9 +562,6 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w Options::setEmbedsize(SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_GETCURSEL, 0, 0));
return TRUE;
}
- }
- break;
- case WM_DESTROY:
break;
}
return FALSE;
@@ -576,122 +573,120 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar char path[MAX_PATH], filter[MAX_PATH];
switch (msg) {
case WM_INITDIALOG:
- {
- MarkInitialized(2);
- TranslateDialogDefault(hwndDlg);
- srmmCurrentProtoItem = NULL;
- RefreshProtoList(hwndDlg, 0, true);
- return TRUE;
- }
+ {
+ MarkInitialized(2);
+ TranslateDialogDefault(hwndDlg);
+ srmmCurrentProtoItem = NULL;
+ RefreshProtoList(hwndDlg, 0, true);
+ return TRUE;
+ }
case WM_COMMAND:
- {
- switch (LOWORD(wParam)) {
- case IDC_BACKGROUND_IMAGE_FILENAME:
- case IDC_EXTERNALCSS_FILENAME:
- case IDC_EXTERNALCSS_FILENAME_RTL:
- case IDC_TEMPLATES_FILENAME:
- if ((HWND)lParam == GetFocus() && HIWORD(wParam) == EN_CHANGE)
- MarkChanges(2, hwndDlg);
- break;
- case IDC_SCROLL_BACKGROUND_IMAGE:
- case IDC_LOG_SHOW_NICKNAMES:
- case IDC_LOG_SHOW_TIME:
- case IDC_LOG_SHOW_DATE:
- case IDC_LOG_SHOW_SECONDS:
- case IDC_LOG_LONG_DATE:
- case IDC_LOG_RELATIVE_DATE:
- case IDC_LOG_GROUP_MESSAGES:
- MarkChanges(2, hwndDlg);
- break;
- case IDC_BACKGROUND_IMAGE:
- bChecked = IsDlgButtonChecked(hwndDlg, IDC_MODE_COMPATIBLE) && IsDlgButtonChecked(hwndDlg, IDC_BACKGROUND_IMAGE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME), bChecked);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE_BACKGROUND_IMAGE), bChecked);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SCROLL_BACKGROUND_IMAGE), bChecked);
- MarkChanges(2, hwndDlg);
- break;
- case IDC_BROWSE_TEMPLATES:
- mir_snprintf(filter, SIZEOF(filter), "%s (*.ivt)%c*.ivt%c%s (*.*)%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
- if (BrowseFile(hwndDlg, filter, "ivt", path, SIZEOF(path))) {
- SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
- UpdateTemplateIcons(hwndDlg, path);
- MarkChanges(2, hwndDlg);
- }
- break;
- case IDC_BROWSE_BACKGROUND_IMAGE:
- mir_snprintf(filter, SIZEOF(filter), "%s (*.jpg,*.jpeg,*.gif,*.png,*.bmp)%c*.jpg;*.jpeg;*.gif;*.png;*.bmp%c%s (*.*)%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
- if (BrowseFile(hwndDlg, filter, "jpg", path, SIZEOF(path))) {
- SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
+ {
+ switch (LOWORD(wParam)) {
+ case IDC_BACKGROUND_IMAGE_FILENAME:
+ case IDC_EXTERNALCSS_FILENAME:
+ case IDC_EXTERNALCSS_FILENAME_RTL:
+ case IDC_TEMPLATES_FILENAME:
+ if ((HWND)lParam == GetFocus() && HIWORD(wParam) == EN_CHANGE)
+ MarkChanges(2, hwndDlg);
+ break;
+ case IDC_SCROLL_BACKGROUND_IMAGE:
+ case IDC_LOG_SHOW_NICKNAMES:
+ case IDC_LOG_SHOW_TIME:
+ case IDC_LOG_SHOW_DATE:
+ case IDC_LOG_SHOW_SECONDS:
+ case IDC_LOG_LONG_DATE:
+ case IDC_LOG_RELATIVE_DATE:
+ case IDC_LOG_GROUP_MESSAGES:
MarkChanges(2, hwndDlg);
- }
- break;
- case IDC_BROWSE_EXTERNALCSS:
- mir_snprintf(filter, SIZEOF(filter), "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
- if (BrowseFile(hwndDlg, filter, "css", path, SIZEOF(path))) {
- SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
+ break;
+ case IDC_BACKGROUND_IMAGE:
+ bChecked = IsDlgButtonChecked(hwndDlg, IDC_MODE_COMPATIBLE) && IsDlgButtonChecked(hwndDlg, IDC_BACKGROUND_IMAGE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME), bChecked);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE_BACKGROUND_IMAGE), bChecked);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCROLL_BACKGROUND_IMAGE), bChecked);
MarkChanges(2, hwndDlg);
- }
- break;
- case IDC_BROWSE_EXTERNALCSS_RTL:
- mir_snprintf(filter, SIZEOF(filter), "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
- if (BrowseFile(hwndDlg, filter, "css", path, SIZEOF(path))) {
- SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
+ break;
+ case IDC_BROWSE_TEMPLATES:
+ mir_snprintf(filter, SIZEOF(filter), "%s (*.ivt)%c*.ivt%c%s (*.*)%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
+ if (BrowseFile(hwndDlg, filter, "ivt", path, SIZEOF(path))) {
+ SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
+ UpdateTemplateIcons(hwndDlg, path);
+ MarkChanges(2, hwndDlg);
+ }
+ break;
+ case IDC_BROWSE_BACKGROUND_IMAGE:
+ mir_snprintf(filter, SIZEOF(filter), "%s (*.jpg,*.jpeg,*.gif,*.png,*.bmp)%c*.jpg;*.jpeg;*.gif;*.png;*.bmp%c%s (*.*)%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
+ if (BrowseFile(hwndDlg, filter, "jpg", path, SIZEOF(path))) {
+ SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
+ MarkChanges(2, hwndDlg);
+ }
+ break;
+ case IDC_BROWSE_EXTERNALCSS:
+ mir_snprintf(filter, SIZEOF(filter), "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ if (BrowseFile(hwndDlg, filter, "css", path, SIZEOF(path))) {
+ SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
+ MarkChanges(2, hwndDlg);
+ }
+ break;
+ case IDC_BROWSE_EXTERNALCSS_RTL:
+ mir_snprintf(filter, SIZEOF(filter), "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ if (BrowseFile(hwndDlg, filter, "css", path, SIZEOF(path))) {
+ SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
+ MarkChanges(2, hwndDlg);
+ }
+ break;
+ case IDC_MODE_COMPATIBLE:
+ case IDC_MODE_CSS:
+ case IDC_MODE_TEMPLATE:
+ UpdateControlsState(hwndDlg);
MarkChanges(2, hwndDlg);
+ break;
}
- break;
- case IDC_MODE_COMPATIBLE:
- case IDC_MODE_CSS:
- case IDC_MODE_TEMPLATE:
- UpdateControlsState(hwndDlg);
- MarkChanges(2, hwndDlg);
- break;
}
- }
- break;
+ break;
case UM_CHECKSTATECHANGE:
- {
- ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM)lParam);
- if (proto != NULL)
- if (strcmpi(proto->getProtocolName(), "_default_"))
- proto->setSRMMEnableTemp(0 != TreeView_GetCheckState((HWND)wParam, (HTREEITEM)lParam));
-
- if ((HTREEITEM)lParam != TreeView_GetSelection((HWND)wParam))
- TreeView_SelectItem((HWND)wParam, (HTREEITEM)lParam);
- else
- UpdateSRMMProtoInfo(hwndDlg, proto);
+ {
+ ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM)lParam);
+ if (proto != NULL)
+ if (strcmpi(proto->getProtocolName(), "_default_"))
+ proto->setSRMMEnableTemp(0 != TreeView_GetCheckState((HWND)wParam, (HTREEITEM)lParam));
+
+ if ((HTREEITEM)lParam != TreeView_GetSelection((HWND)wParam))
+ TreeView_SelectItem((HWND)wParam, (HTREEITEM)lParam);
+ else
+ UpdateSRMMProtoInfo(hwndDlg, proto);
- MarkChanges(2, hwndDlg);
- }
- break;
+ MarkChanges(2, hwndDlg);
+ }
+ break;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == IDC_PROTOLIST) {
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
- {
- TVHITTESTINFO ht = { 0 };
- DWORD dwpos = GetMessagePos();
- POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
- MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
- TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
- if (TVHT_ONITEMSTATEICON & ht.flags) {
- PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
- return FALSE;
+ {
+ TVHITTESTINFO ht = { 0 };
+ DWORD dwpos = GetMessagePos();
+ POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
+ MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
+ TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
+ if (TVHT_ONITEMSTATEICON & ht.flags) {
+ PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
+ return FALSE;
+ }
}
- }
- break;
+ break;
case TVN_KEYDOWN:
if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
(LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
- {
+
+ case TVN_SELCHANGED:
ProtocolSettings *proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)NULL);
SaveSRMMProtoSettings(hwndDlg, srmmCurrentProtoItem);
UpdateSRMMProtoInfo(hwndDlg, proto);
- }
- break;
+ break;
}
break;
}
@@ -802,31 +797,29 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w if (((LPNMHDR)lParam)->idFrom == IDC_PROTOLIST) {
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
- {
- TVHITTESTINFO ht = { 0 };
- DWORD dwpos = GetMessagePos();
- POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
- MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
- TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
- if (TVHT_ONITEMSTATEICON & ht.flags) {
- PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
- return FALSE;
+ {
+ TVHITTESTINFO ht = { 0 };
+ DWORD dwpos = GetMessagePos();
+ POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
+ MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
+ TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
+ if (TVHT_ONITEMSTATEICON & ht.flags) {
+ PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
+ return FALSE;
+ }
}
- }
- break;
+ break;
case TVN_KEYDOWN:
if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
(LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
- {
+
+ case TVN_SELCHANGED:
ProtocolSettings *proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)NULL);
SaveHistoryProtoSettings(hwndDlg, historyCurrentProtoItem);
UpdateHistoryProtoInfo(hwndDlg, proto);
- }
- break;
+ break;
}
break;
}
@@ -918,50 +911,49 @@ static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARA break;
case UM_CHECKSTATECHANGE:
- {
- ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM)lParam);
- if (proto != NULL)
- if (strcmpi(proto->getProtocolName(), "_default_"))
- proto->setChatEnableTemp(0 != TreeView_GetCheckState((HWND)wParam, (HTREEITEM)lParam));
-
- if ((HTREEITEM)lParam != TreeView_GetSelection((HWND)wParam)) {
- TreeView_SelectItem((HWND)wParam, (HTREEITEM)lParam);
- }
- else {
- UpdateChatProtoInfo(hwndDlg, proto);
+ {
+ ProtocolSettings *proto = (ProtocolSettings *)GetItemParam((HWND)wParam, (HTREEITEM)lParam);
+ if (proto != NULL)
+ if (strcmpi(proto->getProtocolName(), "_default_"))
+ proto->setChatEnableTemp(0 != TreeView_GetCheckState((HWND)wParam, (HTREEITEM)lParam));
+
+ if ((HTREEITEM)lParam != TreeView_GetSelection((HWND)wParam)) {
+ TreeView_SelectItem((HWND)wParam, (HTREEITEM)lParam);
+ }
+ else {
+ UpdateChatProtoInfo(hwndDlg, proto);
+ }
+ MarkChanges(8, hwndDlg);
}
- MarkChanges(8, hwndDlg);
- }
- break;
+ break;
+
case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == IDC_PROTOLIST) {
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
- {
- TVHITTESTINFO ht = { 0 };
- DWORD dwpos = GetMessagePos();
- POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
- MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
- TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
- if (TVHT_ONITEMSTATEICON & ht.flags) {
- PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
- return FALSE;
+ {
+ TVHITTESTINFO ht = { 0 };
+ DWORD dwpos = GetMessagePos();
+ POINTSTOPOINT(ht.pt, MAKEPOINTS(dwpos));
+ MapWindowPoints(HWND_DESKTOP, ((LPNMHDR)lParam)->hwndFrom, &ht.pt, 1);
+ TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &ht);
+ if (TVHT_ONITEMSTATEICON & ht.flags) {
+ PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)ht.hItem);
+ return FALSE;
+ }
}
- }
- break;
+ break;
case TVN_KEYDOWN:
if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
PostMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
(LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
- {
+
+ case TVN_SELCHANGED:
ProtocolSettings *proto = (ProtocolSettings *)GetItemParam(GetDlgItem(hwndDlg, IDC_PROTOLIST), (HTREEITEM)NULL);
SaveChatProtoSettings(hwndDlg, chatCurrentProtoItem);
UpdateChatProtoInfo(hwndDlg, proto);
- }
- break;
+ break;
}
break;
}
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 273adaffff..5d2f6a3d40 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -231,8 +231,7 @@ BOOL OptionsDialogType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lParam) (LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
+ case TVN_SELCHANGED:
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW) lParam;
if (pnmtv->itemNew.state & TVIS_SELECTED)
UpdateControls();
diff --git a/plugins/StopSpamPlus/src/opt_proto.cpp b/plugins/StopSpamPlus/src/opt_proto.cpp index 17e38c39ed..21ddd4d1d3 100644 --- a/plugins/StopSpamPlus/src/opt_proto.cpp +++ b/plugins/StopSpamPlus/src/opt_proto.cpp @@ -48,9 +48,7 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) {
HWND hwndProto = GetDlgItem(hwnd, IDC_PROTO);
- switch (msg)
- {
-
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
@@ -100,16 +98,15 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) case IDC_PROTO:
switch (((LPNMHDR)lParam)->code) {
- case TVN_DELETEITEMA:
- {
- NMTREEVIEWA * pnmtv = (NMTREEVIEWA *)lParam;
- if (pnmtv && pnmtv->itemOld.lParam)
- mir_free((ProtocolData*)pnmtv->itemOld.lParam);
- }
- break;
+ case TVN_DELETEITEM:
+ {
+ NMTREEVIEWA * pnmtv = (NMTREEVIEWA *)lParam;
+ if (pnmtv && pnmtv->itemOld.lParam)
+ mir_free((ProtocolData*)pnmtv->itemOld.lParam);
+ }
+ break;
case NM_CLICK:
- {
TVHITTESTINFO hti;
hti.pt.x = (short)LOWORD(GetMessagePos());
hti.pt.y = (short)HIWORD(GetMessagePos());
@@ -129,7 +126,7 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) SendMessage(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0);
}
}
- } }
+ }
}
break;
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 7713ba0bdd..885692778c 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -696,16 +696,14 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l case IDC_TOOLBARTREE: switch (((LPNMHDR)lParam)->code) { - case TVN_BEGINDRAGA: - case TVN_BEGINDRAGW: + case TVN_BEGINDRAG: SetCapture(hwndDlg); drag = 1; hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem; TreeView_SelectItem(hToolBarTree, hDragItem); break; - case TVN_SELCHANGINGA: - case TVN_SELCHANGINGW: + case TVN_SELCHANGING: hti = TreeView_GetSelection(hToolBarTree); if (hti != NULL) { TCHAR strbuf[128]; @@ -733,8 +731,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l } break; - case TVN_SELCHANGEDW: - case TVN_SELCHANGEDA: + case TVN_SELCHANGED: hti = TreeView_GetSelection(hToolBarTree); if (hti != NULL) { TCHAR strbuf[128]; @@ -1447,4 +1444,3 @@ void CB_DeInitCustomButtons() DestroyServiceFunction(hButtonsBarGetButtonState); DestroyServiceFunction(hButtonsBarSetButtonState); } - diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index c20d0645ea..69444dcb69 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -36,8 +36,7 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip) DBVARIANT dbv;
int result = 1;
- if (!db_get_ts(NULL, MODULE, szSetting, &dbv))
- {
+ if (!db_get_ts(NULL, MODULE, szSetting, &dbv)) {
result = _tcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
db_free(&dbv);
}
@@ -47,10 +46,8 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip) void CreateDefaultItems()
{
- for (int i = 0; defaultItemList[i].szName; i++)
- {
- if (defaultItemList[i].szName[0] == '-')
- {
+ for (int i = 0; defaultItemList[i].szName; i++) {
+ if (defaultItemList[i].szName[0] == '-') {
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
_tcsncpy(di_node->di.swzLabel, _T(""), LABEL_LEN);
_tcsncpy(di_node->di.swzValue, _T(""), VALUE_LEN);
@@ -61,13 +58,11 @@ void CreateDefaultItems() opt.diList = di_node;
opt.iDiCount++;
}
- else
- {
+ else {
PRESETITEM *item = GetPresetItemByName(defaultItemList[i].szName);
if (item == NULL) continue;
- for (int j = 0; j < MAX_PRESET_SUBST_COUNT; j++)
- {
+ for (int j = 0; j < MAX_PRESET_SUBST_COUNT; j++) {
PRESETSUBST *subst = GetPresetSubstByName(item->szNeededSubst[j]);
if (subst == NULL) continue;
@@ -114,8 +109,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
ds->szModuleName[0] = 0;
- if (!db_get(0, MODULE_ITEMS, setting, &dbv))
- {
+ if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
ds->szModuleName[MODULE_NAME_LEN - 1] = 0;
db_free(&dbv);
@@ -123,8 +117,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
ds->szSettingName[0] = 0;
- if (!db_get(0, MODULE_ITEMS, setting, &dbv))
- {
+ if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
ds->szSettingName[SETTING_NAME_LEN - 1] = 0;
db_free(&dbv);
@@ -134,8 +127,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) ds->iTranslateFuncId = db_get_dw(0, MODULE_ITEMS, setting, (DWORD)-1);
// a little backward compatibility
- if ((DWORD)ds->iTranslateFuncId == (DWORD)-1)
- {
+ if ((DWORD)ds->iTranslateFuncId == (DWORD)-1) {
mir_snprintf(setting, SIZEOF(setting), "TransFunc%d", index);
ds->iTranslateFuncId = (DWORD)db_get_w(0, MODULE_ITEMS, setting, 0);
}
@@ -169,14 +161,13 @@ bool LoadDI(DISPLAYITEM *di, int index) if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- _tcsncpy( di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
+ _tcsncpy(di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0;
db_free(&dbv);
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
di->swzValue[0] = 0;
- if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
- {
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) {
_tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
di->swzValue[SIZEOF(di->swzValue) - 1] = 0;
db_free(&dbv);
@@ -201,16 +192,14 @@ void SaveDI(DISPLAYITEM *di, int index) char setting[512];
mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
- if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel))
- {
+ if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel)) {
char buff[LABEL_LEN];
t2a(di->swzLabel, buff, LABEL_LEN);
db_set_s(0, MODULE_ITEMS, setting, buff);
}
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
- if (db_set_ts(0, MODULE_ITEMS, setting, di->swzValue))
- {
+ if (db_set_ts(0, MODULE_ITEMS, setting, di->swzValue)) {
char buff[VALUE_LEN];
t2a(di->swzValue, buff, VALUE_LEN);
db_set_s(0, MODULE_ITEMS, setting, buff);
@@ -273,8 +262,7 @@ void SaveItems() {
int index = 0;
DSListNode *ds_node = opt.dsList;
- while (ds_node)
- {
+ while (ds_node) {
SaveDS(&ds_node->ds, index);
ds_node = ds_node->next;
index++;
@@ -285,8 +273,7 @@ void SaveItems() index = 0;
DIListNode *di_node = opt.diList;
opt.bWaitForStatusMsg = false;
- while (di_node)
- {
+ while (di_node) {
SaveDI(&di_node->di, index);
if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, _T("sys:status_msg")))
opt.bWaitForStatusMsg = true;
@@ -316,13 +303,11 @@ void LoadObsoleteSkinSetting() char setting[128];
DBVARIANT dbv;
- for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
- {
+ for (int i = 0; i < SKIN_ITEMS_COUNT; i++) {
mir_snprintf(setting, SIZEOF(setting), "SPaintMode%d", i);
opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
mir_snprintf(setting, SIZEOF(setting), "SImgFile%d", i);
- if (!db_get_ts(NULL, MODULE, setting, &dbv))
- {
+ if (!db_get_ts(NULL, MODULE, setting, &dbv)) {
opt.szImgFile[i] = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -363,11 +348,9 @@ void LoadOptions() DSListNode *ds_node;
opt.iDsCount = db_get_w(0, MODULE_ITEMS, "DSNumValues", 0);
- for (i = opt.iDsCount - 1; i >= 0; i--)
- {
+ for (i = opt.iDsCount - 1; i >= 0; i--) {
ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
- if (LoadDS(&ds_node->ds, i))
- {
+ if (LoadDS(&ds_node->ds, i)) {
ds_node->next = opt.dsList;
opt.dsList = ds_node;
real_count++;
@@ -383,11 +366,9 @@ void LoadOptions() opt.bWaitForStatusMsg = false;
opt.iDiCount = db_get_w(0, MODULE_ITEMS, "DINumValues", 0);
- for (i = opt.iDiCount - 1; i >= 0; i--)
- {
+ for (i = opt.iDiCount - 1; i >= 0; i--) {
di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- if (LoadDI(&di_node->di, i))
- {
+ if (LoadDI(&di_node->di, i)) {
di_node->next = opt.diList;
opt.diList = di_node;
real_count++;
@@ -412,8 +393,7 @@ void LoadOptions() opt.bStatusBarTips = (db_get_b(0, MODULE, "SBarTips", 1) == 1);
// convert defunct last message and status message options to new 'sys' items, and remove the old settings
- if (db_get_b(0, MODULE, "ShowLastMessage", 0))
- {
+ if (db_get_b(0, MODULE, "ShowLastMessage", 0)) {
db_unset(0, MODULE, "ShowLastMessage");
// find end of list
@@ -422,13 +402,11 @@ void LoadOptions() di_node = di_node->next;
// last message item
- if (di_node)
- {
+ if (di_node) {
di_node->next = (DIListNode *)mir_alloc(sizeof(DIListNode));
di_node = di_node->next;
}
- else
- {
+ else {
opt.diList = (DIListNode *)mir_alloc(sizeof(DIListNode));
di_node = opt.diList;
}
@@ -440,8 +418,7 @@ void LoadOptions() opt.iDiCount++;
}
- if (db_get_b(0, MODULE, "ShowStatusMessage", 0))
- {
+ if (db_get_b(0, MODULE, "ShowStatusMessage", 0)) {
db_unset(0, MODULE, "ShowStatusMessage");
// find end of list
@@ -450,13 +427,11 @@ void LoadOptions() di_node = di_node->next;
// status message item
- if (di_node)
- {
+ if (di_node) {
di_node->next = (DIListNode *)mir_alloc(sizeof(DIListNode));
di_node = di_node->next;
}
- else
- {
+ else {
opt.diList = (DIListNode *)mir_alloc(sizeof(DIListNode));
di_node = opt.diList;
}
@@ -484,7 +459,7 @@ void LoadOptions() opt.iFavoriteContFlags = db_get_dw(0, MODULE, "FavContFlags", FAVCONT_APPEND_PROTO);
// extra setting
- opt.bWaitForContent= db_get_b(0, MODULE, "WaitForContent", 0) ? true : false;
+ opt.bWaitForContent = db_get_b(0, MODULE, "WaitForContent", 0) ? true : false;
opt.bGetNewStatusMsg = db_get_b(0, MODULE, "GetNewStatusMsg", 0) ? true : false;
opt.bDisableIfInvisible = db_get_b(0, MODULE, "DisableInvisible", 1) ? true : false;
opt.bRetrieveXstatus = db_get_b(0, MODULE, "RetrieveXStatus", 0) ? true : false;
@@ -496,26 +471,22 @@ void LoadOptions() DBVARIANT dbv;
// Load the icons order
- for (i = 0; i < EXICONS_COUNT; i++)
- {
- opt.exIconsOrder[i]=i;
- opt.exIconsVis[i]=1;
+ for (i = 0; i < EXICONS_COUNT; i++) {
+ opt.exIconsOrder[i] = i;
+ opt.exIconsVis[i] = 1;
}
- if (!db_get(NULL, MODULE, "IconOrder", &dbv))
- {
- memcpy(opt.exIconsOrder,dbv.pbVal,dbv.cpbVal);
+ if (!db_get(NULL, MODULE, "IconOrder", &dbv)) {
+ memcpy(opt.exIconsOrder, dbv.pbVal, dbv.cpbVal);
db_free(&dbv);
}
- if (!db_get(NULL, MODULE, "icons_vis", &dbv))
- {
- memcpy(opt.exIconsVis,dbv.pbVal,dbv.cpbVal);
+ if (!db_get(NULL, MODULE, "icons_vis", &dbv)) {
+ memcpy(opt.exIconsVis, dbv.pbVal, dbv.cpbVal);
db_free(&dbv);
}
- for (i = 0; i < EXICONS_COUNT; i++)
- {
+ for (i = 0; i < EXICONS_COUNT; i++) {
exIcons[i].order = opt.exIconsOrder[i];
exIcons[i].vis = opt.exIconsVis[i];
}
@@ -536,25 +507,21 @@ void LoadOptions() int iBgImg = db_get_b(0, MODULE, "SBgImage", 0);
opt.skinMode = (SkinMode)db_get_b(0, MODULE, "SkinEngine", iBgImg ? SM_OBSOLOTE : SM_COLORFILL);
opt.bLoadFonts = db_get_b(0, MODULE, "LoadFonts", 1) ? true : false;
- opt.bLoadProportions= db_get_b(0, MODULE, "LoadProportions", 1) ? true : false;
+ opt.bLoadProportions = db_get_b(0, MODULE, "LoadProportions", 1) ? true : false;
opt.iEnableColoring = db_get_dw(0, MODULE, "EnableColoring", 0);
opt.szSkinName[0] = 0;
- if (opt.skinMode == SM_OBSOLOTE)
- {
+ if (opt.skinMode == SM_OBSOLOTE) {
LoadObsoleteSkinSetting();
}
- else if (opt.skinMode == SM_IMAGE)
- {
- if (!db_get_ts(NULL, MODULE, "SkinName", &dbv))
- {
- _tcsncpy(opt.szSkinName, dbv.ptszVal,SIZEOF(opt.szSkinName)-1);
+ else if (opt.skinMode == SM_IMAGE) {
+ if (!db_get_ts(NULL, MODULE, "SkinName", &dbv)) {
+ _tcsncpy(opt.szSkinName, dbv.ptszVal, SIZEOF(opt.szSkinName) - 1);
db_free(&dbv);
}
}
- if (opt.iDsCount == 0 && opt.iDiCount == 0)
- {
+ if (opt.iDsCount == 0 && opt.iDiCount == 0) {
// set up some reasonable defaults
CreateDefaultItems();
SaveOptions();
@@ -566,19 +533,17 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
DISPLAYITEM *di = (DISPLAYITEM *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
- TranslateDialogDefault( hwndDlg );
+ TranslateDialogDefault(hwndDlg);
di = (DISPLAYITEM *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)di);
SetDlgItemText(hwndDlg, IDC_ED_LABEL, di->swzLabel);
SetDlgItemText(hwndDlg, IDC_ED_VALUE, di->swzValue);
- for (int i = 0; i < SIZEOF(displayItemTypes); i++)
- {
+ for (int i = 0; i < SIZEOF(displayItemTypes); i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_CMB_TYPE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateTS(displayItemTypes[i].title));
SendDlgItemMessage(hwndDlg, IDC_CMB_TYPE, CB_SETITEMDATA, index, (LPARAM)displayItemTypes[i].type);
if (displayItemTypes[i].type == di->type)
@@ -597,21 +562,18 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetFocus(GetDlgItem(hwndDlg, IDC_ED_LABEL));
return TRUE;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
- if (HIWORD(wParam) == BN_CLICKED)
- {
- switch(LOWORD(wParam))
- {
- case IDOK:
+ if (HIWORD(wParam) == BN_CLICKED) {
+ switch (LOWORD(wParam)) {
+ case IDOK:
{
GetDlgItemText(hwndDlg, IDC_ED_LABEL, di->swzLabel, LABEL_LEN);
GetDlgItemText(hwndDlg, IDC_ED_VALUE, di->swzValue, VALUE_LEN);
int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_TYPE, CB_GETCURSEL, 0, 0);
int type = SendDlgItemMessage(hwndDlg, IDC_CMB_TYPE, CB_GETITEMDATA, sel, 0);
- for (int i = 0; i < SIZEOF(displayItemTypes); i++)
- {
+ for (int i = 0; i < SIZEOF(displayItemTypes); i++) {
if (displayItemTypes[i].type == type)
di->type = displayItemTypes[i].type;
}
@@ -621,14 +583,11 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP di->bParseTipperVarsFirst = (IsDlgButtonChecked(hwndDlg, IDC_CHK_PARSETIPPERFIRST) ? true : false);
sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
- if (sel != CB_ERR)
- {
+ if (sel != CB_ERR) {
TCHAR buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
- for (int i = 0; presetItems[i].szID; i++)
- {
- if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0)
- {
+ for (int i = 0; presetItems[i].szID; i++) {
+ if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
if (presetItems[i].szNeededSubst[0])
EndDialog(hwndDlg, IDPRESETITEM + i);
else
@@ -642,12 +601,12 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE;
}
- case IDCANCEL:
+ case IDCANCEL:
{
EndDialog(hwndDlg, IDCANCEL);
return TRUE;
}
- case IDC_BTN_VARIABLE:
+ case IDC_BTN_VARIABLE:
{
if (GetFocus() == GetDlgItem(hwndDlg, IDC_ED_LABEL))
variables_showhelp(hwndDlg, IDC_ED_LABEL, VHF_FULLDLG, NULL, NULL);
@@ -657,19 +616,14 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
}
}
- else if (HIWORD(wParam) == CBN_SELCHANGE)
- {
- if (LOWORD(wParam) == IDC_CMB_PRESETITEMS)
- {
+ else if (HIWORD(wParam) == CBN_SELCHANGE) {
+ if (LOWORD(wParam) == IDC_CMB_PRESETITEMS) {
int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
- if (sel != CB_ERR)
- {
+ if (sel != CB_ERR) {
TCHAR buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
- for (int i = 0; presetItems[i].szID; i++)
- {
- if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0)
- {
+ for (int i = 0; presetItems[i].szID; i++) {
+ if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
SetDlgItemText(hwndDlg, IDC_ED_LABEL, TranslateTS(presetItems[i].swzLabel));
SetDlgItemText(hwndDlg, IDC_ED_VALUE, presetItems[i].swzValue);
break;
@@ -689,36 +643,32 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l {
DISPLAYSUBST *ds = (DISPLAYSUBST *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
- TranslateDialogDefault( hwndDlg );
+ TranslateDialogDefault(hwndDlg);
ds = (DISPLAYSUBST *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)ds);
SetDlgItemText(hwndDlg, IDC_ED_LABEL, ds->swzName);
- switch (ds->type)
- {
- case DVT_PROTODB:
- CheckDlgButton(hwndDlg, IDC_CHK_PROTOMOD, BST_CHECKED);
- SetDlgItemTextA(hwndDlg, IDC_ED_SETTING, ds->szSettingName);
- break;
- case DVT_DB:
- SetDlgItemTextA(hwndDlg, IDC_ED_MODULE, ds->szModuleName);
- SetDlgItemTextA(hwndDlg, IDC_ED_SETTING, ds->szSettingName);
- break;
+ switch (ds->type) {
+ case DVT_PROTODB:
+ CheckDlgButton(hwndDlg, IDC_CHK_PROTOMOD, BST_CHECKED);
+ SetDlgItemTextA(hwndDlg, IDC_ED_SETTING, ds->szSettingName);
+ break;
+ case DVT_DB:
+ SetDlgItemTextA(hwndDlg, IDC_ED_MODULE, ds->szModuleName);
+ SetDlgItemTextA(hwndDlg, IDC_ED_SETTING, ds->szSettingName);
+ break;
}
- for (int i = 0; i < iTransFuncsCount; i++)
- {
+ for (int i = 0; i < iTransFuncsCount; i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateTS(translations[i].swzName));
SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_SETITEMDATA, index, (LPARAM)translations[i].id);
}
- for (int i = 0; i < iTransFuncsCount; i++)
- {
+ for (int i = 0; i < iTransFuncsCount; i++) {
int id = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_GETITEMDATA, i, 0);
if (id == ds->iTranslateFuncId)
SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_SETCURSEL, i, 0);
@@ -728,7 +678,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SetFocus(GetDlgItem(hwndDlg, IDC_ED_LABEL));
return TRUE;
}
- case WMU_ENABLE_MODULE_ENTRY:
+ case WMU_ENABLE_MODULE_ENTRY:
{
HWND hw = GetDlgItem(hwndDlg, IDC_CHK_PROTOMOD);
EnableWindow(hw, TRUE);
@@ -738,30 +688,26 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EnableWindow(hw, TRUE);
return TRUE;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
- if (HIWORD(wParam) == BN_CLICKED)
- {
- switch (LOWORD(wParam))
- {
- case IDC_CHK_PROTOMOD:
+ if (HIWORD(wParam) == BN_CLICKED) {
+ switch (LOWORD(wParam)) {
+ case IDC_CHK_PROTOMOD:
{
SendMessage(hwndDlg, WMU_ENABLE_MODULE_ENTRY, 0, 0);
break;
}
- case IDOK:
+ case IDOK:
{
GetDlgItemText(hwndDlg, IDC_ED_LABEL, ds->swzName, LABEL_LEN);
- if (ds->swzName[0] == 0)
- {
+ if (ds->swzName[0] == 0) {
MessageBox(hwndDlg, TranslateT("You must enter a label"), TranslateT("Invalid Substitution"), MB_OK | MB_ICONWARNING);
return TRUE;
}
if (IsDlgButtonChecked(hwndDlg, IDC_CHK_PROTOMOD))
ds->type = DVT_PROTODB;
- else
- {
+ else {
ds->type = DVT_DB;
GetDlgItemTextA(hwndDlg, IDC_ED_MODULE, ds->szModuleName, SIZEOF(ds->szModuleName));
}
@@ -774,7 +720,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EndDialog(hwndDlg, IDOK);
return TRUE;
}
- case IDCANCEL:
+ case IDCANCEL:
{
EndDialog(hwndDlg, IDCANCEL);
return TRUE;
@@ -793,8 +739,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l static void SetTreeItemText(DIListNode *node, TCHAR **pszText)
{
- if (node->di.swzLabel[0] == 0)
- {
+ if (node->di.swzLabel[0] == 0) {
if (node->di.swzValue[0] == 0 && node->di.bLineAbove)
*pszText = _T("--------------------------------------");
else
@@ -805,49 +750,45 @@ static void SetTreeItemText(DIListNode *node, TCHAR **pszText) }
static OPTBUTTON btns[9] = {
- IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add item"),
- IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENT("Add separator"),
- IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENT("Edit"),
- IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
- IDC_BTN_UP, 0, IDI_UP, LPGENT("Move up"),
- IDC_BTN_DOWN, 0, IDI_DOWN, LPGENT("Move down"),
- IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add"),
- IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
- IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENT("Edit")
+ IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add item"),
+ IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENT("Add separator"),
+ IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENT("Edit"),
+ IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
+ IDC_BTN_UP, 0, IDI_UP, LPGENT("Move up"),
+ IDC_BTN_DOWN, 0, IDI_DOWN, LPGENT("Move down"),
+ IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add"),
+ IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
+ IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENT("Edit")
};
INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
- for (int i = 0; i < SIZEOF(btns); i++)
- {
- SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(btns[i].swzTooltip), BATF_TCHAR);
- if (btns[i].uintCoreIconId)
- SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(btns[i].uintCoreIconId));
- else
- {
- HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(btns[i].uintResIconId));
- SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
- }
+ for (int i = 0; i < SIZEOF(btns); i++) {
+ SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONSETASFLATBTN, TRUE, 0);
+ SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(btns[i].swzTooltip), BATF_TCHAR);
+ if (btns[i].uintCoreIconId)
+ SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(btns[i].uintCoreIconId));
+ else {
+ HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(btns[i].uintResIconId));
+ SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
+ DestroyIcon(hIcon);
}
+ }
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE) | TVS_CHECKBOXES);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE) | TVS_CHECKBOXES);
+ {
- TVINSERTSTRUCT tvi = {0};
+ TVINSERTSTRUCT tvi = { 0 };
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
DIListNode *di_node = opt.diList, *di_value;
- while (di_node)
- {
+ while (di_node) {
di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
*di_value = *di_node;
tvi.item.lParam = (LPARAM)di_value;
@@ -858,8 +799,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
DSListNode *ds_node = opt.dsList, *ds_value;
- while (ds_node)
- {
+ while (ds_node) {
ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
*ds_value = *ds_node;
int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
@@ -870,18 +810,17 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
return FALSE;
}
- case WMU_ENABLE_LIST_BUTTONS:
+
+ case WMU_ENABLE_LIST_BUTTONS:
{
HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (hItem)
- {
+ if (hItem) {
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_REMOVE), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_UP), TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem) ? TRUE : FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_DOWN), TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem) ? TRUE : FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_EDIT), TRUE);
}
- else
- {
+ else {
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_REMOVE), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_UP), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_DOWN), FALSE);
@@ -889,135 +828,60 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
- if (sel == -1)
- {
+ if (sel == -1) {
HWND hw = GetDlgItem(hwndDlg, IDC_BTN_REMOVE2);
EnableWindow(hw, FALSE);
hw = GetDlgItem(hwndDlg, IDC_BTN_EDIT2);
EnableWindow(hw, FALSE);
}
- else
- {
+ else {
HWND hw = GetDlgItem(hwndDlg, IDC_BTN_REMOVE2);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_BTN_EDIT2);
EnableWindow(hw, TRUE);
}
- return TRUE;
}
- case WM_COMMAND:
- {
- if (HIWORD(wParam) == LBN_SELCHANGE && LOWORD(wParam) == IDC_LST_SUBST)
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- else if (HIWORD(wParam) == CBN_SELCHANGE)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- else if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- else if (HIWORD(wParam) == LBN_DBLCLK && LOWORD(wParam) == IDC_LST_SUBST)
- {
- int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
- if (sel != CB_ERR)
- {
- DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
- {
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
+ return TRUE;
- sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, sel, (LPARAM)ds_value);
+ case WM_COMMAND:
+ if (HIWORD(wParam) == LBN_SELCHANGE && LOWORD(wParam) == IDC_LST_SUBST)
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ else if (HIWORD(wParam) == CBN_SELCHANGE)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ else if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ else if (HIWORD(wParam) == LBN_DBLCLK && LOWORD(wParam) == IDC_LST_SUBST) {
+ int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
+ if (sel != CB_ERR) {
+ DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK) {
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, sel, 0);
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, sel, (LPARAM)ds_value);
+
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, sel, 0);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
- else if (HIWORD(wParam) == BN_CLICKED)
- {
- switch (LOWORD(wParam))
+ }
+ else if (HIWORD(wParam) == BN_CLICKED) {
+ switch (LOWORD(wParam)) {
+ case IDC_BTN_ADD:
{
- case IDC_BTN_ADD:
- {
- DIListNode *di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
- memset(di_value, 0, sizeof(DIListNode));
- di_value->di.bIsVisible = true;
-
- int result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di);
- if (result == IDOK || (result >= IDPRESETITEM && result < (IDPRESETITEM + 100)))
- {
- TVINSERTSTRUCT tvi = {0};
- tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
- tvi.item.stateMask = TVIS_STATEIMAGEMASK;
- tvi.item.lParam = (LPARAM)di_value;
- tvi.item.state = INDEXTOSTATEIMAGEMASK(2);
- SetTreeItemText(di_value, &tvi.item.pszText);
-
- HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (hItem)
- tvi.hInsertAfter = hItem;
- else
- tvi.hInsertAfter = TVI_LAST;
- TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
-
- if (hItem)
- {
- HTREEITEM hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
- if (hNewItem)
- TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hNewItem);
- }
+ DIListNode *di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ memset(di_value, 0, sizeof(DIListNode));
+ di_value->di.bIsVisible = true;
- if (result >= IDPRESETITEM)
- {
- for (int i = 0; i < MAX_PRESET_SUBST_COUNT; i++)
- {
-
- PRESETSUBST *subst = GetPresetSubstByName(presetItems[result - IDPRESETITEM].szNeededSubst[i]);
- if (subst == NULL)
- break;
- if (SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_FINDSTRING, -1, (LPARAM)subst->swzName) == LB_ERR)
- {
- DSListNode *ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
- memset(ds_value, 0, sizeof(DSListNode));
- ds_value->next = NULL;
- ds_value->ds.type = subst->type;
- _tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN-1);
-
- if (ds_value->ds.type == DVT_DB && subst->szModuleName)
- strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN-1);
-
- if (subst->szSettingName)
- strncpy(ds_value->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN-1);
-
- ds_value->ds.iTranslateFuncId = subst->iTranslateFuncId;
-
- int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, index, (LPARAM)ds_value);
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, index, 0);
- }
- }
- }
-
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- else
- mir_free(di_value);
-
- return TRUE;
- }
- case IDC_BTN_SEPARATOR:
- {
- DIListNode *di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
- memset(di_value, 0, sizeof(DIListNode));
- di_value->di.bIsVisible = true;
- di_value->di.bLineAbove = true;
-
- TVINSERTSTRUCT tvi = {0};
+ int result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di);
+ if (result == IDOK || (result >= IDPRESETITEM && result < (IDPRESETITEM + 100))) {
+ TVINSERTSTRUCT tvi = { 0 };
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
tvi.item.lParam = (LPARAM)di_value;
tvi.item.state = INDEXTOSTATEIMAGEMASK(2);
- tvi.item.pszText = _T("---------------------------------");
+ SetTreeItemText(di_value, &tvi.item.pszText);
HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
if (hItem)
@@ -1026,230 +890,144 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA tvi.hInsertAfter = TVI_LAST;
TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- return TRUE;
- }
- case IDC_BTN_REMOVE:
- {
- TVITEM item = {0};
- item.mask = TVIF_PARAM;
- item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (item.hItem)
- {
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
- {
- DIListNode *di_value = (DIListNode *)item.lParam;
- mir_free(di_value);
- TreeView_DeleteItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- return TRUE;
- }
- case IDC_BTN_UP:
- case IDC_BTN_DOWN:
- {
- HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (hItem)
- {
- HTREEITEM hNewItem;
- if (LOWORD(wParam) == IDC_BTN_UP)
- hNewItem = TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
- else
- hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
-
+ if (hItem) {
+ HTREEITEM hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
if (hNewItem)
- {
- TCHAR buff[512], buff2[512];
- LPARAM tmpParam;
- UINT tmpState;
-
- TVITEM item = {0};
- item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
- item.stateMask = TVIS_STATEIMAGEMASK;
- item.hItem = hItem;
- item.pszText = buff;
- item.cchTextMax = SIZEOF(buff);
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
- {
- tmpParam = item.lParam;
- tmpState = item.state;
- item.hItem = hNewItem;
- item.pszText = buff2;
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
- {
- item.hItem = hItem;
- TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
-
- item.hItem = hNewItem;
- item.pszText = buff;
- item.lParam = tmpParam;
- item.state = tmpState;
- TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
- TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hNewItem);
- }
- }
- }
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hNewItem);
}
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- return TRUE;
- }
- case IDC_BTN_EDIT:
- {
- TVITEM item = {0};
- item.mask = TVIF_PARAM;
- item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (item.hItem )
- {
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
- {
- DIListNode *di_value = (DIListNode *)item.lParam;
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK)
- {
- item.mask = TVIF_TEXT;
- SetTreeItemText(di_value, &item.pszText);
- TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- }
-
- return TRUE;
- }
- case IDC_BTN_ADD2:
- {
- DSListNode *ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
- memset(ds_value, 0, sizeof(DSListNode));
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
- {
- int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, index, (LPARAM)ds_value);
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, index, 0);
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- else
- mir_free(ds_value);
+ if (result >= IDPRESETITEM) {
+ for (int i = 0; i < MAX_PRESET_SUBST_COUNT; i++) {
- return TRUE;
- }
- case IDC_BTN_REMOVE2:
- {
- int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
- if (sel != LB_ERR)
- {
- DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
- mir_free(ds_value);
+ PRESETSUBST *subst = GetPresetSubstByName(presetItems[result - IDPRESETITEM].szNeededSubst[i]);
+ if (subst == NULL)
+ break;
+ if (SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_FINDSTRING, -1, (LPARAM)subst->swzName) == LB_ERR) {
+ DSListNode *ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ memset(ds_value, 0, sizeof(DSListNode));
+ ds_value->next = NULL;
+ ds_value->ds.type = subst->type;
+ _tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ if (ds_value->ds.type == DVT_DB && subst->szModuleName)
+ strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1);
- return TRUE;
- }
- case IDC_BTN_EDIT2:
- {
- int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
- if (sel != LB_ERR)
- {
- DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
- {
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
+ if (subst->szSettingName)
+ strncpy(ds_value->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN - 1);
- sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, sel, (LPARAM)ds_value);
+ ds_value->ds.iTranslateFuncId = subst->iTranslateFuncId;
- SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, sel, 0);
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, index, (LPARAM)ds_value);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, index, 0);
+ }
}
}
- return TRUE;
- }
- default:
- {
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- return TRUE;
}
+ else
+ mir_free(di_value);
+
+ return TRUE;
}
- }
- break;
- }
- case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ case IDC_BTN_SEPARATOR:
{
- DIListNode *di_node;
- while (opt.diList)
- {
- di_node = opt.diList;
- opt.diList = opt.diList->next;
- mir_free(di_node);
- }
+ DIListNode *di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ memset(di_value, 0, sizeof(DIListNode));
+ di_value->di.bIsVisible = true;
+ di_value->di.bLineAbove = true;
- DIListNode *di_value;
- opt.iDiCount = TreeView_GetCount(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ TVINSERTSTRUCT tvi = { 0 };
+ tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
+ tvi.item.stateMask = TVIS_STATEIMAGEMASK;
+ tvi.item.lParam = (LPARAM)di_value;
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(2);
+ tvi.item.pszText = _T("---------------------------------");
+
+ HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (hItem)
+ tvi.hInsertAfter = hItem;
+ else
+ tvi.hInsertAfter = TVI_LAST;
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
- TVITEM item = {0};
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
+ }
+ case IDC_BTN_REMOVE:
+ {
+ TVITEM item = { 0 };
item.mask = TVIF_PARAM;
- item.hItem = TreeView_GetLastVisible(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- while (item.hItem != NULL)
- {
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
- {
- di_node = (DIListNode *)item.lParam;
- di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
- *di_value = *di_node;
- di_value->next = opt.diList;
- opt.diList = di_value;
+ item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (item.hItem) {
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item)) {
+ DIListNode *di_value = (DIListNode *)item.lParam;
+ mir_free(di_value);
+ TreeView_DeleteItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- item.hItem = TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
}
+ return TRUE;
+ }
+ case IDC_BTN_UP:
+ case IDC_BTN_DOWN:
+ {
+ HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (hItem) {
+ HTREEITEM hNewItem;
+ if (LOWORD(wParam) == IDC_BTN_UP)
+ hNewItem = TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
+ else
+ hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
- DSListNode *ds_node;
- while (opt.dsList)
- {
- ds_node = opt.dsList;
- opt.dsList = opt.dsList->next;
- mir_free(ds_node);
- }
+ if (hNewItem) {
+ TCHAR buff[512], buff2[512];
+ LPARAM tmpParam;
+ UINT tmpState;
- DSListNode *ds_value;
- opt.iDsCount = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCOUNT, 0, 0);
- for (int i = opt.iDsCount - 1; i >= 0; i--)
- {
- ds_node = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, i, 0);
- ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
- *ds_value = *ds_node;
- ds_value->next = opt.dsList;
- opt.dsList = ds_value;
+ TVITEM item = { 0 };
+ item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ item.hItem = hItem;
+ item.pszText = buff;
+ item.cchTextMax = SIZEOF(buff);
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item)) {
+ tmpParam = item.lParam;
+ tmpState = item.state;
+ item.hItem = hNewItem;
+ item.pszText = buff2;
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item)) {
+ item.hItem = hItem;
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
+
+ item.hItem = hNewItem;
+ item.pszText = buff;
+ item.lParam = tmpParam;
+ item.state = tmpState;
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hNewItem);
+ }
+ }
+ }
}
- SaveItems();
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
return TRUE;
}
- case NM_DBLCLK:
+ case IDC_BTN_EDIT:
{
- TVITEM item = {0};
+ TVITEM item = { 0 };
item.mask = TVIF_PARAM;
item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- if (item.hItem)
- {
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
- {
+ if (item.hItem) {
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item)) {
DIListNode *di_value = (DIListNode *)item.lParam;
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK)
- {
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK) {
item.mask = TVIF_TEXT;
SetTreeItemText(di_value, &item.pszText);
TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
@@ -1258,69 +1036,182 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
}
}
- break;
+
+ return TRUE;
}
- case NM_CLICK:
+ case IDC_BTN_ADD2:
{
- TVHITTESTINFO hti;
- 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))
- {
- if (hti.flags & TVHT_ONITEMSTATEICON)
- {
- TVITEMA item = {0};
- item.hItem = hti.hItem;
- item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE;
- item.stateMask = TVIS_STATEIMAGEMASK;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+ DSListNode *ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ memset(ds_value, 0, sizeof(DSListNode));
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK) {
+ int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, index, (LPARAM)ds_value);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, index, 0);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ else
+ mir_free(ds_value);
- if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 1)
- ((DIListNode *)item.lParam)->di.bIsVisible = true;
- else
- ((DIListNode *)item.lParam)->di.bIsVisible = false;
+ return TRUE;
+ }
+ case IDC_BTN_REMOVE2:
+ {
+ int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
+ if (sel != LB_ERR) {
+ DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
+ mir_free(ds_value);
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &item);
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- break;
+
+ return TRUE;
}
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
+ case IDC_BTN_EDIT2:
{
- SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
- break;
+ int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
+ if (sel != LB_ERR) {
+ DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK) {
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
+
+ sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, sel, (LPARAM)ds_value);
+
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, sel, 0);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+
+ return TRUE;
}
+ default:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
}
- break;
}
- case WM_DESTROY:
- {
- TVITEM tvi = {0};
- tvi.mask = TVIF_PARAM;
-
- for (HTREEITEM hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));hItem != NULL;
- hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem))
+ break;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- tvi.hItem = hItem;
- if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi))
- {
- DIListNode *di_value = (DIListNode *)tvi.lParam;
- mir_free(di_value);
+ DIListNode *di_node;
+ while (opt.diList) {
+ di_node = opt.diList;
+ opt.diList = opt.diList->next;
+ mir_free(di_node);
+ }
+
+ DIListNode *di_value;
+ opt.iDiCount = TreeView_GetCount(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+
+ TVITEM item = { 0 };
+ item.mask = TVIF_PARAM;
+ item.hItem = TreeView_GetLastVisible(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ while (item.hItem != NULL) {
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item)) {
+ di_node = (DIListNode *)item.lParam;
+ di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ *di_value = *di_node;
+ di_value->next = opt.diList;
+ opt.diList = di_value;
+ }
+ item.hItem = TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
+ }
+
+ DSListNode *ds_node;
+ while (opt.dsList) {
+ ds_node = opt.dsList;
+ opt.dsList = opt.dsList->next;
+ mir_free(ds_node);
+ }
+
+ DSListNode *ds_value;
+ opt.iDsCount = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCOUNT, 0, 0);
+ for (int i = opt.iDsCount - 1; i >= 0; i--) {
+ ds_node = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, i, 0);
+ ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ *ds_value = *ds_node;
+ ds_value->next = opt.dsList;
+ opt.dsList = ds_value;
}
- }
- int count = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCOUNT, 0, 0);
- for (int i = 0; i < count; i++)
+ SaveItems();
+ return TRUE;
+ }
+ case NM_DBLCLK:
{
- DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, i, 0);
- mir_free(ds_value);
+ TVITEM item = { 0 };
+ item.mask = TVIF_PARAM;
+ item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (item.hItem) {
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item)) {
+ DIListNode *di_value = (DIListNode *)item.lParam;
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK) {
+ item.mask = TVIF_TEXT;
+ SetTreeItemText(di_value, &item.pszText);
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+ }
+ break;
+ }
+ case NM_CLICK:
+ TVHITTESTINFO hti;
+ 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)) {
+ if (hti.flags & TVHT_ONITEMSTATEICON) {
+ TVITEMA item = { 0 };
+ item.hItem = hti.hItem;
+ item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 1)
+ ((DIListNode *)item.lParam)->di.bIsVisible = true;
+ else
+ ((DIListNode *)item.lParam)->di.bIsVisible = false;
+
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+ SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ }
}
+ break;
+ case TVN_SELCHANGED:
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
break;
}
+ break;
+
+ case WM_DESTROY:
+ TVITEM tvi = { 0 };
+ tvi.mask = TVIF_PARAM;
+
+ for (HTREEITEM hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS)); hItem != NULL;
+ hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem)) {
+ tvi.hItem = hItem;
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi)) {
+ DIListNode *di_value = (DIListNode *)tvi.lParam;
+ mir_free(di_value);
+ }
+ }
+
+ int count = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCOUNT, 0, 0);
+ for (int i = 0; i < count; i++) {
+ DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, i, 0);
+ mir_free(ds_value);
+ }
+
+ break;
}
return 0;
@@ -1328,11 +1219,10 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
- TranslateDialogDefault( hwndDlg );
+ TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_CHK_SHOWTITLE, opt.bShowTitle ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_NOFOCUS, opt.bShowNoFocus ? BST_CHECKED : BST_UNCHECKED);
@@ -1352,47 +1242,41 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Top"));
SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Center"));
SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom"));
- switch (opt.iLabelValign)
- {
- case DT_TOP: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 0, 0); break;
- case DT_VCENTER: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 1, 0); break;
- case DT_BOTTOM: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 2, 0); break;
+ switch (opt.iLabelValign) {
+ case DT_TOP: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 0, 0); break;
+ case DT_VCENTER: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 1, 0); break;
+ case DT_BOTTOM: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 2, 0); break;
}
SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Top"));
SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Center"));
SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom"));
- switch (opt.iValueValign)
- {
- case DT_TOP: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 0, 0); break;
- case DT_VCENTER: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 1, 0); break;
- case DT_BOTTOM: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 2, 0); break;
+ switch (opt.iValueValign) {
+ case DT_TOP: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 0, 0); break;
+ case DT_VCENTER: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 1, 0); break;
+ case DT_BOTTOM: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 2, 0); break;
}
SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left"));
SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right"));
- switch (opt.iLabelHalign)
- {
- case DT_LEFT: SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_SETCURSEL, 0, 0); break;
- case DT_RIGHT: SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_SETCURSEL, 1, 0); break;
+ switch (opt.iLabelHalign) {
+ case DT_LEFT: SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_SETCURSEL, 0, 0); break;
+ case DT_RIGHT: SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_SETCURSEL, 1, 0); break;
}
SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left"));
SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right"));
- switch (opt.iValueHalign)
- {
- case DT_LEFT: SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_SETCURSEL, 0, 0); break;
- case DT_RIGHT: SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_SETCURSEL, 1, 0); break;
+ switch (opt.iValueHalign) {
+ case DT_LEFT: SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_SETCURSEL, 0, 0); break;
+ case DT_RIGHT: SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_SETCURSEL, 1, 0); break;
}
SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("No avatar"));
- if (ServiceExists(MS_AV_DRAWAVATAR))
- {
+ if (ServiceExists(MS_AV_DRAWAVATAR)) {
SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left avatar"));
SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right avatar"));
}
- else
- {
+ else {
HWND hw = GetDlgItem(hwndDlg, IDC_CMB_AV);
EnableWindow(hw, FALSE);
hw = GetDlgItem(hwndDlg, IDC_SPIN_AVSIZE);
@@ -1441,7 +1325,7 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP return FALSE;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
if (LOWORD(wParam) == IDC_CHK_ORIGINALAVSIZE)
SetDlgItemText(hwndDlg, IDC_STATIC_AVATARSIZE, IsDlgButtonChecked(hwndDlg, IDC_CHK_ORIGINALAVSIZE) ? TranslateT("Max avatar size:") : TranslateT("Avatar size:"));
@@ -1455,10 +1339,9 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
- {
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
BOOL trans;
int new_val = GetDlgItemInt(hwndDlg, IDC_ED_WIDTH, &trans, FALSE);
if (trans) opt.iWinWidth = new_val;
@@ -1494,37 +1377,33 @@ INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LP opt.pos = (PopupPosition)SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_GETCURSEL, 0, 0);
opt.bAvatarBorder = IsDlgButtonChecked(hwndDlg, IDC_CHK_AVBORDER) ? true : false;
- opt.bAvatarRound = IsDlgButtonChecked(hwndDlg, IDC_CHK_ROUNDCORNERSAV) && IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHK_ROUNDCORNERSAV)) ? true : false;
+ opt.bAvatarRound = IsDlgButtonChecked(hwndDlg, IDC_CHK_ROUNDCORNERSAV) && IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHK_ROUNDCORNERSAV)) ? true : false;
opt.bOriginalAvatarSize = IsDlgButtonChecked(hwndDlg, IDC_CHK_ORIGINALAVSIZE) ? true : false;
opt.bShowTitle = IsDlgButtonChecked(hwndDlg, IDC_CHK_SHOWTITLE) ? true : false;
opt.bShowNoFocus = IsDlgButtonChecked(hwndDlg, IDC_CHK_NOFOCUS) ? true : false;
opt.bStatusBarTips = IsDlgButtonChecked(hwndDlg, IDC_CHK_SBAR) ? true : false;
- switch (SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_GETCURSEL, 0, 0))
- {
- case 0: opt.iLabelValign = DT_TOP; break;
- case 1: opt.iLabelValign = DT_VCENTER; break;
- case 2: opt.iLabelValign = DT_BOTTOM; break;
+ switch (SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_GETCURSEL, 0, 0)) {
+ case 0: opt.iLabelValign = DT_TOP; break;
+ case 1: opt.iLabelValign = DT_VCENTER; break;
+ case 2: opt.iLabelValign = DT_BOTTOM; break;
}
- switch (SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_GETCURSEL, 0, 0))
- {
- case 0: opt.iValueValign = DT_TOP; break;
- case 1: opt.iValueValign = DT_VCENTER; break;
- case 2: opt.iValueValign = DT_BOTTOM; break;
+ switch (SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_GETCURSEL, 0, 0)) {
+ case 0: opt.iValueValign = DT_TOP; break;
+ case 1: opt.iValueValign = DT_VCENTER; break;
+ case 2: opt.iValueValign = DT_BOTTOM; break;
}
- switch (SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_GETCURSEL, 0, 0))
- {
- case 0: opt.iLabelHalign = DT_LEFT; break;
- case 1: opt.iLabelHalign = DT_RIGHT; break;
+ switch (SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_GETCURSEL, 0, 0)) {
+ case 0: opt.iLabelHalign = DT_LEFT; break;
+ case 1: opt.iLabelHalign = DT_RIGHT; break;
}
- switch (SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_GETCURSEL, 0, 0))
- {
- case 0: opt.iValueHalign = DT_LEFT; break;
- case 1: opt.iValueHalign = DT_RIGHT; break;
+ switch (SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_GETCURSEL, 0, 0)) {
+ case 0: opt.iValueHalign = DT_LEFT; break;
+ case 1: opt.iValueHalign = DT_RIGHT; break;
}
SaveOptions();
@@ -1541,9 +1420,8 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
EXTRAICONDATA *dat = (EXTRAICONDATA *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
@@ -1568,8 +1446,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, opt.iLimitCharCount, FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_CHARCOUNT), opt.bLimitMsg);
- for (int i = 0; i < EXICONS_COUNT; i++)
- {
+ for (int i = 0; i < EXICONS_COUNT; i++) {
exIcons[i].order = opt.exIconsOrder[i];
exIcons[i].vis = opt.exIconsVis[i];
}
@@ -1579,13 +1456,12 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
- TVINSERTSTRUCT tvi = {0};
+ TVINSERTSTRUCT tvi = { 0 };
tvi.hParent = 0;
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
- for (int i = 0; i < SIZEOF(extraIconName); i++)
- {
+ for (int i = 0; i < SIZEOF(extraIconName); i++) {
tvi.item.lParam = (LPARAM)&exIcons[i];
tvi.item.pszText = TranslateTS(extraIconName[exIcons[i].order]);
tvi.item.state = INDEXTOSTATEIMAGEMASK(exIcons[i].vis ? 2 : 1);
@@ -1594,11 +1470,10 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM return TRUE;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
- switch (LOWORD(wParam))
- {
- case IDC_CHK_ENABLESMILEYS:
+ switch (LOWORD(wParam)) {
+ case IDC_CHK_ENABLESMILEYS:
{
BOOL bEnable = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLESMILEYS);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_RESIZESMILEYS), bEnable);
@@ -1607,12 +1482,12 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_RESIZESMILEYS), bEnable);
break;
}
- case IDC_CHK_LIMITMSG:
+ case IDC_CHK_LIMITMSG:
{
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_CHARCOUNT), IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG));
break;
}
- case IDC_CHK_GETSTATUSMSG:
+ case IDC_CHK_GETSTATUSMSG:
{
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DISABLEINVISIBLE), IsDlgButtonChecked(hwndDlg, IDC_CHK_GETSTATUSMSG));
break;
@@ -1621,23 +1496,20 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
-
+
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- switch (((LPNMHDR)lParam)->idFrom)
- {
- case 0:
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
{
- if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
- {
- TVITEM item = {0};
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
+ TVITEM item = { 0 };
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS));
int i = 0;
- while (item.hItem != NULL)
- {
+ while (item.hItem != NULL) {
item.mask = TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
opt.exIconsOrder[i] = ((ICONSTATE *)item.lParam)->order;
@@ -1673,29 +1545,24 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
break;
}
- case IDC_TREE_EXTRAICONS:
+ case IDC_TREE_EXTRAICONS:
{
- switch (((LPNMHDR)lParam)->code)
- {
- case TVN_BEGINDRAGA:
- case TVN_BEGINDRAGW:
- {
- SetCapture(hwndDlg);
- dat->bDragging = true;
- dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), dat->hDragItem);
- break;
- }
- case NM_CLICK:
+ switch (((LPNMHDR)lParam)->code) {
+ case TVN_BEGINDRAG:
+ SetCapture(hwndDlg);
+ dat->bDragging = true;
+ dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), dat->hDragItem);
+ break;
+
+ case NM_CLICK:
{
TVHITTESTINFO hti;
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))
- {
- if (hti.flags & TVHT_ONITEMSTATEICON)
- {
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti)) {
+ if (hti.flags & TVHT_ONITEMSTATEICON) {
TVITEMA item;
item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE;
item.stateMask = TVIS_STATEIMAGEMASK;
@@ -1718,7 +1585,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
break;
}
- case WM_MOUSEMOVE:
+ case WM_MOUSEMOVE:
{
if (!dat->bDragging)
break;
@@ -1729,8 +1596,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti.pt);
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti);
- if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT))
- {
+ if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT)) {
HTREEITEM hItem = hti.hItem;
hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS)) / 2;
TreeView_HitTest(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti);
@@ -1739,8 +1605,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else
TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), hItem, 0);
}
- else
- {
+ else {
if (hti.flags & TVHT_ABOVE)
SendDlgItemMessage(hwndDlg, IDC_TREE_EXTRAICONS, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
if (hti.flags & TVHT_BELOW)
@@ -1750,7 +1615,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
break;
}
- case WM_LBUTTONUP:
+ case WM_LBUTTONUP:
{
if (!dat->bDragging)
break;
@@ -1776,8 +1641,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM item.mask = TVIF_HANDLE | TVIF_PARAM;
item.hItem = dat->hDragItem;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
- if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST))
- {
+ if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
TVINSERTSTRUCT tvis;
TCHAR swzName[256];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
@@ -1796,7 +1660,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
}
- case WM_DESTROY:
+ case WM_DESTROY:
{
mir_free(dat);
break;
@@ -1815,18 +1679,15 @@ void EnableControls(HWND hwndDlg, bool bEnableSkin) EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_LOADFONTS), bEnableSkin);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_LOADPROPORTIONS), bEnableSkin);
- if(!bEnableSkin)
- {
+ if (!bEnableSkin) {
CheckDlgButton(hwndDlg, IDC_CHK_ENABLECOLORING, BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_ENABLECOLORING), FALSE);
}
- else if (opt.iEnableColoring == -1)
- {
+ else if (opt.iEnableColoring == -1) {
CheckDlgButton(hwndDlg, IDC_CHK_ENABLECOLORING, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_ENABLECOLORING), FALSE);
}
- else
- {
+ else {
CheckDlgButton(hwndDlg, IDC_CHK_ENABLECOLORING, opt.iEnableColoring ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_ENABLECOLORING), TRUE);
}
@@ -1835,9 +1696,8 @@ void EnableControls(HWND hwndDlg, bool bEnableSkin) int iLastSel;
INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
iLastSel = RefreshSkinList(hwndDlg);
@@ -1882,32 +1742,28 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EnableControls(hwndDlg, opt.skinMode == SM_IMAGE);
return TRUE;
}
- case WM_DRAWITEM:
+ case WM_DRAWITEM:
{
- if (wParam == IDC_PIC_PREVIEW)
- {
+ if (wParam == IDC_PIC_PREVIEW) {
DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
HBRUSH hbr = GetSysColorBrush(COLOR_BTNFACE);
FillRect(dis->hDC, &dis->rcItem, hbr);
- if (opt.szPreviewFile[0])
- {
+ if (opt.szPreviewFile[0]) {
HDC hdcMem = CreateCompatibleDC(dis->hDC);
HBITMAP hbmpPreview = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)opt.szPreviewFile, IMGL_TCHAR);
- if (hbmpPreview)
- {
+ if (hbmpPreview) {
int iWidth = dis->rcItem.right - dis->rcItem.left;
int iHeight = dis->rcItem.bottom - dis->rcItem.top;
- ResizeBitmap rb = {0};
+ ResizeBitmap rb = { 0 };
rb.size = sizeof(rb);
rb.hBmp = hbmpPreview;
rb.max_width = iWidth;
rb.max_height = iHeight;
rb.fit = RESIZEBITMAP_KEEP_PROPORTIONS;
HBITMAP hbmpRes = (HBITMAP)CallService(MS_IMG_RESIZE, (WPARAM)&rb, 0);
- if (hbmpRes)
- {
+ if (hbmpRes) {
BITMAP bmp;
GetObject(hbmpRes, sizeof(bmp), &bmp);
SelectObject(hdcMem, hbmpRes);
@@ -1924,25 +1780,20 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
- switch (HIWORD(wParam))
- {
- case LBN_SELCHANGE:
+ switch (HIWORD(wParam)) {
+ case LBN_SELCHANGE:
{
- if (LOWORD(wParam) == IDC_LB_SKINS)
- {
+ if (LOWORD(wParam) == IDC_LB_SKINS) {
HWND hwndList = GetDlgItem(hwndDlg, IDC_LB_SKINS);
int iSel = ListBox_GetCurSel(hwndList);
- if (iSel != iLastSel)
- {
- if (iSel == 0)
- {
+ if (iSel != iLastSel) {
+ if (iSel == 0) {
opt.szPreviewFile[0] = 0;
EnableControls(hwndDlg, false);
}
- else if (iSel != LB_ERR)
- {
+ else if (iSel != LB_ERR) {
TCHAR swzSkinName[256];
if (ListBox_GetText(hwndList, iSel, swzSkinName) > 0)
ParseSkinFile(swzSkinName, false, true);
@@ -1953,27 +1804,22 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l iLastSel = iSel;
}
}
- else if (LOWORD(wParam) == IDC_CMB_EFFECT)
- {
+ else if (LOWORD(wParam) == IDC_CMB_EFFECT) {
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
}
- case BN_CLICKED:
+ case BN_CLICKED:
{
- if (LOWORD(wParam) == IDC_BTN_APPLYSKIN)
- {
+ if (LOWORD(wParam) == IDC_BTN_APPLYSKIN) {
int iSel = ListBox_GetCurSel(GetDlgItem(hwndDlg, IDC_LB_SKINS));
- if (iSel == 0)
- {
+ if (iSel == 0) {
opt.skinMode = SM_COLORFILL;
opt.szSkinName[0] = 0;
}
- else if (iSel != LB_ERR)
- {
- if (ListBox_GetText(GetDlgItem(hwndDlg, IDC_LB_SKINS), iSel, opt.szSkinName) > 0)
- {
+ else if (iSel != LB_ERR) {
+ if (ListBox_GetText(GetDlgItem(hwndDlg, IDC_LB_SKINS), iSel, opt.szSkinName) > 0) {
opt.skinMode = SM_IMAGE;
ParseSkinFile(opt.szSkinName, false, false);
ReloadFont(0, 0);
@@ -1983,7 +1829,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_b(0, MODULE, "SkinEngine", opt.skinMode);
db_set_ts(0, MODULE, "SkinName", opt.szSkinName);
-
+
DestroySkinBitmap();
SetDlgItemInt(hwndDlg, IDC_ED_TRANS, opt.iOpacity, FALSE);
}
@@ -2005,10 +1851,9 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY )
- {
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
opt.iOpacity = GetDlgItemInt(hwndDlg, IDC_ED_TRANS, 0, 0);
opt.bDropShadow = IsDlgButtonChecked(hwndDlg, IDC_CHK_SHADOW) ? true : false;
opt.bBorder = IsDlgButtonChecked(hwndDlg, IDC_CHK_BORDER) ? true : false;
@@ -2057,7 +1902,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, return TRUE;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_BTN_OK:
{
BYTE isChecked;
@@ -2096,9 +1941,8 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
@@ -2115,7 +1959,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
- TVINSERTSTRUCT tvi = {0};
+ TVINSERTSTRUCT tvi = { 0 };
tvi.hParent = 0;
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_STATE;
@@ -2124,10 +1968,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA PROTOACCOUNT **accs;
ProtoEnumAccounts(&count, &accs);
- for (i = 0; i < count; i++)
- {
- if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0)
- {
+ for (i = 0; i < count; i++) {
+ if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0) {
tvi.item.pszText = accs[i]->tszAccountName;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
tvi.item.state = INDEXTOSTATEIMAGEMASK(IsTrayProto(accs[i]->tszAccountName, false) ? 2 : 1);
@@ -2137,8 +1979,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
}
- for (i = 0; i < SIZEOF(trayTipItems); i++)
- {
+ for (i = 0; i < SIZEOF(trayTipItems); i++) {
tvi.item.pszText = TranslateTS(trayTipItems[i]);
tvi.item.state = INDEXTOSTATEIMAGEMASK(opt.iFirstItems & (1 << i) ? 2 : 1);
TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
@@ -2148,161 +1989,142 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA return TRUE;
}
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- UINT state;
- case IDC_CHK_ENABLETRAYTIP:
- {
- state = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HANDLEBYTIPPER), state);
- } // fall through
- case IDC_CHK_HANDLEBYTIPPER:
- {
- state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) & IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP);
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HIDEOFFLINE), state);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), state);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), state);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_FAVCONTACTS), state);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_EXPAND), state);
- } // fall through
- case IDC_CHK_EXPAND:
- {
- state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER)
- & IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP)
- & IsDlgButtonChecked(hwndDlg, IDC_CHK_EXPAND);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), state);
- EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), state);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ED_EXPANDTIME), state);
- break;
- }
- case IDC_BTN_FAVCONTACTS:
- {
- CreateDialog(hInst, MAKEINTRESOURCE(IDD_FAVCONTACTS), 0, DlgProcFavouriteContacts);
- break;
- }
- }
-
- if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ UINT state;
+ case IDC_CHK_ENABLETRAYTIP:
+ state = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HANDLEBYTIPPER), state);
+ // fall through
+
+ case IDC_CHK_HANDLEBYTIPPER:
+ state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) & IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HIDEOFFLINE), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_FAVCONTACTS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_EXPAND), state);
+ // fall through
+
+ case IDC_CHK_EXPAND:
+ state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER)
+ & IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP)
+ & IsDlgButtonChecked(hwndDlg, IDC_CHK_EXPAND);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ED_EXPANDTIME), state);
+ break;
+ case IDC_BTN_FAVCONTACTS:
+ CreateDialog(hInst, MAKEINTRESOURCE(IDD_FAVCONTACTS), 0, DlgProcFavouriteContacts);
break;
}
- case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- {
- if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
- {
- TCHAR buff[256];
- TCHAR swzProtos[1024] = {0};
-
- TVITEM item;
- item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS));
- item.pszText = buff;
- item.cchTextMax = SIZEOF(buff);
- item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_STATE;
- item.stateMask = TVIS_STATEIMAGEMASK;
- while (item.hItem != NULL)
- {
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), &item);
- if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
- {
- _tcscat(swzProtos, buff);
- _tcscat(swzProtos, _T(" "));
- }
-
- item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
- }
- db_set_ts(0, MODULE, "TrayProtocols", swzProtos);
+ if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+
+ break;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
+ TCHAR buff[256];
+ TCHAR swzProtos[1024] = { 0 };
+
+ TVITEM item;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS));
+ item.pszText = buff;
+ item.cchTextMax = SIZEOF(buff);
+ item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ while (item.hItem != NULL) {
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2) {
+ _tcscat(swzProtos, buff);
+ _tcscat(swzProtos, _T(" "));
+ }
- swzProtos[0] = 0;
- item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS));
- item.pszText = buff;
- while (item.hItem != NULL)
- {
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), &item);
- if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
- {
- _tcscat(swzProtos, buff);
- _tcscat(swzProtos, _T(" "));
- }
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
+ }
- item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
- }
+ db_set_ts(0, MODULE, "TrayProtocols", swzProtos);
- db_set_ts(0, MODULE, "TrayProtocolsEx", swzProtos);
+ swzProtos[0] = 0;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS));
+ item.pszText = buff;
+ while (item.hItem != NULL) {
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2) {
+ _tcscat(swzProtos, buff);
+ _tcscat(swzProtos, _T(" "));
+ }
- int count = 0;
- opt.iFirstItems = 0;
- item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
- item.mask = TVIF_HANDLE | TVIF_STATE;
- item.stateMask = TVIS_STATEIMAGEMASK;
- while (item.hItem != NULL)
- {
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
- if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
- opt.iFirstItems |= (1 << count);
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
+ }
- item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
- count++;
- }
+ db_set_ts(0, MODULE, "TrayProtocolsEx", swzProtos);
- count = 0;
- opt.iSecondItems = 0;
- item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS));
- while (item.hItem != NULL)
- {
- TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), &item);
- if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
- opt.iSecondItems |= (1 << count);
+ int count = 0;
+ opt.iFirstItems = 0;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ item.mask = TVIF_HANDLE | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ while (item.hItem != NULL) {
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
+ opt.iFirstItems |= (1 << count);
+
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
+ count++;
+ }
- item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), item.hItem);
- count++;
- }
+ count = 0;
+ opt.iSecondItems = 0;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS));
+ while (item.hItem != NULL) {
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
+ opt.iSecondItems |= (1 << count);
- opt.bTraytip = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP) ? true : false;
- opt.bHandleByTipper = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) ? true : false;
- opt.bExpandTraytip = IsDlgButtonChecked(hwndDlg, IDC_CHK_EXPAND) ? true : false;
- opt.bHideOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? true : false;
- opt.iExpandTime = max(min(GetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, 0, FALSE), 5000), 10);
-
- db_set_b(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
- db_set_b(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
- db_set_b(0, MODULE, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
- db_set_b(0, MODULE, "HideOffline", (opt.bHideOffline ? 1 : 0));
- db_set_dw(0, MODULE, "ExpandTime", opt.iExpandTime);
- db_set_dw(0, MODULE, "TrayTipItems", opt.iFirstItems);
- db_set_dw(0, MODULE, "TrayTipItemsEx", opt.iSecondItems);
- return TRUE;
- }
- break;
- }
- case IDC_TREE_FIRST_PROTOS:
- case IDC_TREE_SECOND_PROTOS:
- case IDC_TREE_FIRST_ITEMS:
- case IDC_TREE_SECOND_ITEMS:
- {
- if (((LPNMHDR)lParam)->code == NM_CLICK)
- {
- TVHITTESTINFO hti;
- 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))
- if (hti.flags & TVHT_ONITEMSTATEICON)
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- break;
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), item.hItem);
+ count++;
}
+
+ opt.bTraytip = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP) ? true : false;
+ opt.bHandleByTipper = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) ? true : false;
+ opt.bExpandTraytip = IsDlgButtonChecked(hwndDlg, IDC_CHK_EXPAND) ? true : false;
+ opt.bHideOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? true : false;
+ opt.iExpandTime = max(min(GetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, 0, FALSE), 5000), 10);
+
+ db_set_b(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
+ db_set_b(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
+ db_set_b(0, MODULE, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
+ db_set_b(0, MODULE, "HideOffline", (opt.bHideOffline ? 1 : 0));
+ db_set_dw(0, MODULE, "ExpandTime", opt.iExpandTime);
+ db_set_dw(0, MODULE, "TrayTipItems", opt.iFirstItems);
+ db_set_dw(0, MODULE, "TrayTipItemsEx", opt.iSecondItems);
+ return TRUE;
+ }
+ break;
+
+ case IDC_TREE_FIRST_PROTOS:
+ case IDC_TREE_SECOND_PROTOS:
+ case IDC_TREE_FIRST_ITEMS:
+ case IDC_TREE_SECOND_ITEMS:
+ if (((LPNMHDR)lParam)->code == NM_CLICK) {
+ TVHITTESTINFO hti;
+ 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))
+ if (hti.flags & TVHT_ONITEMSTATEICON)
+ SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
}
break;
}
+ break;
}
return FALSE;
@@ -2316,7 +2138,7 @@ int OptInit(WPARAM wParam, LPARAM lParam) odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_APPEARANCE);
- odp.pszTab = LPGEN("Appearance");
+ odp.pszTab = LPGEN("Appearance");
odp.pszTitle = LPGEN("Tooltips");
odp.pszGroup = LPGEN("Customize");
odp.pfnDlgProc = DlgProcOptsAppearance;
@@ -2363,24 +2185,20 @@ void DeinitOptions() UnhookEvent(hEventOptInit);
DIListNode *di_node = opt.diList;
- while (opt.diList)
- {
+ while (opt.diList) {
di_node = opt.diList;
opt.diList = opt.diList->next;
mir_free(di_node);
}
DSListNode *ds_node = opt.dsList;
- while (opt.dsList)
- {
+ while (opt.dsList) {
ds_node = opt.dsList;
opt.dsList = opt.dsList->next;
mir_free(ds_node);
}
for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
- {
if (opt.szImgFile[i])
mir_free(opt.szImgFile[i]);
- }
}
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index 97d94636c1..2a4290323d 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -399,8 +399,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDC_BUTTONORDERTREE:
switch (((LPNMHDR)lParam)->code) {
- case TVN_BEGINDRAGA:
- case TVN_BEGINDRAGW:
+ case TVN_BEGINDRAG:
SetCapture(hwndDlg);
dat->dragging = 1;
dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
@@ -421,8 +420,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
+ case TVN_SELCHANGED:
{
HTREEITEM hti = TreeView_GetSelection(hTree);
if (hti == NULL)
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp index fe0a5c5656..57a4ed5860 100644 --- a/src/modules/clist/contacts.cpp +++ b/src/modules/clist/contacts.cpp @@ -418,7 +418,7 @@ static INT_PTR CALLBACK ContactOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara break;
case IDC_NAMEORDER:
- if (((LPNMHDR)lParam)->code == TVN_BEGINDRAGA) {
+ if (((LPNMHDR)lParam)->code == TVN_BEGINDRAG) {
LPNMTREEVIEWA notify = (LPNMTREEVIEWA)lParam;
if (notify->itemNew.lParam == 0 || notify->itemNew.lParam == SIZEOF(nameOrderDescr)-1)
break;
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 55e6a34073..8bcce682b0 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -428,11 +428,11 @@ static int handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD) case CDDS_ITEMPREPAINT: { - HTREEITEM hItem = (HTREEITEM) pNMTVCD->nmcd.dwItemSpec; + HTREEITEM hItem = (HTREEITEM)pNMTVCD->nmcd.dwItemSpec; TCHAR buf[255]; - TVITEM tvi = {0}; - tvi.mask = TVIF_HANDLE |TVIF_PARAM|TVIS_SELECTED|TVIF_TEXT|TVIF_IMAGE; + TVITEM tvi = { 0 }; + tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIS_SELECTED | TVIF_TEXT | TVIF_IMAGE; tvi.stateMask = TVIS_SELECTED; tvi.hItem = hItem; tvi.pszText = buf; @@ -457,10 +457,10 @@ static int handleCustomDraw(HWND hWndTreeView, LPNMTVCUSTOMDRAW pNMTVCD) GetTextExtentPoint32(pNMTVCD->nmcd.hdc, tvi.pszText, (int)mir_tstrlen(tvi.pszText), &sz); RECT rc; - if (sz.cx+3 > pNMTVCD->nmcd.rc.right - pNMTVCD->nmcd.rc.left) + if (sz.cx + 3 > pNMTVCD->nmcd.rc.right - pNMTVCD->nmcd.rc.left) rc = pNMTVCD->nmcd.rc; else - SetRect(&rc, pNMTVCD->nmcd.rc.left, pNMTVCD->nmcd.rc.top, pNMTVCD->nmcd.rc.left+sz.cx+3, pNMTVCD->nmcd.rc.bottom); + SetRect(&rc, pNMTVCD->nmcd.rc.left, pNMTVCD->nmcd.rc.top, pNMTVCD->nmcd.rc.left + sz.cx + 3, pNMTVCD->nmcd.rc.bottom); HBRUSH br = CreateSolidBrush(pNMTVCD->clrTextBk); SetTextColor(pNMTVCD->nmcd.hdc, pNMTVCD->clrText); @@ -493,17 +493,17 @@ static void OnClickCheckbox(HWND hwndDlg, HWND hwndTree, HTREEITEM hItem) static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - struct OrderData *dat = (struct OrderData*)GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA); + struct OrderData *dat = (struct OrderData*)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA); LPNMHDR hdr; switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); dat = (struct OrderData*)mir_alloc(sizeof(struct OrderData)); - SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA, (LONG_PTR)dat); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA, (LONG_PTR)dat); dat->dragging = 0; dat->iInitMenuValue = db_get_b(NULL, "CList", "MoveProtoMenus", TRUE); - mir_subclassWindow( GetDlgItem(hwndDlg, IDC_MENUITEMS), LBTNDOWNProc); + mir_subclassWindow(GetDlgItem(hwndDlg, IDC_MENUITEMS), LBTNDOWNProc); { HIMAGELIST himlCheckBoxes; himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2); @@ -511,8 +511,8 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK); ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_TICK); - TreeView_SetImageList( GetDlgItem(hwndDlg, IDC_MENUOBJECTS), himlCheckBoxes, TVSIL_NORMAL); - TreeView_SetImageList( GetDlgItem(hwndDlg, IDC_MENUITEMS), himlCheckBoxes, TVSIL_NORMAL); + TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_MENUOBJECTS), himlCheckBoxes, TVSIL_NORMAL); + TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_MENUITEMS), himlCheckBoxes, TVSIL_NORMAL); } CheckDlgButton(hwndDlg, dat->iInitMenuValue ? IDC_RADIO2 : IDC_RADIO1, BST_CHECKED); CheckDlgButton(hwndDlg, IDC_DISABLEMENUICONS, bIconsDisabled ? BST_CHECKED : BST_UNCHECKED); @@ -540,18 +540,15 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_GENMENU_DEFAULT: { - TVITEM tvi; - HTREEITEM hti; - MenuItemOptData *iod; - - hti = TreeView_GetSelection( GetDlgItem(hwndDlg, IDC_MENUITEMS)); + HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS)); if (hti == NULL) break; - tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM; + TVITEM tvi; + tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; tvi.hItem = hti; - TreeView_GetItem( GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi); - iod = (MenuItemOptData *)tvi.lParam; + TreeView_GetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi); + MenuItemOptData *iod = (MenuItemOptData *)tvi.lParam; if (iod->name && _tcsstr(iod->name, STR_SEPARATOR)) break; @@ -568,19 +565,18 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_GENMENU_SET: { - TVITEM tvi; TCHAR buf[256]; - MenuItemOptData *iod; - HTREEITEM hti = TreeView_GetSelection( GetDlgItem(hwndDlg, IDC_MENUITEMS)); + HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS)); if (hti == NULL) break; - tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM; + TVITEM tvi; + tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; tvi.hItem = hti; SendDlgItemMessage(hwndDlg, IDC_MENUITEMS, TVM_GETITEM, 0, (LPARAM)&tvi); - iod = (MenuItemOptData *)tvi.lParam; + MenuItemOptData *iod = (MenuItemOptData *)tvi.lParam; if (iod->name && _tcsstr(iod->name, STR_SEPARATOR)) break; @@ -602,7 +598,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_NOTIFY: hdr = (LPNMHDR)lParam; - switch(hdr->idFrom) { + switch (hdr->idFrom) { case 0: if (hdr->code == PSN_APPLY) { bIconsDisabled = IsDlgButtonChecked(hwndDlg, IDC_DISABLEMENUICONS) != 0; @@ -618,7 +614,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break; case IDC_MENUOBJECTS: - if (hdr->code == TVN_SELCHANGEDA) + if (hdr->code == TVN_SELCHANGED) RebuildCurrent(hwndDlg); break; @@ -628,7 +624,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, handleCustomDraw(GetDlgItem(hwndDlg, IDC_MENUITEMS), (LPNMTVCUSTOMDRAW)lParam)); return TRUE; - case TVN_BEGINDRAGA: + case TVN_BEGINDRAG: SetCapture(hwndDlg); dat->dragging = 1; dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem; @@ -655,7 +651,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA /// LabelClicked Set/unset selection TVITEM tvi; HWND tvw = hdr->hwndFrom; - tvi.mask = TVIF_HANDLE|TVIF_PARAM; + tvi.mask = TVIF_HANDLE | TVIF_PARAM; tvi.hItem = hti.hItem; TreeView_GetItem(tvw, &tvi); if (GetKeyState(VK_CONTROL) & 0x8000) { @@ -663,7 +659,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA iod->bIsSelected = !iod->bIsSelected; TreeView_SetItem(tvw, &tvi); } - else if (GetKeyState(VK_SHIFT)&0x8000) { + else if (GetKeyState(VK_SHIFT) & 0x8000) { ; // shifted click } else { @@ -673,29 +669,28 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break; do { - TVITEM tvi = {0}; - tvi.mask = TVIF_HANDLE|TVIF_PARAM; + TVITEM tvi = { 0 }; + tvi.mask = TVIF_HANDLE | TVIF_PARAM; tvi.hItem = hit; TreeView_GetItem(tvw, &tvi); MenuItemOptData *iod = (MenuItemOptData*)tvi.lParam; iod->bIsSelected = (hti.hItem == hit); TreeView_SetItem(tvw, &tvi); - } - while (hit = TreeView_GetNextSibling(tvw, hit)); + } while (hit = TreeView_GetNextSibling(tvw, hit)); } } } } break; - case TVN_SELCHANGEDA: + case TVN_SELCHANGED: SetDlgItemTextA(hwndDlg, IDC_GENMENU_CUSTOMNAME, ""); SetDlgItemTextA(hwndDlg, IDC_GENMENU_SERVICE, ""); - EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_CUSTOMNAME), FALSE); - EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), FALSE); - EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_SET), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_CUSTOMNAME), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_SET), FALSE); HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_MENUITEMS)); if (hti == NULL) @@ -704,7 +699,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TVITEM tvi; tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; tvi.hItem = hti; - TreeView_GetItem( GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi); + TreeView_GetItem(GetDlgItem(hwndDlg, IDC_MENUITEMS), &tvi); if (tvi.lParam == 0) break; @@ -718,9 +713,9 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (iod->pimi->submenu.first == NULL && iod->uniqname) SetDlgItemTextA(hwndDlg, IDC_GENMENU_SERVICE, iod->uniqname); - EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), mir_tstrcmp(iod->name, iod->defname) != 0); - EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_SET), TRUE); - EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_CUSTOMNAME), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), mir_tstrcmp(iod->name, iod->defname) != 0); + EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_SET), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_GENMENU_CUSTOMNAME), TRUE); break; } } @@ -734,21 +729,21 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hti.pt.x = (short)LOWORD(lParam); hti.pt.y = (short)HIWORD(lParam); ClientToScreen(hwndDlg, &hti.pt); - ScreenToClient( GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt); - TreeView_HitTest( GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti); - if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)) { + ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt); + TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti); + if (hti.flags&(TVHT_ONITEM | TVHT_ONITEMRIGHT)) { HTREEITEM it = hti.hItem; - hti.pt.y -= TreeView_GetItemHeight( GetDlgItem(hwndDlg, IDC_MENUITEMS))/2; - TreeView_HitTest( GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti); + hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_MENUITEMS)) / 2; + TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti); if (!(hti.flags&TVHT_ABOVE)) - TreeView_SetInsertMark( GetDlgItem(hwndDlg, IDC_MENUITEMS), hti.hItem, 1); + TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), hti.hItem, 1); else - TreeView_SetInsertMark( GetDlgItem(hwndDlg, IDC_MENUITEMS), it, 0); + TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), it, 0); } else { if (hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg, IDC_MENUITEMS, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0); if (hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg, IDC_MENUITEMS, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0); - TreeView_SetInsertMark( GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0); + TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0); } } break; @@ -757,7 +752,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (!dat->dragging) break; - TreeView_SetInsertMark( GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0); + TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_MENUITEMS), NULL, 0); dat->dragging = 0; ReleaseCapture(); { @@ -765,53 +760,48 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hti.pt.x = (short)LOWORD(lParam); hti.pt.y = (short)HIWORD(lParam); ClientToScreen(hwndDlg, &hti.pt); - ScreenToClient( GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt); - hti.pt.y-=TreeView_GetItemHeight( GetDlgItem(hwndDlg, IDC_MENUITEMS))/2; - TreeView_HitTest( GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti); + ScreenToClient(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti.pt); + hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_MENUITEMS)) / 2; + TreeView_HitTest(GetDlgItem(hwndDlg, IDC_MENUITEMS), &hti); if (hti.flags&TVHT_ABOVE) hti.hItem = TVI_FIRST; if (dat->hDragItem == hti.hItem) break; dat->hDragItem = NULL; - if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) { - HWND tvw; - HTREEITEM * pSIT; + if (hti.flags&(TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) { HTREEITEM FirstItem = NULL; - UINT uITCnt, uSic; - tvw = GetDlgItem(hwndDlg, IDC_MENUITEMS); - uITCnt = TreeView_GetCount(tvw); - uSic = 0; + HWND tvw = GetDlgItem(hwndDlg, IDC_MENUITEMS); + UINT uITCnt = TreeView_GetCount(tvw); + UINT uSic = 0; if (uITCnt) { - pSIT = (HTREEITEM *)mir_alloc(sizeof(HTREEITEM)*uITCnt); + HTREEITEM *pSIT = (HTREEITEM *)mir_alloc(sizeof(HTREEITEM)*uITCnt); if (pSIT) { - HTREEITEM hit; - hit = TreeView_GetRoot(tvw); - if (hit) + HTREEITEM hit = TreeView_GetRoot(tvw); + if (hit) { do { - TVITEM tvi = {0}; - tvi.mask = TVIF_HANDLE|TVIF_PARAM; + TVITEM tvi = { 0 }; + tvi.mask = TVIF_HANDLE | TVIF_PARAM; tvi.hItem = hit; TreeView_GetItem(tvw, &tvi); if (((MenuItemOptData *)tvi.lParam)->bIsSelected) { pSIT[uSic] = tvi.hItem; uSic++; } - }while (hit = TreeView_GetNextSibling(tvw, hit)); + } while (hit = TreeView_GetNextSibling(tvw, hit)); + } // Proceed moving - { - UINT i; - HTREEITEM insertAfter; - insertAfter = hti.hItem; - for (i=0; i<uSic; i++) { - if (insertAfter) insertAfter = MoveItemAbove(tvw, pSIT[i], insertAfter); - else break; - if (!i) FirstItem = insertAfter; - } + HTREEITEM insertAfter = hti.hItem; + for (UINT i = 0; i < uSic; i++) { + if (insertAfter) insertAfter = MoveItemAbove(tvw, pSIT[i], insertAfter); + else break; + if (!i) FirstItem = insertAfter; } + // free pointers... mir_free(pSIT); } } - if (FirstItem) TreeView_SelectItem(tvw, FirstItem); + if (FirstItem) + TreeView_SelectItem(tvw, FirstItem); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); SaveTree(hwndDlg); } @@ -822,7 +812,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (dat) mir_free(dat); - ImageList_Destroy(TreeView_SetImageList( GetDlgItem(hwndDlg, IDC_MENUOBJECTS), NULL, TVSIL_NORMAL)); + ImageList_Destroy(TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_MENUOBJECTS), NULL, TVSIL_NORMAL)); FreeTreeData(hwndDlg); break; diff --git a/src/modules/clist/protocolorder.cpp b/src/modules/clist/protocolorder.cpp index 7306864adc..9a1e02b02b 100644 --- a/src/modules/clist/protocolorder.cpp +++ b/src/modules/clist/protocolorder.cpp @@ -218,7 +218,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_PROTOCOLORDER:
switch (((LPNMHDR)lParam)->code) {
- case TVN_DELETEITEMA:
+ case TVN_DELETEITEM:
{
NMTREEVIEWA * pnmtv = (NMTREEVIEWA *) lParam;
if (pnmtv && pnmtv->itemOld.lParam)
@@ -226,7 +226,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
break;
- case TVN_BEGINDRAGA:
+ case TVN_BEGINDRAG:
SetCapture(hwndDlg);
dat->dragging = 1;
dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp index 2250b4c481..7e6f2c2d5b 100644 --- a/src/modules/extraicons/options_ei.cpp +++ b/src/modules/extraicons/options_ei.cpp @@ -588,8 +588,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (lpnmhdr->idFrom == IDC_EXTRAORDER) {
switch (lpnmhdr->code) {
- case TVN_BEGINDRAGW:
- case TVN_BEGINDRAGA:
+ case TVN_BEGINDRAG:
SetCapture(hwndDlg);
dragging = 1;
hDragItem = ((LPNMTREEVIEWA) lParam)->itemNew.hItem;
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 2d290d21c2..0a21cd878a 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -1157,22 +1157,18 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (((LPNMHDR) lParam)->idFrom == IDC_FONTGROUP) {
switch(((NMHDR*)lParam)->code) {
- case TVN_SELCHANGEDA: // !!!! This needs to be here - both !!
- case TVN_SELCHANGEDW:
+ case TVN_SELCHANGED:
SendMessage(hwndDlg, UM_SETFONTGROUP, 0, 0);
break;
- case TVN_DELETEITEMA: // no idea why both TVN_SELCHANGEDA/W should be there but let's keep this both too...
- case TVN_DELETEITEMW:
- {
- TreeItem *treeItem = (TreeItem *)(((LPNMTREEVIEW)lParam)->itemOld.lParam);
- if (treeItem) {
- mir_free(treeItem->groupName);
- mir_free(treeItem->paramName);
- mir_free(treeItem);
- }
- break;
+ case TVN_DELETEITEM:
+ TreeItem *treeItem = (TreeItem *)(((LPNMTREEVIEW)lParam)->itemOld.lParam);
+ if (treeItem) {
+ mir_free(treeItem->groupName);
+ mir_free(treeItem->paramName);
+ mir_free(treeItem);
}
+ break;
}
}
break;
diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp index 4318927897..b8454dbd75 100644 --- a/src/modules/icolib/skin2opts.cpp +++ b/src/modules/icolib/skin2opts.cpp @@ -983,8 +983,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_CATEGORYLIST:
switch(((NMHDR*)lParam)->code) {
- case TVN_SELCHANGEDA: // !!!! This needs to be here - both !!
- case TVN_SELCHANGEDW:
+ case TVN_SELCHANGED:
{
NMTREEVIEW *pnmtv = (NMTREEVIEW*)lParam;
TVITEM tvi = pnmtv->itemNew;
@@ -993,19 +992,18 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendMessage(hwndDlg, DM_REBUILDICONSPREVIEW, 0, (LPARAM)(
(SECTIONPARAM_FLAGS(treeItem->value)&SECTIONPARAM_HAVEPAGE)?
sectionList[ SECTIONPARAM_INDEX(treeItem->value) ] : NULL));
- break;
}
- case TVN_DELETEITEMA: // no idea why both TVN_SELCHANGEDA/W should be there but let's keep this both too...
- case TVN_DELETEITEMW:
- {
- TreeItem *treeItem = (TreeItem *)(((LPNMTREEVIEW)lParam)->itemOld.lParam);
- if (treeItem) {
- mir_free(treeItem->paramName);
- mir_free(treeItem);
- }
- break;
+ break;
+
+ case TVN_DELETEITEM:
+ TreeItem *treeItem = (TreeItem *)(((LPNMTREEVIEW)lParam)->itemOld.lParam);
+ if (treeItem) {
+ mir_free(treeItem->paramName);
+ mir_free(treeItem);
}
+ break;
}
+
if (bNeedRebuild) {
{
mir_cslock lck(csIconList);
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index 1293e52552..1d38355389 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -376,8 +376,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_SOUNDTREE:
switch(((NMHDR*)lParam)->code) {
- case TVN_SELCHANGEDW:
- case TVN_SELCHANGEDA:
+ case TVN_SELCHANGED:
{
NMTREEVIEW *pnmtv = (NMTREEVIEW*)lParam;
TVITEM tvi = pnmtv->itemNew;
|