summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-07-02 19:04:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-07-02 19:04:21 +0000
commit209e1040e34c50e424a7aa0a7c860c7fc279a76f (patch)
tree96742a262043ca7155d75414ae48b3907f3e2881 /plugins/Clist_nicer
parent755eaef1f61577c44a9305fb7db3dd25990de52c (diff)
group menu services moved to core
git-svn-id: http://svn.miranda-ng.org/main/trunk@14472 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r--plugins/Clist_nicer/clist_nicer_10.vcxproj.filters6
-rw-r--r--plugins/Clist_nicer/clist_nicer_12.vcxproj.filters6
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp273
-rw-r--r--plugins/Clist_nicer/src/clc.cpp7
-rw-r--r--plugins/Clist_nicer/src/clui.cpp5
-rw-r--r--plugins/Clist_nicer/src/init.cpp2
6 files changed, 45 insertions, 254 deletions
diff --git a/plugins/Clist_nicer/clist_nicer_10.vcxproj.filters b/plugins/Clist_nicer/clist_nicer_10.vcxproj.filters
index 29bb3c0e63..6e654a40eb 100644
--- a/plugins/Clist_nicer/clist_nicer_10.vcxproj.filters
+++ b/plugins/Clist_nicer/clist_nicer_10.vcxproj.filters
@@ -105,9 +105,6 @@
<ClCompile Include="src\CLUIFrames\cluiframes.cpp">
<Filter>Source Files\CLUIFrames</Filter>
</ClCompile>
- <ClCompile Include="src\CLUIFrames\groupmenu.cpp">
- <Filter>Source Files\CLUIFrames</Filter>
- </ClCompile>
<ClCompile Include="src\clnplus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -120,6 +117,9 @@
<ClCompile Include="src\stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\CLUIFrames\groupmenu.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\CLUIFrames\cluiframes.h">
diff --git a/plugins/Clist_nicer/clist_nicer_12.vcxproj.filters b/plugins/Clist_nicer/clist_nicer_12.vcxproj.filters
index 29bb3c0e63..6e654a40eb 100644
--- a/plugins/Clist_nicer/clist_nicer_12.vcxproj.filters
+++ b/plugins/Clist_nicer/clist_nicer_12.vcxproj.filters
@@ -105,9 +105,6 @@
<ClCompile Include="src\CLUIFrames\cluiframes.cpp">
<Filter>Source Files\CLUIFrames</Filter>
</ClCompile>
- <ClCompile Include="src\CLUIFrames\groupmenu.cpp">
- <Filter>Source Files\CLUIFrames</Filter>
- </ClCompile>
<ClCompile Include="src\clnplus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -120,6 +117,9 @@
<ClCompile Include="src\stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\CLUIFrames\groupmenu.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\CLUIFrames\cluiframes.h">
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
index 93dba7710d..c68a3c16d1 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
@@ -24,9 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <commonheaders.h>
-//////////////////////////////Group MENU/////////////////////////
-int hGroupMenuObject;
-HANDLE hPreBuildGroupMenuEvent;
+/////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////// Group MENU //////////////////////////////
HGENMENU hGroupMainMenuItemProxy;
HGENMENU hHideShowMainMenuItem;
@@ -45,47 +44,7 @@ HGENMENU hNewSubGroupMenuItem;
void InitSubGroupMenus(void);
-//Groupmenu exec param(ownerdata)
-typedef struct
-{
- char *szServiceName;
- int Param1, Param2;
-}
-GroupMenuExecParam, *lpGroupMenuExecParam;
-
-static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
-{
- NotifyEventHooks(hPreBuildGroupMenuEvent, 0, 0);
-
- HMENU hMenu = CreatePopupMenu();
- Menu_Build(hMenu, hGroupMenuObject);
- return (INT_PTR)hMenu;
-}
-
-static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
-{
- lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam));
- if (mmep == NULL)
- return 0;
-
- TMO_MenuItem *pmi = (TMO_MenuItem*)lParam;
- // we need just one parametr.
- mmep->szServiceName = mir_strdup(pmi->pszService);
- GroupMenuParam *gmp = (GroupMenuParam*)wParam;
- if (gmp != NULL) {
- mmep->Param1 = gmp->wParam;
- mmep->Param2 = gmp->lParam;
- }
-
- HGENMENU hNewItem = Menu_AddItem(hGroupMenuObject, pmi, mmep);
-
- char buf[1024];
- mir_snprintf(buf, "%s/%s", pmi->pszService, pmi->name.a);
- Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, buf);
- return (INT_PTR)hNewItem;
-}
-
-INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
+INT_PTR GroupMenu_OnAddService(WPARAM wParam, LPARAM lParam)
{
MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
if (mii == NULL)
@@ -103,7 +62,7 @@ INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
if (hGroupStatusMenuItemProxy == (HANDLE)lParam) {
mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = (HMENU)Menu_GetStatusMenu();
+ mii->hSubMenu = Menu_GetStatusMenu();
}
if (hAppearanceMenuItemProxy == (HANDLE)lParam) {
hMenuOldContext = GetSubMenu(LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 3);
@@ -115,39 +74,11 @@ INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
CheckMenuItem(hMenuOldContext, POPUP_SHOWSTATUSICONS, MF_BYCOMMAND | (cfg::dat.dwFlags & CLUI_FRAME_STATUSICONS ? MF_CHECKED : MF_UNCHECKED));
mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = (HMENU)hMenuOldContext;
+ mii->hSubMenu = hMenuOldContext;
}
return TRUE;
}
-//called with:
-//wparam - ownerdata
-//lparam - lparam from winproc
-INT_PTR GroupMenuExecService(WPARAM wParam, LPARAM lParam)
-{
- if (wParam != 0) {
- lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
- if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) {
- //bug in help.c,it used wparam as parent window handle without reason.
- mmep->Param1 = 0;
- CallService(mmep->szServiceName, mmep->Param1, lParam);
- }
- else CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
- }
- return 1;
-}
-
-INT_PTR FreeOwnerDataGroupMenu(WPARAM, LPARAM lParam)
-{
- lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)lParam;
- if (mmep != NULL) {
- mir_free(mmep->szServiceName);
- mir_free(mmep);
- }
-
- return 0;
-}
-
INT_PTR HideGroupsHelper(WPARAM, LPARAM)
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
@@ -166,28 +97,26 @@ INT_PTR UseGroupsHelper(WPARAM, LPARAM)
INT_PTR HideOfflineRootHelper(WPARAM, LPARAM)
{
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT,
- !SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0),
- 0);
+ SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT, !SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0), 0);
return 0;
}
static int OnBuildGroupMenu(WPARAM, LPARAM)
{
- int flags = (cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(hHideOfflineUsersMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
+ bool bEnabled = 0 != cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+ Menu_EnableItem(hHideOfflineUsersMenuItem, bEnabled);
- flags = SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? CMIF_CHECKED : 0;
- Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
+ bEnabled = 0 != SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0);
+ Menu_EnableItem(hHideOfflineUsersOutHereMenuItem, bEnabled);
- flags = GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? CMIF_CHECKED : 0;
- Menu_ModifyItem(hHideEmptyGroupsMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
+ bEnabled = 0 != (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
+ Menu_EnableItem(hHideEmptyGroupsMenuItem, bEnabled);
- flags = GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS ? 0 : CMIF_CHECKED;
- Menu_ModifyItem(hDisableGroupsMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
+ bEnabled = 0 != (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
+ Menu_EnableItem(hDisableGroupsMenuItem, bEnabled);
- Menu_ModifyItem(hGroupMainMenuItemProxy, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(hAppearanceMenuItemProxy, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_EnableItem(hGroupMainMenuItemProxy, bEnabled);
+ Menu_EnableItem(hAppearanceMenuItemProxy, bEnabled);
return 0;
}
@@ -203,26 +132,15 @@ void InitIconLibMenuIcons(void)
void InitGroupMenus(void)
{
- CreateServiceFunction("CLISTMENUSGroup/ExecService", GroupMenuExecService);
- CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu", FreeOwnerDataGroupMenu);
- CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService", GroupMenuonAddService);
+ CreateServiceFunction("CLISTMENUSGroup/GroupMenuOnAddService", GroupMenu_OnAddService);
CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper", HideGroupsHelper);
CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper", UseGroupsHelper);
CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper", HideOfflineRootHelper);
- CreateServiceFunction("CList/AddGroupMenuItem", AddGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDGROUP, BuildGroupMenu);
- hPreBuildGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
InitSubGroupMenus();
- // Group menu
- hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
- Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
- Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
- Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
-
// add exit command to menu
GroupMenuParam gmp;
@@ -231,98 +149,86 @@ void InitGroupMenus(void)
mi.pszService = "CloseAction";
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
mi.name.a = LPGEN("E&xit");
- AddGroupMenuItem(0, (LPARAM)&mi);
+ Menu_AddGroupMenuItem(&mi);
mi.position = 500;
mi.pszService = MS_CLIST_SHOWHIDE;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.name.a = LPGEN("&Hide/show");
- hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideShowMainMenuItem = Menu_AddGroupMenuItem(&mi);
mi.position = 200000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
mi.pszService = "FindAdd/FindAddCommand";
mi.name.a = LPGEN("&Find/add contacts...");
- AddGroupMenuItem(0, (LPARAM)&mi);
+ Menu_AddGroupMenuItem(&mi);
mi.position = 300000;
mi.pszService = "";
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU);
mi.name.a = LPGEN("&Main menu");
- hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hGroupMainMenuItemProxy = Menu_AddGroupMenuItem(&mi);
mi.position = 300100;
mi.pszService = "";
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS);
mi.name.a = LPGEN("&Status");
- hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hGroupStatusMenuItemProxy = Menu_AddGroupMenuItem(&mi);
mi.position = 390100;
mi.hIcolibItem = iconItem[1].hIcolib;
mi.name.a = LPGEN("Appearance");
- hAppearanceMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hAppearanceMenuItemProxy = Menu_AddGroupMenuItem(&mi);
mi.position = 400000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.pszService = "Options/OptionsCommand";
mi.name.a = LPGEN("&Options...");
- AddGroupMenuItem(0, (LPARAM)&mi);
+ Menu_AddGroupMenuItem(&mi);
mi.position = 500000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszService = "CLN/About";
mi.name.a = LPGEN("&About the contact list...");
- AddGroupMenuItem(0, (LPARAM)&mi);
+ Menu_AddGroupMenuItem(&mi);
mi.flags = 0;
mi.position = 100000;
mi.hIcolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&New group");
- hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+ hNewGroupMenuItem = Menu_AddGroupMenuItem(&mi, &gmp);
mi.position = 100001;
mi.hIcolibItem = NULL;
mi.hIcolibItem = NULL;
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.name.a = LPGEN("&Hide offline users");
- gmp.lParam = 0; gmp.wParam = -1;
- hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+ gmp.wParam = -1;
+ hHideOfflineUsersMenuItem = Menu_AddGroupMenuItem(&mi, &gmp);
mi.position = 100002;
mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
mi.name.a = LPGEN("Hide &offline users out here");
- hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideOfflineUsersOutHereMenuItem = Menu_AddGroupMenuItem(&mi);
mi.position = 100003;
mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
mi.name.a = LPGEN("Hide &empty groups");
- hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideEmptyGroupsMenuItem = Menu_AddGroupMenuItem(&mi);
mi.position = 100004;
mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
mi.name.a = LPGEN("Disable &groups");
- hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hDisableGroupsMenuItem = Menu_AddGroupMenuItem(&mi);
}
-//////////////////////////////END Group MENU/////////////////////////
-
//////////////////////////////SubGroup MENU/////////////////////////
-int hSubGroupMenuObject;
-
HANDLE hSubGroupMainMenuItemProxy;
HANDLE hSubGroupStatusMenuItemProxy;
HANDLE hPreBuildSubGroupMenuEvent;
HGENMENU hHideOfflineUsersHereMenuItem;
-//SubGroupmenu exec param(ownerdata)
-typedef struct
-{
- char *szServiceName;
- int Param1, Param2;
-}
-SubGroupMenuExecParam, *lpSubGroupMenuExecParam;
-
static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
{
ClcGroup *group = (ClcGroup*)wParam;
@@ -331,97 +237,6 @@ static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
return 0;
}
-static INT_PTR BuildSubGroupMenu(WPARAM wParam, LPARAM)
-{
- NotifyEventHooks(hPreBuildSubGroupMenuEvent, wParam, 0);
-
- HMENU hMenu = CreatePopupMenu();
- Menu_Build(hMenu, hSubGroupMenuObject, wParam);
- return (INT_PTR)hMenu;
-}
-
-static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
-{
- lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_alloc(sizeof(SubGroupMenuExecParam));
- if (mmep == NULL)
- return 0;
-
- TMO_MenuItem *pmi = (TMO_MenuItem*)lParam;
-
- // we need just one parametr.
- GroupMenuParam *gmp = (GroupMenuParam*)wParam;
- mmep->szServiceName = mir_strdup(pmi->pszService);
- if (gmp != NULL) {
- mmep->Param1 = gmp->wParam;
- mmep->Param2 = gmp->lParam;
- }
-
- HGENMENU hNewItem = Menu_AddItem(hSubGroupMenuObject, pmi, mmep);
-
- char buf[1024];
- mir_snprintf(buf, "%s/%s", pmi->pszService, pmi->name.a);
- Menu_ConfigureItem(hNewItem, MCI_OPT_UNIQUENAME, buf);
- return (INT_PTR)hNewItem;
-}
-
-INT_PTR SubGroupMenuCheckService(WPARAM, LPARAM)
-{
- return 0;
-}
-
-INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM)
-{
- MENUITEMINFO *mii = (MENUITEMINFO *)wParam;
- if (mii == NULL)
- return 0;
-
- /*
- if (hHideShowMainMenuItem == (HANDLE)lParam) {
- mii->fMask |= MIIM_STATE;
- mii->fState |= MFS_DEFAULT;
- }
- if (hSubGroupMainMenuItemProxy == (HANDLE)lParam) {
- mii->fMask |= MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
- mii->hSubMenu = Menu_GetMainMenu();
- }
-
- if (hSubGroupStatusMenuItemProxy == (HANDLE)lParam) {
- mii->fMask |= MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
- mii->hSubMenu = (HMENU)Menu_GetStatusMenu();
- }
- */
- return TRUE;
-};
-
-//called with:
-//wparam - ownerdata
-//lparam - lparam from winproc
-INT_PTR SubGroupMenuExecService(WPARAM wParam, LPARAM lParam) {
- if (wParam!=0) {
- lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)wParam;
- if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) {
- //bug in help.c,it used wparam as parent window handle without reason.
- mmep->Param1 = 0;
- CallService(mmep->szServiceName, mmep->Param1, lParam);
- }
- else
- CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
- }
- return 1;
-}
-
-INT_PTR FreeOwnerDataSubGroupMenu(WPARAM, LPARAM lParam)
-{
- lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)lParam;
- if (mmep != NULL) {
- mir_free(mmep->szServiceName);
- mir_free(mmep);
- }
- return 0;
-}
-
// wparam menu handle to pass to clc.c
INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM)
{
@@ -431,59 +246,43 @@ INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM)
void InitSubGroupMenus(void)
{
- CreateServiceFunction("CLISTMENUSSubGroup/ExecService", SubGroupMenuExecService);
- CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu", FreeOwnerDataSubGroupMenu);
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService", SubGroupMenuonAddService);
CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy", GroupMenuExecProxy);
- CreateServiceFunction("CList/AddSubGroupMenuItem", AddSubGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP, BuildSubGroupMenu);
- hPreBuildSubGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
- // SubGroup menu
- hSubGroupMenuObject = Menu_AddObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
- Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
- Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
- Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuonAddService");
-
// add exit command to menu
- GroupMenuParam gmp;
+ GroupMenuParam gmp = {};
CMenuItem mi;
mi.position = 1000;
mi.hIcolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&New subgroup");
- gmp.lParam = 0;
gmp.wParam = POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+ hNewSubGroupMenuItem = Menu_AddSubGroupMenuItem(&mi, &gmp);
mi.position = 1001;
mi.hIcolibItem = NULL;
mi.hIcolibItem = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&Hide offline users in here");
- gmp.lParam = 0;
gmp.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+ hHideOfflineUsersHereMenuItem = (HGENMENU)Menu_AddSubGroupMenuItem(&mi, &gmp);
memset(&mi, 0, sizeof(mi));
mi.position = 900001;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&Rename group");
- gmp.lParam = 0;
gmp.wParam = POPUP_RENAMEGROUP;
- AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+ Menu_AddSubGroupMenuItem(&mi, &gmp);
mi.position = 900002;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.name.a = LPGEN("&Delete group");
- gmp.lParam = 0;
gmp.wParam = POPUP_DELETEGROUP;
- AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
+ Menu_AddSubGroupMenuItem(&mi, &gmp);
}
//////////////////////////////END SubGroup MENU/////////////////////////
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp
index 3d4195c00e..6a5a3937ca 100644
--- a/plugins/Clist_nicer/src/clc.cpp
+++ b/plugins/Clist_nicer/src/clc.cpp
@@ -48,11 +48,6 @@ LONG g_cxsmIcon, g_cysmIcon;
void SetDBButtonStates(MCONTACT hContact);
-HMENU BuildGroupPopupMenu(ClcGroup* group)
-{
- return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP, (WPARAM)group, 0);
-}
-
int AvatarChanged(WPARAM wParam, LPARAM lParam)
{
pcli->pfnClcBroadcast(INTM_AVATARCHANGED, wParam, lParam);
@@ -691,7 +686,7 @@ LBL_Def:
if (dat->selection != -1 && hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMCHECK | CLCHT_ONITEMLABEL)) {
if (contact->type == CLCIT_GROUP) {
- hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP, (WPARAM)contact->group, 0);
+ hMenu = Menu_BuildSubGroupMenu(contact->group);
ClientToScreen(hwnd, &pt);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, NULL);
CheckMenuItem(hMenu, POPUP_GROUPHIDEOFFLINE, contact->group->hideOffline ? MF_CHECKED : MF_UNCHECKED);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 120c984609..bd4e65f1a5 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -1543,7 +1543,7 @@ buttons_done:
break;
case POPUP_SHOWMETAICONS:
cfg::dat.dwFlags ^= CLUI_USEMETAICONS;
- pcli->pfnInitAutoRebuild(hwnd);
+ pcli->pfnInitAutoRebuild(pcli->hwndContactTree);
break;
case POPUP_FRAME:
cfg::dat.dwFlags ^= CLUI_FRAME_CLISTSUNKEN;
@@ -1629,8 +1629,7 @@ buttons_done:
}
}
if (PtInRect(&rc, pt)) {
- HMENU hMenu;
- hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDGROUP, 0, 0);
+ HMENU hMenu = Menu_BuildGroupMenu();
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
DestroyTrayMenu(hMenu);
return 0;
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp
index 8cf100d225..b785b163e3 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -37,7 +37,6 @@ extern HICON overlayicons[10];
extern int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
extern int SetHideOffline(WPARAM wParam, LPARAM lParam);
-HMENU BuildGroupPopupMenu(ClcGroup *group);
ClcContact *CreateClcContact(void);
CListEvent *fnCreateEvent(void);
void ReloadThemedOptions();
@@ -192,7 +191,6 @@ extern "C" int __declspec(dllexport) CListInitialise()
// get the clist interface
pcli->hInst = g_hInst;
- pcli->pfnBuildGroupPopupMenu = BuildGroupPopupMenu;
pcli->pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
pcli->pfnCompareContacts = CompareContacts;
pcli->pfnCreateClcContact = CreateClcContact;