summaryrefslogtreecommitdiff
path: root/plugins/HistorySweeperLight
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
commitc4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch)
tree17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/HistorySweeperLight
parent5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (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/HistorySweeperLight')
-rw-r--r--plugins/HistorySweeperLight/src/options.cpp35
1 files changed, 6 insertions, 29 deletions
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)