From c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Dec 2012 18:19:49 +0000 Subject: 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 --- plugins/SpellChecker/src/spellchecker.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'plugins/SpellChecker/src') diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 6fb39c5831..f06de84fad 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -259,14 +259,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) //////////////////////////////////////////////////////////////////////////////////////// -struct -{ - char* szDescr; - char* szName; - int defIconID; - HANDLE hIcolib; -} -static iconList[] = +static IconItem iconList[] = { { LPGEN("Enabled"), "spellchecker_enabled", IDI_CHECK }, { LPGEN("Disabled"), "spellchecker_disabled", IDI_NO_CHECK } @@ -277,20 +270,7 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfo); // icons - TCHAR path[MAX_PATH]; - GetModuleFileName(hInst, path, MAX_PATH); - - SKINICONDESC sid = { sizeof(sid) }; - sid.flags = SIDF_PATH_TCHAR; - sid.pszSection = LPGEN("Spell Checker"); - sid.ptszDefaultFile = path; - - for (int i = 0; i < SIZEOF(iconList); ++i) { - sid.pszDescription = iconList[i].szDescr; - sid.pszName = iconList[i].szName; - sid.iDefaultIndex = -iconList[i].defIconID; - iconList[i].hIcolib = Skin_AddIcon(&sid); - } + Icon_Register(hInst, LPGEN("Spell Checker"), iconList, SIZEOF(iconList)); // hooks HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); -- cgit v1.2.3