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/Dbx_mmap_SA | |
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/Dbx_mmap_SA')
-rw-r--r-- | plugins/Dbx_mmap_SA/src/dialogs.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/plugins/Dbx_mmap_SA/src/dialogs.cpp b/plugins/Dbx_mmap_SA/src/dialogs.cpp index a73745051f..11c1afc70f 100644 --- a/plugins/Dbx_mmap_SA/src/dialogs.cpp +++ b/plugins/Dbx_mmap_SA/src/dialogs.cpp @@ -80,31 +80,22 @@ void xModifyMenu(HANDLE hMenu,long flags,const TCHAR* name, HICON hIcon) CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenu,(LPARAM)&mi);
}
+static IconItem iconList[] =
+{
+ { LPGEN("Database"), "database", IDI_ICON2 },
+ { LPGEN("Change Password"), "password", IDI_ICON3 }
+};
+
int InitMenus(WPARAM, LPARAM)
{
HookEvent(ME_OPT_INITIALISE, OptionsInit);
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(g_hInst, szFile, MAX_PATH);
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.ptszDefaultFile = szFile;
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszSection = LPGENT("Database");
- sid.ptszDescription = LPGENT("Database");
- sid.pszName = "database";
- sid.iDefaultIndex = -IDI_ICON2;
- Skin_AddIcon(&sid);
-
- sid.ptszDescription = LPGENT("Change Password");
- sid.pszName = "password";
- sid.iDefaultIndex = -IDI_ICON3;
- HANDLE hIcon = Skin_AddIcon(&sid);
+ Icon_Register(g_hInst, LPGEN("Database"), iconList, SIZEOF(iconList));
// main menu item
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ALL | CMIF_TCHAR | CMIF_ICONFROMICOLIB;
- mi.icolibItem = hIcon;
+ mi.icolibItem = iconList[1].hIcolib;
mi.ptszName = (g_Db->m_bEncoding) ? LPGENT("Change password") : LPGENT("Set password");
mi.ptszPopupName = LPGENT("Database");
mi.pszService = MS_DB_CHANGEPASSWORD;
|