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/MyDetails | |
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/MyDetails')
-rw-r--r-- | plugins/MyDetails/src/mydetails.cpp | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 5d8ab4836c..ae66a1dca4 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -38,6 +38,13 @@ PLUGININFOEX pluginInfo={ { 0xa82baeb3, 0xa33c, 0x4036, { 0xb8, 0x37, 0x78, 0x3, 0xa5, 0xb6, 0xc2, 0xab } } // {A82BAEB3-A33C-4036-B837-7803A5B6C2AB}
};
+static IconItem iconList[] =
+{
+ { LPGEN("Listening to"), "LISTENING_TO_ICON", IDI_LISTENINGTO },
+ { LPGEN("Previous protocol"), "MYDETAILS_PREV_PROTOCOL", IDI_LEFT_ARROW },
+ { LPGEN("Next protocol"), "MYDETAILS_NEXT_PROTOCOL", IDI_RIGHT_ARROW }
+};
+
// Hooks
HANDLE hModulesLoadedHook = NULL;
HANDLE hPreShutdownHook = NULL;
@@ -199,33 +206,10 @@ static int MainInit(WPARAM wparam,LPARAM lparam) InitFrames();
- TCHAR tszPath[MAX_PATH];
- GetModuleFileName(hInst, tszPath, SIZEOF(tszPath));
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.flags = SIDF_PATH_TCHAR;
- sid.ptszDefaultFile = tszPath;
-
- if ( Skin_GetIcon("LISTENING_TO_ICON") == NULL) {
- sid.pszSection = LPGEN("Contact List");
- sid.pszDescription = LPGEN("Listening to");
- sid.pszName = "LISTENING_TO_ICON";
- sid.iDefaultIndex = -IDI_LISTENINGTO;
- Skin_AddIcon(&sid);
- }
-
- sid.pszSection = LPGEN("My Details");
- sid.pszDescription = LPGEN("Previous protocol");
- sid.pszName = "MYDETAILS_PREV_PROTOCOL";
- sid.iDefaultIndex = -IDI_LEFT_ARROW;
- Skin_AddIcon(&sid);
-
- sid.pszSection = LPGEN("My Details");
- sid.pszDescription = LPGEN("Next protocol");
- sid.pszName = "MYDETAILS_NEXT_PROTOCOL";
- sid.iDefaultIndex = -IDI_RIGHT_ARROW;
- Skin_AddIcon(&sid);
+ if ( Skin_GetIcon("LISTENING_TO_ICON") == NULL)
+ Icon_Register(hInst, LPGEN("Contact List"), iconList, 1);
+ Icon_Register(hInst, LPGEN("My Details"), iconList+1, SIZEOF(iconList)-1);
return 0;
}
|