From 541c2c38bd6e6d9a6fdbf7e19aed4aa5c005dbd7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 15 Jul 2013 17:06:10 +0000 Subject: fix for the very old bug with the ViewModes buttons' initialization git-svn-id: http://svn.miranda-ng.org/main/trunk@5369 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/viewmodes.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index a51de4fab6..47ac3f043a 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -840,7 +840,17 @@ void BuildViewModeMenu() AppendMenu(hViewModeMenu, MF_STRING, 10002, TranslateT("Clear current View Mode")); } -static UINT _buttons[] = {IDC_RESETMODES, IDC_SELECTMODE, IDC_CONFIGUREMODES, 0}; +struct +{ + UINT btn_id; + LPCSTR icon; +} +static _buttons[] = +{ + { IDC_RESETMODES, "CLN_CLVM_reset" }, + { IDC_SELECTMODE, "CLN_CLVM_select" }, + { IDC_CONFIGUREMODES, "CLN_CLVM_options" } +}; LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -891,13 +901,13 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; } case WM_USER + 100: - SendMessage(GetDlgItem(hwnd, IDC_RESETMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("CLN_CLVM_reset")); - SendMessage(GetDlgItem(hwnd, IDC_CONFIGUREMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("CLN_CLVM_options")); - SendMessage(GetDlgItem(hwnd, IDC_SELECTMODE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("CLN_CLVM_select")); { bool bSkinned = cfg::getByte("CLCExt", "bskinned", 0) != 0; - for (int i = 0; _buttons[i] != 0; i++ ) - CustomizeButton(hwnd, bSkinned, !bSkinned, bSkinned); + for (int i = 0; i < SIZEOF(_buttons); i++ ) { + HWND hwndButton = GetDlgItem(hwnd, _buttons[i].btn_id); + SendMessage(hwndButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon(_buttons[i].icon)); + CustomizeButton(hwndButton, bSkinned, !bSkinned, bSkinned); + } } if (cfg::dat.bFilterEffective) -- cgit v1.2.3