summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/CLUIFrames
diff options
context:
space:
mode:
authorslotwin <slotwin@users.noreply.github.com>2014-06-08 17:30:50 +0000
committerslotwin <slotwin@users.noreply.github.com>2014-06-08 17:30:50 +0000
commitba52e0ca7c8cc2903536fa8fa6b0150bb4069d1f (patch)
tree2749b61a8a87d4ee567a906e8fd9c58d2bc25744 /plugins/Clist_modern/src/CLUIFrames
parent2f7760a079e0f1fd713ed46c58239e47b8f7f65a (diff)
Clist_modern: add icons to menu items
add icons to IcoLib remove unused code proper capitalization git-svn-id: http://svn.miranda-ng.org/main/trunk@9425 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/CLUIFrames')
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp66
1 files changed, 21 insertions, 45 deletions
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
index 23fe23fdaa..674d2f8b11 100644
--- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
@@ -41,8 +41,6 @@ HGENMENU hDisableGroupsMenuItem;
HGENMENU hNewGroupMenuItem;
HGENMENU hNewSubGroupMenuItem;
-int NewGroupIconidx;
-
void InitSubGroupMenus(void);
//Groupmenu exec param(ownerdata)
@@ -53,17 +51,14 @@ typedef struct
}
GroupMenuExecParam,*lpGroupMenuExecParam;
-/*
-wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
-return 0 on success.
-*/
+//wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
+//return 0 on success.
static INT_PTR RemoveGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
CallService(MO_REMOVEMENUITEM,wParam,0);
return 0;
}
-
INT_PTR BuildGroupMenu(WPARAM wParam, LPARAM lParam)
{
ListParam param = { 0 };
@@ -224,31 +219,11 @@ static int OnBuildGroupMenu(WPARAM wParam, LPARAM lParam)
return 0;
}
-static IconItem iconItem = { "New group", "NewGroup", IDI_NEWGROUP2 };
-
-int static OnIconLibIconChanged(WPARAM wParam, LPARAM lParam)
-{
- if (MirandaExiting()) return 0;
-
- HICON hIcon = Skin_GetIconByHandle(iconItem.hIcolib);
- NewGroupIconidx = ImageList_ReplaceIcon(hCListImages, NewGroupIconidx, hIcon);
- Skin_ReleaseIcon(hIcon);
-
- CLISTMENUITEM clmi = { sizeof(clmi) };
- clmi.flags = CMIM_ICON;
- clmi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- Menu_ModifyItem(hNewSubGroupMenuItem, &clmi);
- Menu_ModifyItem(hNewGroupMenuItem, &clmi);
- return 0;
-}
+static IconItemT iconItem = { LPGENT("New group"), "NewGroup", IDI_NEWGROUP2 };
void GroupMenus_Init(void)
{
- Icon_Register(g_hInst, LPGEN("Contact list"), &iconItem, 1);
-
- HICON hIcon = Skin_GetIconByHandle(iconItem.hIcolib);
- NewGroupIconidx = hIcon ? ImageList_AddIcon(hCListImages, hIcon) : -1;
- Skin_ReleaseIcon(hIcon);
+ Icon_RegisterT(g_hInst, LPGENT("Contact list"), &iconItem, 1);
CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu",FreeOwnerDataGroupMenu);
@@ -285,13 +260,13 @@ void GroupMenus_Init(void)
mi.position = 500;
mi.pszService = MS_CLIST_SHOWHIDE;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
- mi.pszName = LPGEN("&Hide/Show");
+ mi.pszName = LPGEN("&Hide/show");
hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 200000;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
mi.pszService = "FindAdd/FindAddCommand";
- mi.pszName = LPGEN("&Find/Add contacts...");
+ mi.pszName = LPGEN("&Find/add contacts...");
AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 300000;
@@ -320,7 +295,7 @@ void GroupMenus_Init(void)
mi.flags = 0;
mi.position = 100000;
- mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ mi.icolibItem = iconItem.hIcolib;
mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
mi.pszName = LPGEN("&New group");
hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
@@ -328,6 +303,7 @@ void GroupMenus_Init(void)
mi.position = 100001;
mi.hIcon = NULL;
+ mi.icolibItem = NULL;
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.pszName = LPGEN("&Hide offline users");
gmp.lParam = 0;gmp.wParam = -1;
@@ -347,8 +323,6 @@ void GroupMenus_Init(void)
mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
mi.pszName = LPGEN("Disable &groups");
hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
-
- HookEvent(ME_SKIN2_ICONSCHANGED, OnIconLibIconChanged);
}
//////////////////////////////END Group MENU/////////////////////////
@@ -544,20 +518,22 @@ void InitSubGroupMenus(void)
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 1000;
- mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ mi.icolibItem = iconItem.hIcolib;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&New subgroup");
- gmp.lParam = 0;gmp.wParam = POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_NEWSUBGROUP;
+ hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
mi.position = 1001;
mi.hIcon = NULL;
+ mi.icolibItem = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&Hide offline users in here");
gmp.lParam = 0;
gmp.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
mi.position = 1002;
mi.hIcon = NULL;
@@ -565,7 +541,7 @@ void InitSubGroupMenus(void)
mi.pszName = LPGEN("&Show offline users in here");
gmp.lParam = 0;
gmp.wParam = POPUP_GROUPSHOWOFFLINE;
- hShowOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hShowOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -573,17 +549,17 @@ void InitSubGroupMenus(void)
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_RENAME);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&Rename group");
- gmp.lParam = 0;gmp.wParam = POPUP_RENAMEGROUP;
- AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_RENAMEGROUP;
+ AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
mi.position = 900002;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_DELETE);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&Delete group");
- gmp.lParam = 0;gmp.wParam = POPUP_DELETEGROUP;
- AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
- DestroyIcon_protect(mi.hIcon);
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_DELETEGROUP;
+ AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
}
//////////////////////////////END SubGroup MENU/////////////////////////