diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-02 18:19:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-02 18:19:49 +0000 |
commit | c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch) | |
tree | 17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/BASS_interface/src/Main.cpp | |
parent | 5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (diff) |
new easy standard way of registering icons: Icon_Register
git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BASS_interface/src/Main.cpp')
-rw-r--r-- | plugins/BASS_interface/src/Main.cpp | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index d981658be9..da170979b1 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -296,40 +296,15 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara return 0;
}
-struct
+static IconItem iconList[] =
{
- char* szDescr;
- char* szName;
- int defIconID;
-}
-static const iconList[] =
-{
- { "Audio device is opened", "BASSSoundOnOffUp", IDI_BASSSoundOnOffUp },
- { "Audio device is closed", "BASSSoundOnOffDown", IDI_BASSSoundOnOffDown }
+ { LPGEN("Audio device is opened"), "BASSSoundOnOffUp", IDI_BASSSoundOnOffUp },
+ { LPGEN("Audio device is closed"), "BASSSoundOnOffDown", IDI_BASSSoundOnOffDown }
};
-static HANDLE hIconLibItem[SIZEOF(iconList)];
-
void InitIcons(void)
{
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(hInst, szFile, SIZEOF(szFile));
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.ptszDefaultFile = szFile;
- sid.cx = sid.cy = 16;
- sid.pszSection = ModuleName;
- sid.flags = SIDF_PATH_TCHAR;
-
- for (int i=0; i < SIZEOF(iconList); i++) {
- char szSettingName[100];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", ModuleName, iconList[i].szName);
-
- sid.pszName = szSettingName;
- sid.pszDescription = (char*)iconList[i].szDescr;
- sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = Skin_AddIcon(&sid);
- }
+ Icon_Register(hInst, ModuleName, iconList, SIZEOF(iconList));
}
int OptionsInit(WPARAM wParam, LPARAM lParam)
@@ -376,8 +351,8 @@ int OnToolbarLoaded(WPARAM wParam, LPARAM lParam) tbb.pszService = "BASSinterface/BASSSoundOnOff";
tbb.pszTooltipUp = LPGEN("Audio device is opened");
tbb.pszTooltipDn = LPGEN("Audio device is closed");
- tbb.hIconHandleUp = hIconLibItem[0];
- tbb.hIconHandleDn = hIconLibItem[1];
+ tbb.hIconHandleUp = iconList[0].hIcolib;
+ tbb.hIconHandleDn = iconList[1].hIcolib;
tbb.dwFlags = TTBBF_SHOWTOOLTIP;
hTBButton = TopToolbar_AddButton(&tbb);
return 0;
|