From bed6e8755cea7a440d0b983586b7f1a32d1ecc94 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 19 Jan 2013 21:18:30 +0000 Subject: fixed icons name and tooltip git-svn-id: http://svn.miranda-ng.org/main/trunk@3180 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/BASS_interface/res/BASSSoundOff.ico | Bin 0 -> 1150 bytes plugins/BASS_interface/res/BASSSoundOn.ico | Bin 0 -> 1150 bytes plugins/BASS_interface/res/BASSSoundOnOffDown.ico | Bin 1150 -> 0 bytes plugins/BASS_interface/res/BASSSoundOnOffUp.ico | Bin 1150 -> 0 bytes plugins/BASS_interface/res/Bass.rc | 4 +-- plugins/BASS_interface/src/Main.cpp | 31 +++++++++++++++++----- plugins/BASS_interface/src/Resource.h | 4 +-- 7 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 plugins/BASS_interface/res/BASSSoundOff.ico create mode 100644 plugins/BASS_interface/res/BASSSoundOn.ico delete mode 100644 plugins/BASS_interface/res/BASSSoundOnOffDown.ico delete mode 100644 plugins/BASS_interface/res/BASSSoundOnOffUp.ico (limited to 'plugins/BASS_interface') diff --git a/plugins/BASS_interface/res/BASSSoundOff.ico b/plugins/BASS_interface/res/BASSSoundOff.ico new file mode 100644 index 0000000000..a10bfce204 Binary files /dev/null and b/plugins/BASS_interface/res/BASSSoundOff.ico differ diff --git a/plugins/BASS_interface/res/BASSSoundOn.ico b/plugins/BASS_interface/res/BASSSoundOn.ico new file mode 100644 index 0000000000..bee9f065a0 Binary files /dev/null and b/plugins/BASS_interface/res/BASSSoundOn.ico differ diff --git a/plugins/BASS_interface/res/BASSSoundOnOffDown.ico b/plugins/BASS_interface/res/BASSSoundOnOffDown.ico deleted file mode 100644 index a10bfce204..0000000000 Binary files a/plugins/BASS_interface/res/BASSSoundOnOffDown.ico and /dev/null differ diff --git a/plugins/BASS_interface/res/BASSSoundOnOffUp.ico b/plugins/BASS_interface/res/BASSSoundOnOffUp.ico deleted file mode 100644 index bee9f065a0..0000000000 Binary files a/plugins/BASS_interface/res/BASSSoundOnOffUp.ico and /dev/null differ diff --git a/plugins/BASS_interface/res/Bass.rc b/plugins/BASS_interface/res/Bass.rc index 93532048f9..07a0999b43 100644 --- a/plugins/BASS_interface/res/Bass.rc +++ b/plugins/BASS_interface/res/Bass.rc @@ -28,8 +28,8 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_BASSSoundOnOffUp ICON "BASSSoundOnOffUp.ico" -IDI_BASSSoundOnOffDown ICON "BASSSoundOnOffDown.ico" +IDI_BASSSoundOn ICON "BASSSoundOn.ico" +IDI_BASSSoundOff ICON "BASSSoundOff.ico" ///////////////////////////////////////////////////////////////////////////// // diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index d7fe67897c..eafed88e02 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -302,8 +302,8 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara static IconItem iconList[] = { - { LPGEN("Audio device is opened"), "BASSSoundOnOffUp", IDI_BASSSoundOnOffUp }, - { LPGEN("Audio device is closed"), "BASSSoundOnOffDown", IDI_BASSSoundOnOffDown } + {LPGEN("Sounds enabled"), "BASSSoundOn", IDI_BASSSoundOn}, + {LPGEN("Sounds disabled"), "BASSSoundOff", IDI_BASSSoundOff} }; void InitIcons(void) @@ -335,7 +335,13 @@ int OnSettingChanged(WPARAM wParam, LPARAM lParam) if(!strcmp(dbcws->szModule, "Skin")) { if(!strcmp(dbcws->szSetting, "UseSound")) { int useSound = dbcws->value.bVal; - SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(useSound ? Skin_GetIcon("BASSSoundOnOffUp") : Skin_GetIcon("BASSSoundOnOffDown"))); + if (useSound) { + SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("BASSSoundOn")); + SendMessage(hwndMute, BUTTONADDTOOLTIP, (WPARAM)Translate("Disable sounds"), 0); + } else { + SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("BASSSoundOff")); + SendMessage(hwndMute, BUTTONADDTOOLTIP, (WPARAM)Translate("Enable sounds"), 0); + } return 0; } } @@ -360,15 +366,20 @@ static LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR { hwndMute = CreateWindow(MIRANDABUTTONCLASS, _T(""), WS_CHILD | WS_VISIBLE, 1, 1, 20, 20, hwnd, 0, (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), NULL); - SendMessage(hwndMute, BUTTONSETASFLATBTN,0,0); - SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(db_get_b(NULL, "Skin", "UseSound", 1) ? Skin_GetIcon("BASSSoundOnOffUp") : Skin_GetIcon("BASSSoundOnOffDown"))); + SendMessage(hwndMute, BUTTONSETASFLATBTN,0,0); + if (db_get_b(NULL, "Skin", "UseSound", 1)) { + SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("BASSSoundOn")); + SendMessage(hwndMute, BUTTONADDTOOLTIP, (WPARAM)Translate("Disable sounds"), 0); + } else { + SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("BASSSoundOff")); + SendMessage(hwndMute, BUTTONADDTOOLTIP, (WPARAM)Translate("Enable sounds"), 0); + } hwndSlider = CreateWindow(TRACKBAR_CLASS, _T(""), WS_CHILD | WS_VISIBLE | TBS_NOTICKS | TBS_TOOLTIPS, 21, 1, 100, 20, hwnd, (HMENU)0, (HINSTANCE) GetWindowLongPtr(hwnd, GWL_HINSTANCE), NULL); SendMessage(hwndSlider, TBM_SETRANGE, FALSE, MAKELONG(SLIDER_MIN, SLIDER_MAX)); SendMessage(hwndSlider, TBM_SETPOS, TRUE, Volume); OldSliderWndProc = (WNDPROC)SetWindowLong(hwndSlider, GWL_WNDPROC, (LONG)SliderWndProc); - SendMessage(hwndMute, BUTTONADDTOOLTIP, (WPARAM)Translate("Click to toggle all sounds"), 0); break; } @@ -376,7 +387,13 @@ static LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if((HWND)lParam == hwndMute) { int useSound = !db_get_b(NULL, "Skin", "UseSound", 1); db_set_b(NULL, "Skin", "UseSound", useSound); - SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(useSound ? Skin_GetIcon("BASSSoundOnOffUp") : Skin_GetIcon("BASSSoundOnOffDown"))); + if (useSound) { + SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("BASSSoundOn")); + SendMessage(hwndMute, BUTTONADDTOOLTIP, (WPARAM)Translate("Disable sounds"), 0); + } else { + SendMessage(hwndMute, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIcon("BASSSoundOff")); + SendMessage(hwndMute, BUTTONADDTOOLTIP, (WPARAM)Translate("Enable sounds"), 0); + } } break; diff --git a/plugins/BASS_interface/src/Resource.h b/plugins/BASS_interface/src/Resource.h index fb35fa7855..8a5faaa1b4 100644 --- a/plugins/BASS_interface/src/Resource.h +++ b/plugins/BASS_interface/src/Resource.h @@ -27,5 +27,5 @@ #define IDC_CHECKBOX9 1108 #define IDC_CHECKBOX10 1109 #define IDC_PREVIEW 1110 -#define IDI_BASSSoundOnOffUp 200 -#define IDI_BASSSoundOnOffDown 201 +#define IDI_BASSSoundOn 1111 +#define IDI_BASSSoundOff 1112 -- cgit v1.2.3