diff options
author | George Hazan <george.hazan@gmail.com> | 2015-07-02 19:04:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-07-02 19:04:21 +0000 |
commit | 209e1040e34c50e424a7aa0a7c860c7fc279a76f (patch) | |
tree | 96742a262043ca7155d75414ae48b3907f3e2881 /plugins | |
parent | 755eaef1f61577c44a9305fb7db3dd25990de52c (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')
-rw-r--r-- | plugins/Clist_nicer/clist_nicer_10.vcxproj.filters | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/clist_nicer_12.vcxproj.filters | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp | 273 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 7 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 5 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/init.cpp | 2 | ||||
-rw-r--r-- | plugins/Quotes/src/Forex.cpp | 11 | ||||
-rw-r--r-- | plugins/SecureIM/src/main.cpp | 35 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/mir_menuitems.cpp | 18 |
9 files changed, 63 insertions, 300 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;
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 22ced59186..1fc1c4a043 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -117,18 +117,9 @@ void InitMenu() Menu_AddMainMenuItem(&mi);
CreateServiceFunction(mi.pszService, QuotesMenu_ImportAll);
- bool bSubGroups = 1 == ServiceExists(MS_CLIST_MENUBUILDSUBGROUP);
-
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, Quotes_PrebuildContactMenu);
- if (bSubGroups) {
- CMenuItem miroot;
- miroot.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
- miroot.name.a = QUOTES_PROTOCOL_NAME;
- mi.root = Menu_AddContactMenuItem(&miroot, QUOTES_PROTOCOL_NAME);
- }
- else mi.root = NULL;
-
+ mi.root = Menu_CreateRoot(MO_CONTACT, _T(QUOTES_PROTOCOL_NAME), 0, Quotes_GetIconHandle(IDI_ICON_MAIN));
mi.name.t = LPGENT("Refresh");
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_REFRESH);
mi.pszService = "Quotes/RefreshContact";
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index b95da08213..4e6e31cdb9 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -234,18 +234,10 @@ static int onModulesLoaded(WPARAM, LPARAM) g_hMenu[0] = MyAddMenuItem(sim301, 110000, g_hICO[ICO_CM_EST], MODULENAME"/SIM_EST", CMIF_NOTOFFLINE);
g_hMenu[1] = MyAddMenuItem(sim302, 110001, g_hICO[ICO_CM_DIS], MODULENAME"/SIM_DIS", CMIF_NOTOFFLINE);
- if (ServiceExists(MS_CLIST_MENUBUILDSUBGROUP)) {
- g_hMenu[2] = MyAddMenuItem(sim312[0], 110002, NULL, NULL);
- g_hMenu[3] = MyAddSubItem(g_hMenu[2], sim232[0], 110003, 110002, MODULENAME"/SIM_ST_DIS");
- g_hMenu[4] = MyAddSubItem(g_hMenu[2], sim232[1], 110004, 110002, MODULENAME"/SIM_ST_ENA");
- g_hMenu[5] = MyAddSubItem(g_hMenu[2], sim232[2], 110005, 110002, MODULENAME"/SIM_ST_TRY");
- }
- else {
- g_hMenu[2] = 0;
- g_hMenu[3] = MyAddMenuItem(sim232W[0], 110003, NULL, MODULENAME"/SIM_ST_DIS");
- g_hMenu[4] = MyAddMenuItem(sim232W[1], 110004, NULL, MODULENAME"/SIM_ST_ENA");
- g_hMenu[5] = MyAddMenuItem(sim232W[2], 110005, NULL, MODULENAME"/SIM_ST_TRY");
- }
+ g_hMenu[2] = MyAddMenuItem(sim312[0], 110002, NULL, NULL);
+ g_hMenu[3] = MyAddSubItem(g_hMenu[2], sim232[0], 110003, 110002, MODULENAME"/SIM_ST_DIS");
+ g_hMenu[4] = MyAddSubItem(g_hMenu[2], sim232[1], 110004, 110002, MODULENAME"/SIM_ST_ENA");
+ g_hMenu[5] = MyAddSubItem(g_hMenu[2], sim232[2], 110005, 110002, MODULENAME"/SIM_ST_TRY");
if (bPGPloaded) {
g_hMenu[6] = MyAddMenuItem(sim306, 110006, mode2icon(MODE_PGP | SECURED, 2), MODULENAME"/PGP_SET", 0);
@@ -257,20 +249,11 @@ static int onModulesLoaded(WPARAM, LPARAM) g_hMenu[9] = MyAddMenuItem(sim309, 110009, mode2icon(MODE_GPG, 2), MODULENAME"/GPG_DEL", 0);
}
- if (ServiceExists(MS_CLIST_MENUBUILDSUBGROUP)) {
- g_hMenu[10] = MyAddMenuItem(sim311[0], 110010, NULL, NULL);
- g_hMenu[11] = MyAddSubItem(g_hMenu[10], sim231[0], 110011, 110010, MODULENAME"/MODE_NAT");
- g_hMenu[12] = MyAddSubItem(g_hMenu[10], sim231[1], 110012, 110010, MODULENAME"/MODE_PGP");
- g_hMenu[13] = MyAddSubItem(g_hMenu[10], sim231[2], 110013, 110010, MODULENAME"/MODE_GPG");
- g_hMenu[14] = MyAddSubItem(g_hMenu[10], sim231[3], 110014, 110010, MODULENAME"/MODE_RSA");
- }
- else {
- g_hMenu[10] = 0;
- g_hMenu[11] = MyAddMenuItem(sim231W[0], 110011, NULL, MODULENAME"/MODE_NAT");
- g_hMenu[12] = MyAddMenuItem(sim231W[1], 110012, NULL, MODULENAME"/MODE_PGP");
- g_hMenu[13] = MyAddMenuItem(sim231W[2], 110013, NULL, MODULENAME"/MODE_GPG");
- g_hMenu[14] = MyAddMenuItem(sim231W[3], 110014, NULL, MODULENAME"/MODE_RSA");
- }
+ g_hMenu[10] = MyAddMenuItem(sim311[0], 110010, NULL, NULL);
+ g_hMenu[11] = MyAddSubItem(g_hMenu[10], sim231[0], 110011, 110010, MODULENAME"/MODE_NAT");
+ g_hMenu[12] = MyAddSubItem(g_hMenu[10], sim231[1], 110012, 110010, MODULENAME"/MODE_PGP");
+ g_hMenu[13] = MyAddSubItem(g_hMenu[10], sim231[2], 110013, 110010, MODULENAME"/MODE_GPG");
+ g_hMenu[14] = MyAddSubItem(g_hMenu[10], sim231[3], 110014, 110010, MODULENAME"/MODE_RSA");
InitSRMMIcons();
return 0;
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 24822fa83c..003a2c9a88 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -315,7 +315,7 @@ void RebuildGroup() mi.position = 250000;
mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.name.a = MODULELONGNAME;
- mhRoot = Menu_AddGroupMenuItem(0, &mi);
+ mhRoot = Menu_AddGroupMenuItem(&mi);
hMenuItem[item++] = mhRoot;
mhExIm = mhRoot;
break;
@@ -324,7 +324,7 @@ void RebuildGroup() mi.position = 250100;
mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import contact");
- mhExIm = Menu_AddGroupMenuItem(0, &mi);
+ mhExIm = Menu_AddGroupMenuItem(&mi);
hMenuItem[item++] = mhExIm;
mhRoot = NULL;
break;
@@ -341,14 +341,14 @@ void RebuildGroup() mi.name.a = LPGEN("Export all contacts");
mi.position = 250200;
mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
- hMenuItem[item++] = Menu_AddGroupMenuItem(0, &mi);
+ hMenuItem[item++] = Menu_AddGroupMenuItem(&mi);
// Import
mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
mi.name.a = LPGEN("Import all contacts");
mi.position = 250300;
mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
- hMenuItem[item++] = Menu_AddGroupMenuItem(0, &mi);
+ hMenuItem[item++] = Menu_AddGroupMenuItem(&mi);
}
/******************************
@@ -403,7 +403,7 @@ void RebuildSubGroup() mi.position = 1050000;
mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.name.a = MODULELONGNAME;
- mhRoot = Menu_AddSubGroupMenuItem(0, &mi);
+ mhRoot = Menu_AddSubGroupMenuItem(&mi);
hMenuItem[item++] = mhRoot;
mhExIm = mhRoot;
break;
@@ -412,7 +412,7 @@ void RebuildSubGroup() mi.position = 1050100;
mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import group");
- mhExIm = Menu_AddSubGroupMenuItem(0, &mi);
+ mhExIm = Menu_AddSubGroupMenuItem(&mi);
hMenuItem[item++] = mhExIm;
mhRoot = NULL;
break;
@@ -430,9 +430,8 @@ void RebuildSubGroup() mi.name.a = mhExIm != NULL ? LPGEN("&Export") : LPGEN("&Export group");
mi.position = 1050200;
mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
- gmp.lParam = 0;
gmp.wParam = TRUE;
- hMenuItem[item++] = Menu_AddSubGroupMenuItem(&gmp, &mi);
+ hMenuItem[item++] = Menu_AddSubGroupMenuItem(&mi, &gmp);
// Import
mir_strcpy(tDest, "/ImportGroup"); //mi.pszService
@@ -440,9 +439,8 @@ void RebuildSubGroup() mi.name.a = mhExIm != NULL ? LPGEN("&Import") : LPGEN("&Import group");
mi.position = 1050300;
mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
- gmp.lParam = 0;
gmp.wParam = FALSE;
- hMenuItem[item++] = Menu_AddSubGroupMenuItem(&gmp, &mi);
+ hMenuItem[item++] = Menu_AddSubGroupMenuItem(&mi, &gmp);
}
/******************************
|