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/Ping/src/utils.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/Ping/src/utils.cpp')
-rw-r--r-- | plugins/Ping/src/utils.cpp | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 22b8b2e63d..28200aa85c 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -315,38 +315,17 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) return 0;
}
+static IconItem iconList[] =
+{
+ { LPGEN("Responding"), "ping_responding", IDI_ICON_RESPONDING },
+ { LPGEN("Not Responding"), "ping_not_responding", IDI_ICON_NOTRESPONDING },
+ { LPGEN("Testing"), "ping_testing", IDI_ICON_TESTING },
+ { LPGEN("Disabled"), "ping_disabled", IDI_ICON_DISABLED },
+};
+
void InitUtils()
{
- TCHAR file[MAX_PATH];
- GetModuleFileName(hInst,file,MAX_PATH);
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.ptszSection = LPGENT("Ping");
- sid.flags = SIDF_PATH_TCHAR;
-
- sid.pszDescription = LPGEN("Responding");
- sid.pszName = "ping_responding";
- sid.ptszDefaultFile = file;
- sid.iDefaultIndex = -IDI_ICON_RESPONDING;
- Skin_AddIcon(&sid);
-
- sid.pszDescription = LPGEN("Not Responding");
- sid.pszName = "ping_not_responding";
- sid.ptszDefaultFile = file;
- sid.iDefaultIndex = -IDI_ICON_NOTRESPONDING;
- Skin_AddIcon(&sid);
-
- sid.pszDescription = LPGEN("Testing");
- sid.pszName = "ping_testing";
- sid.ptszDefaultFile = file;
- sid.iDefaultIndex = -IDI_ICON_TESTING;
- Skin_AddIcon(&sid);
-
- sid.pszDescription = LPGEN("Disabled");
- sid.pszName = "ping_disabled";
- sid.ptszDefaultFile = file;
- sid.iDefaultIndex = -IDI_ICON_DISABLED;
- Skin_AddIcon(&sid);
+ Icon_Register(hInst, LPGENT("Ping"), iconList, SIZEOF(iconList));
hIconResponding = Skin_GetIcon("ping_responding");
hIconNotResponding = Skin_GetIcon("ping_not_responding");
@@ -365,4 +344,4 @@ void InitUtils() test.PluginWindowProc = NullWindowProc;
CallService(MS_POPUP_REGISTERCLASS, 0, (WPARAM)&test);
}
-}
\ No newline at end of file +}
|