From c274523d9bc253461a3c337d66e09532edae6edd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 9 Nov 2012 22:04:23 +0000 Subject: clist nicer+, part III, final: - standard icons (visible, invisible, chat active) removed from clist due to duplicates; - icon clicks work again; - fix for double extra icons drawing; - tons of various cleanups git-svn-id: http://svn.miranda-ng.org/main/trunk@2265 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/extBackg.cpp | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'plugins/Clist_nicer/src/extBackg.cpp') diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 0a7a7cefc5..504bcfa974 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -258,7 +258,7 @@ StatusItems_t *GetProtocolStatusItem(const char *szProto) return NULL; for (i = ID_EXTBK_LAST_D - ID_STATUS_OFFLINE + 1; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) { - if (!strcmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, szProto)) + if ( !strcmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, szProto)) return &StatusItems[i]; } return NULL; @@ -535,7 +535,7 @@ void extbk_export(char *file) mir_snprintf(szSection, 255, "Font%d", n); mir_snprintf(szKey, 255, "Font%dName", n); - if (!cfg::getString(NULL, "CLC", szKey, &dbv)) { + if ( !cfg::getString(NULL, "CLC", szKey, &dbv)) { WritePrivateProfileStringA(szSection, "Name", dbv.pszVal, file); mir_free(dbv.pszVal); } @@ -580,7 +580,7 @@ void extbk_export(char *file) WritePrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file); i++; } - if (!cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) { + if ( !cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) { WritePrivateProfileStringA("Global", "BkBitmap", dbv.pszVal, file); DBFreeVariant(&dbv); } @@ -733,7 +733,7 @@ static void IMG_CreateItem(ImageItem *item, const char *fileName, HDC hdc) static void IMG_DeleteItem(ImageItem *item) { - if (!(item->dwFlags & IMAGE_GLYPH)) { + if ( !(item->dwFlags & IMAGE_GLYPH)) { SelectObject(item->hdc, item->hbmOld); DeleteObject(item->hbm); DeleteDC(item->hdc); @@ -755,7 +755,7 @@ static void ReadItem(StatusItems_t *this_item, char *szItem, char *file) int i; for (i = 0; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) { - if (!_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) { + if ( !_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) { defaults = &StatusItems[i]; break; } @@ -887,7 +887,7 @@ done_with_glyph: tmpItem.bStretch = IMAGE_STRETCH_H; tmpItem.hbm = 0; - if (!_stricmp(itemname, "$glyphs")) { + if ( !_stricmp(itemname, "$glyphs")) { IMG_CreateItem(&tmpItem, szFinalName, hdc); if (tmpItem.hbm) { newItem = reinterpret_cast(malloc(sizeof(ImageItem))); @@ -898,7 +898,7 @@ done_with_glyph: goto imgread_done; } if (itemname[0] == '@') { - if (!(tmpItem.dwFlags & IMAGE_GLYPH)) + if ( !(tmpItem.dwFlags & IMAGE_GLYPH)) IMG_CreateItem(&tmpItem, szFinalName, hdc); if (tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) { ImageItem *pItem = g_ImageItems; @@ -922,10 +922,10 @@ done_with_glyph: for (n = 0;;n++) { mir_snprintf(szItemNr, 30, "Item%d", n); GetPrivateProfileStringA(itemname, szItemNr, "None", buffer, 500, szFileName); - if (!strcmp(buffer, "None")) + if ( !strcmp(buffer, "None")) break; - if (!strcmp(buffer, "CLUI")) { - if (!(tmpItem.dwFlags & IMAGE_GLYPH)) + if ( !strcmp(buffer, "CLUI")) { + if ( !(tmpItem.dwFlags & IMAGE_GLYPH)) IMG_CreateItem(&tmpItem, szFinalName, hdc); if (tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) { COLORREF clr; @@ -946,9 +946,9 @@ done_with_glyph: continue; } for (i = 0; i <= ID_EXTBK_LAST - ID_STATUS_OFFLINE; i++) { - if (!_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) { - if (!alloced) { - if (!(tmpItem.dwFlags & IMAGE_GLYPH)) + if ( !_stricmp(StatusItems[i].szName[0] == '{' ? &StatusItems[i].szName[3] : StatusItems[i].szName, buffer)) { + if ( !alloced) { + if ( !(tmpItem.dwFlags & IMAGE_GLYPH)) IMG_CreateItem(&tmpItem, szFinalName, hdc); if (tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) { newItem = reinterpret_cast(malloc(sizeof(ImageItem))); @@ -1033,11 +1033,11 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.dwFlags |= GetPrivateProfileIntA(itemName, "toggle", 0, file) ? BUTTON_ISTOGGLE : 0; GetPrivateProfileStringA(itemName, "Pressed", "None", szBuffer, 1000, file); - if (!_stricmp(szBuffer, "default")) + if ( !_stricmp(szBuffer, "default")) tmpItem.imgPressed = StatusItems[ID_EXTBKTBBUTTONSPRESSED - ID_STATUS_OFFLINE].imageItem; else { while(imgItem) { - if (!_stricmp(imgItem->szName, szBuffer)) { + if ( !_stricmp(imgItem->szName, szBuffer)) { tmpItem.imgPressed = imgItem; break; } @@ -1047,11 +1047,11 @@ static void BTN_ReadItem(char *itemName, char *file) imgItem = g_ImageItems; GetPrivateProfileStringA(itemName, "Normal", "None", szBuffer, 1000, file); - if (!_stricmp(szBuffer, "default")) + if ( !_stricmp(szBuffer, "default")) tmpItem.imgNormal = StatusItems[ID_EXTBKTBBUTTONSNPRESSED - ID_STATUS_OFFLINE].imageItem; else { while(imgItem) { - if (!_stricmp(imgItem->szName, szBuffer)) { + if ( !_stricmp(imgItem->szName, szBuffer)) { tmpItem.imgNormal = imgItem; break; } @@ -1061,11 +1061,11 @@ static void BTN_ReadItem(char *itemName, char *file) imgItem = g_ImageItems; GetPrivateProfileStringA(itemName, "Hover", "None", szBuffer, 1000, file); - if (!_stricmp(szBuffer, "default")) + if ( !_stricmp(szBuffer, "default")) tmpItem.imgHover = StatusItems[ID_EXTBKTBBUTTONMOUSEOVER - ID_STATUS_OFFLINE].imageItem; else { while(imgItem) { - if (!_stricmp(imgItem->szName, szBuffer)) { + if ( !_stricmp(imgItem->szName, szBuffer)) { tmpItem.imgHover = imgItem; break; } @@ -1095,7 +1095,7 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.uId = IDC_TBFIRSTUID - 1; GetPrivateProfileStringA(itemName, "Action", "Custom", szBuffer, 1000, file); - if (!_stricmp(szBuffer, "service")) { + if ( !_stricmp(szBuffer, "service")) { tmpItem.szService[0] = 0; GetPrivateProfileStringA(itemName, "Service", "None", szBuffer, 1000, file); if (_stricmp(szBuffer, "None")) { @@ -1104,7 +1104,7 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.uId = nextButtonID++; } } - else if (!_stricmp(szBuffer, "protoservice")) { + else if ( !_stricmp(szBuffer, "protoservice")) { tmpItem.szService[0] = 0; GetPrivateProfileStringA(itemName, "Service", "None", szBuffer, 1000, file); if (_stricmp(szBuffer, "None")) { @@ -1113,7 +1113,7 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.uId = nextButtonID++; } } - else if (!_stricmp(szBuffer, "database")) { + else if ( !_stricmp(szBuffer, "database")) { int n; GetPrivateProfileStringA(itemName, "Module", "None", szBuffer, 1000, file); @@ -1239,7 +1239,7 @@ void IMG_LoadItems() DBFreeVariant(&dbv); - if (!PathFileExists(tszFileName)) + if ( !PathFileExists(tszFileName)) return; IMG_DeleteItems(); @@ -1347,7 +1347,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) break; } for (j = 0; j < i - 1; j++) { - if (!strcmp(szProto, items[j].szName) && !strcmp(UIN, items[j].szDBname) + if ( !strcmp(szProto, items[j].szName) && !strcmp(UIN, items[j].szDBname) && lstrlenA(szProto) == lstrlenA(items[j].szName) && lstrlenA(UIN) == lstrlenA(items[j].szDBname)) { //_DebugPopup(hContact, "Found: %s, %s", szProto, UIN); @@ -1511,7 +1511,7 @@ static void ApplyCLUISkin() DBVARIANT dbv = {0}; TCHAR tszFinalName[MAX_PATH]; char szFinalName[MAX_PATH]; - if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) { + if ( !cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) { MY_pathToAbsolute(dbv.ptszVal, tszFinalName); WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, 0, 0); @@ -1557,7 +1557,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_FASTGRADIENT, cfg::dat.bWantFastGradients); CheckDlgButton(hwndDlg, IDC_IGNORESELFORGROUPS, cfg::getByte("CLC", "IgnoreSelforGroups", 0) ? BST_CHECKED : BST_UNCHECKED); - if (!cfg::getString(NULL, "CLC", "ContactSkins", &dbv)) { + if ( !cfg::getString(NULL, "CLC", "ContactSkins", &dbv)) { SetDlgItemTextA(hwndDlg, IDC_SKINFILE, dbv.pszVal); DBFreeVariant(&dbv); Utils::enableDlgControl(hwndDlg, IDC_RELOAD, TRUE); @@ -1565,7 +1565,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L else Utils::enableDlgControl(hwndDlg, IDC_RELOAD, FALSE); CheckDlgButton(hwndDlg, IDC_USESKIN, cfg::getByte("CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED); - if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) { + if ( !cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) { SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal); DBFreeVariant(&dbv); } @@ -1602,14 +1602,14 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L ofn.nMaxFile = MAX_PATH; ofn.nMaxFileTitle = MAX_PATH; ofn.lpstrDefExt = _T(""); - if (!GetOpenFileName(&ofn)) + if ( !GetOpenFileName(&ofn)) break; MY_pathToRelative(str, final_path); if (PathFileExists(str)) { int skinChanged = 0; DBVARIANT dbv = {0}; - if (!cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) { + if ( !cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) { if (_tcscmp(dbv.ptszVal, final_path)) skinChanged = TRUE; DBFreeVariant(&dbv); @@ -1718,7 +1718,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } case PSM_CHANGED: // used so tabs dont have to call SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0); - if (!iInit) + if ( !iInit) SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case WM_COMMAND: @@ -1736,7 +1736,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara ofn.nMaxFile = sizeof(str); ofn.nMaxFileTitle = MAX_PATH; ofn.lpstrDefExt = "clist"; - if (!GetSaveFileNameA(&ofn)) + if ( !GetSaveFileNameA(&ofn)) break; extbk_export(str); break; @@ -1755,7 +1755,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara ofn.nMaxFile = sizeof(str); ofn.nMaxFileTitle = MAX_PATH; ofn.lpstrDefExt = ""; - if (!GetOpenFileNameA(&ofn)) + if ( !GetOpenFileNameA(&ofn)) break; extbk_import(str, hwndSkinEdit); SendMessage(hwndSkinEdit, WM_USER + 101, 0, 0); @@ -1831,7 +1831,7 @@ int CoolSB_SetupScrollBar() !StatusItems[ID_EXTBKSCROLLBUTTONPRESSED - ID_STATUS_OFFLINE].IGNORED; - if (!StatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE].imageItem || + if ( !StatusItems[ID_EXTBKSCROLLBACK - ID_STATUS_OFFLINE].imageItem || !StatusItems[ID_EXTBKSCROLLBACKLOWER - ID_STATUS_OFFLINE].imageItem || !StatusItems[ID_EXTBKSCROLLTHUMB - ID_STATUS_OFFLINE].imageItem || !StatusItems[ID_EXTBKSCROLLTHUMBHOVER - ID_STATUS_OFFLINE].imageItem || -- cgit v1.2.3