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/MetaContacts/src | |
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/MetaContacts/src')
-rw-r--r-- | plugins/MetaContacts/src/icons.cpp | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/plugins/MetaContacts/src/icons.cpp b/plugins/MetaContacts/src/icons.cpp index 3776212289..508fe50425 100644 --- a/plugins/MetaContacts/src/icons.cpp +++ b/plugins/MetaContacts/src/icons.cpp @@ -1,20 +1,13 @@ #include "metacontacts.h"
-struct
-{
- char* szDescr;
- char* szName;
- int defIconID;
- HANDLE hIcolib;
-}
-static iconList[] = {
- { LPGEN("Toggle Off"), "mc_off", IDI_MCMENUOFF },
- { LPGEN("Toggle On"), "mc_on", IDI_MCMENU },
- { LPGEN("Convert to MetaContact"), "mc_convert", IDI_MCCONVERT },
- { LPGEN("Add to Existing"), "mc_add", IDI_MCADD },
- { LPGEN("Edit"), "mc_edit", IDI_MCEDIT },
- { LPGEN("Set to Default"), "mc_default", IDI_MCSETDEFAULT },
- { LPGEN("Remove"), "mc_remove", IDI_MCREMOVE },
+static IconItem iconList[] = {
+ { LPGEN("Toggle Off"), "off", IDI_MCMENUOFF },
+ { LPGEN("Toggle On"), "on", IDI_MCMENU },
+ { LPGEN("Convert to MetaContact"), "convert", IDI_MCCONVERT },
+ { LPGEN("Add to Existing"), "add", IDI_MCADD },
+ { LPGEN("Edit"), "edit", IDI_MCEDIT },
+ { LPGEN("Set to Default"), "default", IDI_MCSETDEFAULT },
+ { LPGEN("Remove"), "remove", IDI_MCREMOVE },
};
HANDLE GetIconHandle(IconIndex i)
@@ -29,18 +22,5 @@ HICON LoadIconEx(IconIndex i) void InitIcons(void)
{
- TCHAR path[MAX_PATH];
- GetModuleFileName(hInstance, path, SIZEOF(path));
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.flags = SIDF_PATH_TCHAR;
- sid.pszSection = META_PROTO;
- 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(hInstance, META_PROTO, iconList, SIZEOF(iconList), "mc");
}
|