diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-26 22:03:02 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-26 22:03:02 +0000 |
commit | be616d81bdaf8fd4ae61b0a145fb81bbdf467994 (patch) | |
tree | c0d4798a8e882583f74eb166508e0f4ce96bd4e4 /src | |
parent | c89c550677f40d8b2010de442053cba81ba06d96 (diff) |
YEEHAW! CLISTMENUITEM::pszPopupName also died
git-svn-id: http://svn.miranda-ng.org/main/trunk@14404 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdhelp/src/help.cpp | 3 | ||||
-rw-r--r-- | src/mir_app/src/clistmenus.cpp | 73 | ||||
-rw-r--r-- | src/mir_app/src/framesmenu.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/genmenu.cpp | 141 | ||||
-rw-r--r-- | src/mir_app/src/genmenu.h | 4 | ||||
-rw-r--r-- | src/mir_app/src/meta_menu.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/miranda.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/movetogroup.cpp | 3 |
8 files changed, 78 insertions, 156 deletions
diff --git a/src/core/stdhelp/src/help.cpp b/src/core/stdhelp/src/help.cpp index d71ff4c9b1..95fbab090f 100644 --- a/src/core/stdhelp/src/help.cpp +++ b/src/core/stdhelp/src/help.cpp @@ -75,8 +75,7 @@ int LoadHelpModule(void) CLISTMENUITEM mi = { 0 };
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
- mi.pszPopupName = LPGEN("&Help");
- // mi.popupPosition = 2000090000; !!!!!!!!!!!!!!!!!!!!
+ mi.hParentMenu = Menu_CreateRoot(MO_MAIN, LPGENT("&Help"), 2000090000);
mi.position = 2000090000;
mi.pszName = LPGEN("&About...");
mi.pszService = "Help/AboutCommand";
diff --git a/src/mir_app/src/clistmenus.cpp b/src/mir_app/src/clistmenus.cpp index 5103f02de3..a3343b8506 100644 --- a/src/mir_app/src/clistmenus.cpp +++ b/src/mir_app/src/clistmenus.cpp @@ -44,10 +44,8 @@ typedef struct { }
CListIntMenuItem, *lpCListIntMenuItem;
-//new menu sys
-HANDLE hMainMenuObject = 0;
-HANDLE hContactMenuObject = 0;
-HANDLE hStatusMenuObject = 0;
+// new menu sys
+int hMainMenuObject = 0, hContactMenuObject = 0, hStatusMenuObject = 0;
int UnloadMoveToGroup(void);
int statustopos(int status);
@@ -255,20 +253,14 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam) if (!cli.pfnConvertMenu(mi, &tmi))
return 0;
- if (!(mi->flags & CMIF_ROOTHANDLE)) {
- //old system
- tmi.flags |= CMIF_ROOTHANDLE;
- tmi.root = NULL;
- }
-
- //owner data
+ // owner data
ContactMenuExecParam *cmep = (ContactMenuExecParam*)mir_calloc(sizeof(ContactMenuExecParam));
cmep->szServiceName = mir_strdup(mi->pszService);
if (mi->pszContactOwner != NULL)
cmep->pszContactOwner = mir_strdup(mi->pszContactOwner);
tmi.ownerdata = cmep;
- //may be need to change how UniqueName is formed?
+ // may be need to change how UniqueName is formed?
TMO_IntMenuItem *pimi = Menu_AddItem(hContactMenuObject, &tmi);
cmep->pimi = pimi;
@@ -798,7 +790,7 @@ void RebuildMenuOrder(void) //adding root
TMO_MenuItem tmi = { 0 };
- tmi.flags = CMIF_TCHAR | CMIF_ROOTHANDLE | CMIF_KEEPUNTRANSLATED;
+ tmi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
tmi.position = pos++;
tmi.hIcon = ic = (HICON)CallProtoServiceInt(NULL, pa->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
@@ -816,7 +808,7 @@ void RebuildMenuOrder(void) TMO_IntMenuItem *rootmenu = Menu_AddItem(hStatusMenuObject, &tmi);
memset(&tmi, 0, sizeof(tmi));
- tmi.flags = CMIF_TCHAR | CMIF_ROOTHANDLE | CMIF_KEEPUNTRANSLATED;
+ tmi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
tmi.root = rootmenu;
tmi.position = pos++;
tmi.hIcon = ic;
@@ -859,7 +851,7 @@ void RebuildMenuOrder(void) // adding
memset(&tmi, 0, sizeof(tmi));
- tmi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
+ tmi.flags = CMIF_TCHAR;
if (statusModeList[j] == ID_STATUS_OFFLINE)
tmi.flags |= CMIF_CHECKED;
tmi.root = rootmenu;
@@ -902,7 +894,7 @@ void RebuildMenuOrder(void) continue;
TMO_MenuItem tmi = { sizeof(tmi) };
- tmi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
+ tmi.flags = CMIF_TCHAR;
if (statusModeList[j] == ID_STATUS_OFFLINE)
tmi.flags |= CMIF_CHECKED;
@@ -982,12 +974,12 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) // reset all current possible checked statuses
for (int pos2 = 0; pos2 < hStatusMainMenuHandlesCnt; pos2++)
if (pos2 >= 0 && pos2 < hStatusMainMenuHandlesCnt)
- Menu_ModifyItem(hStatusMainMenuHandles[pos2], NULL, INVALID_HANDLE_VALUE, CMIF_ROOTHANDLE);
+ Menu_ModifyItem(hStatusMainMenuHandles[pos2], NULL, INVALID_HANDLE_VALUE, 0);
cli.currentStatusMenuItem = overallStatus;
pos = statustopos(cli.currentStatusMenuItem);
if (pos >= 0 && pos < hStatusMainMenuHandlesCnt)
- Menu_ModifyItem(hStatusMainMenuHandles[pos], NULL, INVALID_HANDLE_VALUE, CMIF_ROOTHANDLE | CMIF_CHECKED);
+ Menu_SetChecked(hStatusMainMenuHandles[pos], true);
}
else {
int pos = statustopos(cli.currentStatusMenuItem);
@@ -995,7 +987,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) pos = 0;
if (pos >= 0 && pos < hStatusMainMenuHandlesCnt)
- Menu_ModifyItem(hStatusMainMenuHandles[pos], NULL, INVALID_HANDLE_VALUE, CMIF_ROOTHANDLE);
+ Menu_ModifyItem(hStatusMainMenuHandles[pos], NULL, INVALID_HANDLE_VALUE, 0);
cli.currentStatusMenuItem = 0;
}
@@ -1007,13 +999,13 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) if (pos == -1)
pos = 0;
for (pos = 0; pos < _countof(statusModeList); pos++)
- Menu_ModifyItem(hStatusMenuHandles[i].menuhandle[pos], NULL, INVALID_HANDLE_VALUE, CMIF_ROOTHANDLE);
+ Menu_ModifyItem(hStatusMenuHandles[i].menuhandle[pos], NULL, INVALID_HANDLE_VALUE, 0);
}
if (ack->lParam >= ID_STATUS_OFFLINE && ack->lParam < ID_STATUS_OFFLINE + _countof(statusModeList)) {
int pos = statustopos((int)ack->lParam);
if (pos >= 0 && pos < _countof(statusModeList))
- Menu_ModifyItem(hStatusMenuHandles[i].menuhandle[pos], NULL, INVALID_HANDLE_VALUE, CMIF_ROOTHANDLE | CMIF_CHECKED);
+ Menu_SetChecked(hStatusMenuHandles[i].menuhandle[pos], true);
}
break;
}
@@ -1063,47 +1055,14 @@ HGENMENU fnGetProtocolMenu(const char* proto) /////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam)
+static INT_PTR AddStatusMenuItem(WPARAM, LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
-
TMO_MenuItem tmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
if (!cli.pfnConvertMenu(mi, &tmi))
return 0;
- // for new style menus the pszPopupName contains the root menu handle
- TMO_IntMenuItem *pRoot = NULL;
- if (mi->flags & CMIF_ROOTHANDLE)
- pRoot = MO_GetIntMenuItem(mi->hParentMenu);
-
- // for old style menus the pszPopupName really means the popup name
- else {
- MenuProto *mp = FindProtocolMenu(mi->pszContactOwner);
- if (mp && mi->pszPopupName) {
- if (mp->pMenu) {
- TCHAR *ptszName = (mi->flags & CMIF_UNICODE) ? mir_tstrdup(mi->ptszPopupName) : mir_a2t(mi->pszPopupName);
- pRoot = MO_RecursiveWalkMenu(mp->pMenu->submenu.first, FindRoot, ptszName);
- mir_free(ptszName);
- }
- if (pRoot == NULL) {
- TMO_MenuItem tmi = { 0 };
- tmi.flags = (mi->flags & CMIF_UNICODE) | CMIF_ROOTHANDLE;
- tmi.position = 1001;
- tmi.root = mp->pMenu;
- tmi.hIcon = NULL;
- tmi.name.a = mi->pszPopupName;
- pRoot = Menu_AddItem(hStatusMenuObject, &tmi);
- }
-
- tmi.flags |= CMIF_ROOTHANDLE;
- tmi.root = pRoot;
- }
- }
-
- if (wParam) {
- int *res = (int*)wParam;
- *res = (int)pRoot;
- }
+ TMO_IntMenuItem *pRoot = MO_GetIntMenuItem(mi->hParentMenu);
// owner data
StatusMenuExecParam *smep = NULL;
diff --git a/src/mir_app/src/framesmenu.cpp b/src/mir_app/src/framesmenu.cpp index 34061566ae..20c89ce1e1 100644 --- a/src/mir_app/src/framesmenu.cpp +++ b/src/mir_app/src/framesmenu.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_cluiframes.h>
-static HANDLE hFrameMenuObject;
+static int hFrameMenuObject;
static HANDLE hPreBuildFrameMenuEvent;
// contactmenu exec param(ownerdata)
@@ -52,7 +52,7 @@ static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam) if (!cli.pfnConvertMenu(mi, &tmi))
return NULL;
- tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL;
+ tmi.root = mi->hParentMenu;
FrameMenuExecParam *fmep = new FrameMenuExecParam();
fmep->szServiceName = mir_strdup(mi->pszService);
diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp index ae4b414d15..f4b2529f7a 100644 --- a/src/mir_app/src/genmenu.cpp +++ b/src/mir_app/src/genmenu.cpp @@ -67,8 +67,19 @@ void FreeAndNil(void **p) }
}
-int GetMenuObjbyId(const int id)
+int GetMenuObjbyId(int id)
{
+ switch (id) {
+ case MO_MAIN: id = hMainMenuObject; break;
+ case MO_CONTACT: id = hContactMenuObject; break;
+ case MO_STATUS: id = hStatusMenuObject; break;
+ case MO_PROTO:
+ if (db_get_b(NULL, "CList", "MoveProtoMenus", true))
+ id = hStatusMenuObject;
+ else
+ id = hMainMenuObject;
+ }
+
for (int i = 0; i < g_menus.getCount(); i++)
if (g_menus[i]->id == id)
return i;
@@ -192,13 +203,13 @@ int MO_RemoveAllObjects() /////////////////////////////////////////////////////////////////////////////////////////
-EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessHotKey(HANDLE hMenuObject, int key)
+EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessHotKey(int hMenuObject, int key)
{
if (!bIsGenMenuInited)
return -1;
mir_cslock lck(csMenuHook);
- int objidx = GetMenuObjbyId((int)hMenuObject);
+ int objidx = GetMenuObjbyId(hMenuObject);
if (objidx == -1)
return FALSE;
@@ -290,9 +301,9 @@ static void Menu_SetItemFlags(HGENMENU hMenuItem, bool bSet, int mask) else
flags &= ~mask;
+ // we allow to set only first 3 bits
mir_cslock lck(csMenuHook);
- int oldflags = (pimi->mi.flags & CMIF_ROOTHANDLE);
- pimi->mi.flags = flags | oldflags;
+ pimi->mi.flags = flags | (pimi->mi.flags & 0xFFFFFFF8);
}
MIR_APP_DLL(void) Menu_EnableItem(HGENMENU hMenuItem, bool bEnable)
@@ -327,8 +338,9 @@ MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HAND replaceStrT(pimi->mi.name.t, ptszName);
if (iFlags != -1) {
- int oldflags = (pimi->mi.flags & CMIF_ROOTHANDLE);
- pimi->mi.flags = iFlags | oldflags;
+ // we allow to set only first 3 bits
+ int oldflags = (pimi->mi.flags & 0xFFFFFFF8);
+ pimi->mi.flags = (iFlags & 0x07) | oldflags;
}
if (hIcon != INVALID_HANDLE_VALUE && !bIconsDisabled) {
@@ -480,14 +492,14 @@ MIR_APP_DLL(int) Menu_ConfigureItem(HGENMENU hItem, int iOption, INT_PTR value) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(int) Menu_ConfigureObject(HANDLE handle, int setting, INT_PTR value)
+MIR_APP_DLL(int) Menu_ConfigureObject(int hMenuObject, int setting, INT_PTR value)
{
if (!bIsGenMenuInited)
return -1;
mir_cslock lck(csMenuHook);
- int pimoidx = GetMenuObjbyId((int)handle);
+ int pimoidx = GetMenuObjbyId(hMenuObject);
int res = pimoidx != -1;
if (res) {
TIntMenuObject* pmo = g_menus[pimoidx];
@@ -519,7 +531,7 @@ MIR_APP_DLL(int) Menu_ConfigureObject(HANDLE handle, int setting, INT_PTR value) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(HANDLE) Menu_AddObject(LPCSTR szName, LPCSTR szDisplayName, LPCSTR szCheckService, LPCSTR szExecService)
+MIR_APP_DLL(int) Menu_AddObject(LPCSTR szName, LPCSTR szDisplayName, LPCSTR szCheckService, LPCSTR szExecService)
{
if (!bIsGenMenuInited || szName == NULL)
return NULL;
@@ -534,18 +546,18 @@ MIR_APP_DLL(HANDLE) Menu_AddObject(LPCSTR szName, LPCSTR szDisplayName, LPCSTR s p->ExecService = mir_strdup(szExecService);
p->m_hMenuIcons = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 15, 100);
g_menus.insert(p);
- return (HANDLE)p->id;
+ return p->id;
}
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(int) Menu_RemoveObject(HANDLE hMenuObject)
+MIR_APP_DLL(int) Menu_RemoveObject(int hMenuObject)
{
- if (!bIsGenMenuInited || hMenuObject == NULL)
+ if (!bIsGenMenuInited || hMenuObject == 0)
return -1;
mir_cslock lck(csMenuHook);
- int objidx = GetMenuObjbyId((int)hMenuObject);
+ int objidx = GetMenuObjbyId(hMenuObject);
if (objidx == -1)
return -1;
@@ -654,36 +666,46 @@ static int GetNextObjectMenuItemId() // Adds new submenu
// Returns a handle to the newly created root item or NULL
-MIR_APP_DLL(HGENMENU) Menu_CreateRoot(HGENMENU hRoot, LPCTSTR ptszName, int position, HANDLE hIcoLib, int hLang)
+static int FindRoot(TMO_IntMenuItem *pimi, void *param)
+{
+ if (pimi->mi.name.t != NULL)
+ if (pimi->submenu.first && !mir_tstrcmp(pimi->mi.name.t, (TCHAR*)param))
+ return TRUE;
+
+ return FALSE;
+}
+
+MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int position, HANDLE hIcoLib, int hLang)
{
- if (hRoot == NULL)
+ mir_cslock lck(csMenuHook);
+ int objidx = GetMenuObjbyId(hMenuObject);
+ if (objidx == -1)
return NULL;
+ TMO_IntMenuItem *oldroot = MO_RecursiveWalkMenu(g_menus[objidx]->m_items.first, FindRoot, (void*)ptszName);
+ if (oldroot != NULL)
+ return oldroot;
+
TMO_MenuItem tmi = { 0 };
- tmi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
+ tmi.flags = CMIF_TCHAR;
tmi.hIcolibItem = hIcoLib;
- tmi.root = hRoot;
tmi.hLangpack = hLang;
tmi.name.t = (TCHAR*)ptszName;
tmi.position = position;
- return Menu_AddItem(hRoot->owner, &tmi);
+ return Menu_AddItem(hMenuObject, &tmi);
}
/////////////////////////////////////////////////////////////////////////////////////////
// Adds new menu item
// Returns a handle to the newly created item or NULL
-MIR_APP_DLL(HGENMENU) Menu_AddItem(HANDLE hMenuObject, TMO_MenuItem *pmi)
+MIR_APP_DLL(HGENMENU) Menu_AddItem(int hMenuObject, TMO_MenuItem *pmi)
{
if (!bIsGenMenuInited || pmi == NULL)
return NULL;
- // old mode
- if (!(pmi->flags & CMIF_ROOTHANDLE))
- return MO_AddOldNewMenuItem(hMenuObject, pmi);
-
mir_cslock lck(csMenuHook);
- int objidx = GetMenuObjbyId((int)hMenuObject);
+ int objidx = GetMenuObjbyId(hMenuObject);
if (objidx == -1)
return NULL;
@@ -719,10 +741,13 @@ MIR_APP_DLL(HGENMENU) Menu_AddItem(HANDLE hMenuObject, TMO_MenuItem *pmi) p->mi.root = NULL;
TMO_IntMenuItem *pRoot = (p->mi.root != NULL) ? MO_GetIntMenuItem(p->mi.root) : NULL;
- if (pRoot)
+ if (pRoot) {
p->owner = &pRoot->submenu;
- else
- p->owner = &pmo->m_items;
+
+ if (pRoot->iconId == -1)
+ pRoot->iconId = p->iconId;
+ }
+ else p->owner = &pmo->m_items;
if (!p->owner->first)
p->owner->first = p;
@@ -736,62 +761,6 @@ MIR_APP_DLL(HGENMENU) Menu_AddItem(HANDLE hMenuObject, TMO_MenuItem *pmi) // wparam = MenuObjectHandle
// lparam = PMO_MenuItem
-int FindRoot(TMO_IntMenuItem *pimi, void* param)
-{
- if (pimi->mi.name.t != NULL)
- if (pimi->submenu.first && !mir_tstrcmp(pimi->mi.name.t, (TCHAR*)param))
- return TRUE;
-
- return FALSE;
-}
-
-TMO_IntMenuItem* MO_AddOldNewMenuItem(HANDLE menuobjecthandle, TMO_MenuItem *pmi)
-{
- if (!bIsGenMenuInited || pmi == NULL)
- return NULL;
-
- int objidx = GetMenuObjbyId((int)menuobjecthandle);
- if (objidx == -1)
- return NULL;
-
- if (pmi->flags & CMIF_ROOTHANDLE)
- return NULL;
-
- //is item with popup or not
- if (pmi->root == 0) {
- // yes, this without popup
- pmi->root = NULL; //first level
- }
- else { // no, search for needed root and create it if need
- TCHAR* tszRoot;
- if (pmi->flags & CMIF_UNICODE)
- tszRoot = mir_tstrdup((TCHAR*)pmi->root);
- else
- tszRoot = mir_a2t((char*)pmi->root);
-
- TMO_IntMenuItem *oldroot = MO_RecursiveWalkMenu(g_menus[objidx]->m_items.first, FindRoot, tszRoot);
- mir_free(tszRoot);
-
- if (oldroot == NULL) {
- // not found, creating root
- TMO_MenuItem tmi = *pmi;
- tmi.flags |= CMIF_ROOTHANDLE;
- tmi.ownerdata = 0;
- tmi.root = NULL;
- // copy pszPopupName
- tmi.name.t = (TCHAR*)pmi->root;
- if ((oldroot = Menu_AddItem(menuobjecthandle, &tmi)) != NULL)
- Menu_ConfigureItem(oldroot, MCI_OPT_UNIQUENAME, (const char*)pmi->root);
- }
- pmi->root = oldroot;
-
- // popup will be created in next commands
- }
- pmi->flags |= CMIF_ROOTHANDLE;
- // add popup(root allready exists)
- return Menu_AddItem(menuobjecthandle, pmi);
-}
-
static int WhereToPlace(HMENU hMenu, TMO_MenuItem *mi)
{
MENUITEMINFO mii = { 0 };
@@ -1037,14 +1006,14 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, INT_PTR // lparam ListParam*
// result hMenu
-EXTERN_C MIR_APP_DLL(HMENU) Menu_Build(HMENU parent, HANDLE hMenuObject, WPARAM wParam, LPARAM lParam)
+EXTERN_C MIR_APP_DLL(HMENU) Menu_Build(HMENU parent, int hMenuObject, WPARAM wParam, LPARAM lParam)
{
if (!bIsGenMenuInited)
return NULL;
mir_cslock lck(csMenuHook);
- int pimoidx = GetMenuObjbyId(int(hMenuObject));
+ int pimoidx = GetMenuObjbyId(hMenuObject);
if (pimoidx == -1)
return 0;
diff --git a/src/mir_app/src/genmenu.h b/src/mir_app/src/genmenu.h index 93909aab18..6c6be6aeae 100644 --- a/src/mir_app/src/genmenu.h +++ b/src/mir_app/src/genmenu.h @@ -107,8 +107,6 @@ void GetMenuItemName(TMO_IntMenuItem *pMenuItem, char* pszDest, size_t cbDestSiz TMO_IntMenuItem* MO_GetIntMenuItem(HGENMENU);
-TMO_IntMenuItem* MO_AddOldNewMenuItem(HANDLE menuobjecthandle, TMO_MenuItem *pmi);
-
int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis);
int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis);
@@ -124,8 +122,6 @@ TMO_IntMenuItem *MO_RecursiveWalkMenu(TMO_IntMenuItem*, pfnWalkFunc, void*); int InitGenMenu();
int UnitGenMenu();
-int FindRoot(TMO_IntMenuItem *pimi, void* param);
-
TMO_IntMenuItem * GetMenuItemByGlobalID(int globalMenuID);
BOOL FindMenuHanleByGlobalID(HMENU hMenu, int globalID, struct _MenuItemHandles * dat); //GenMenu.c
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index d4bb4734ae..28f321a63b 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -397,12 +397,12 @@ void InitMenus() hMenuDelete = Menu_AddContactMenuItem(&mi);
mi.position = -99000;
- mi.flags = CMIF_HIDDEN | CMIF_ROOTHANDLE;
+ mi.flags = CMIF_HIDDEN;
mi.icolibItem = 0;
mi.pszName = LPGEN("Subcontacts");
hMenuRoot = Menu_AddContactMenuItem(&mi);
- mi.flags = CMIF_HIDDEN | CMIF_ROOTHANDLE;
+ mi.flags = CMIF_HIDDEN;
mi.hParentMenu = hMenuRoot;
for (int i = 0; i < MAX_CONTACTS; i++) {
mi.position--;
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index 7d1edbee87..aba85570c5 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -122,7 +122,7 @@ int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon /**** clistmenus.cpp ********************************************************************/
-extern HANDLE hMainMenuObject, hContactMenuObject, hStatusMenuObject;
+extern int hMainMenuObject, hContactMenuObject, hStatusMenuObject;
extern HANDLE hPreBuildMainMenuEvent, hPreBuildContactMenuEvent;
extern HANDLE hShutdownEvent, hPreShutdownEvent;
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index 311c72a629..7deca5d376 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -71,7 +71,7 @@ static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, boo mi.hParentMenu = hRoot;
mi.position = pos;
mi.ptszName = PrepareGroupName(name);
- mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
mi.pszService = MTG_MOVE;
@@ -91,7 +91,6 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) CLISTMENUITEM mi = { 0 };
mi.position = 100000;
mi.pszName = LPGEN("&Move to group");
- mi.flags = CMIF_ROOTHANDLE;
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUP);
hMoveToGroupItem = Menu_AddContactMenuItem(&mi);
|