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/HistorySweeperLight/src/options.cpp | 35 +++++------------------------ 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'plugins/HistorySweeperLight/src') diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index f086285349..8cae37d6e5 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -44,42 +44,19 @@ const char* keep_strings[] = "Keep 50 last events" }; -struct +static IconItem iconList[] = { - char* szDescr; - char* szName; - int defIconID; -} -static const iconList[] = -{ - { "Default Action", "actG", IDI_ACTG }, - { "Action 1", "act1", IDI_ACT1 }, - { "Action 2", "act2", IDI_ACT2 }, - { "Delete All", "actDel", IDI_ACTDEL } + { "Default Action", "actG", IDI_ACTG }, + { "Action 1", "act1", IDI_ACT1 }, + { "Action 2", "act2", IDI_ACT2 }, + { "Delete All", "actDel", IDI_ACTDEL } }; 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), ModuleName); } HICON LoadIconEx(const char* name) -- cgit v1.2.3