summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-22 14:11:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-22 14:11:54 +0000
commitca410fe247243f87ac3234f526f708111f227c74 (patch)
tree53900a832c06219ff6fbc1e5a63dbe4d1b450785
parentb3506557a58f53ed0fc3a96c4ec4a3b8098a542d (diff)
various menu definition quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@14326 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp1
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp175
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp2
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp176
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp2
-rw-r--r--plugins/CrashDumper/src/crshdmp.cpp6
-rw-r--r--plugins/CyrTranslit/src/MirandaContact.cpp6
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp2
-rw-r--r--plugins/MenuItemEx/src/main.cpp2
-rw-r--r--plugins/MirLua/src/m_genmenu.cpp1
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp2
-rw-r--r--plugins/SecureIM/src/main.cpp2
-rw-r--r--plugins/SmileyAdd/src/main.cpp2
-rw-r--r--plugins/WhenWasIt/src/WhenWasIt.cpp21
-rw-r--r--protocols/AimOscar/src/proto.cpp3
-rw-r--r--protocols/AimOscar/src/proto.h5
-rw-r--r--protocols/AimOscar/src/theme.cpp22
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp2
-rw-r--r--protocols/Tlen/src/tlen.cpp3
19 files changed, 166 insertions, 269 deletions
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index 9ef985d950..096bb7060d 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -538,7 +538,6 @@ void BossKeyMenuItemInit(void) // Add menu item
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_TCHAR;
mi.position = 2000100000;
- mi.pszPopupName = 0;
mi.hIcon = IcoLib_GetIcon("hidemim");
mi.ptszName = LPGENT("Hide");
mi.pszService = MS_BOSSKEY_HIDE;
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index 6bb4984b54..2d1b9bf74a 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -752,7 +752,7 @@ static int CLUIFramesGetalClientFrame(void)
return -1;
}
-static HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU(*pfnAdd)(CLISTMENUITEM*))
+static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGENMENU(*pfnAdd)(CLISTMENUITEM*))
{
//TMO_MenuItem tmi;
HGENMENU menuid;
@@ -762,12 +762,11 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, H
return NULL;
CLISTMENUITEM mi = { 0 };
- mi.pszPopupName = (char *)root;
+ mi.hParentMenu = root;
mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Visible");
mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
- mi.pszContactOwner = (char *)0;
mi.pszService = MS_CLIST_FRAMES_SHFRAME;
menuid = pfnAdd(&mi);
if (frameid == -1) _hmiVisible = menuid;
@@ -775,146 +774,114 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, H
popuppos += 100000;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Show title");
- mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SHFRAMETITLEBAR;
- mi.pszContactOwner = (char *)0;
menuid = pfnAdd(&mi);
if (frameid == -1) _hmiTBVisible = menuid;
else g_pfwFrames[framepos].MenuHandles.MITBVisible = menuid;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Locked");
- mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_ULFRAME;
- mi.pszContactOwner = (char *)0;
menuid = pfnAdd(&mi);
if (frameid == -1) _hmiLock = menuid;
else g_pfwFrames[framepos].MenuHandles.MILock = menuid;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Expanded");
- mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_UCOLLFRAME;
- mi.pszContactOwner = (char *)0;
menuid = pfnAdd(&mi);
if (frameid == -1) _hmiColl = menuid;
else g_pfwFrames[framepos].MenuHandles.MIColl = menuid;
- //floating
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
+ // floating
mi.position = popuppos++;
mi.pszName = LPGEN("&Floating mode");
mi.flags = CMIF_CHILDPOPUP;
mi.pszService = "Set_Floating";
- mi.pszContactOwner = (char *)0;
menuid = pfnAdd(&mi);
if (frameid == -1) _hmiFloating = menuid;
else g_pfwFrames[framepos].MenuHandles.MIFloating = menuid;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Border");
mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SETUNBORDER;
- mi.pszContactOwner = (char *)0;
menuid = pfnAdd(&mi);
if (frameid == -1) _hmiBorder = menuid;
else g_pfwFrames[framepos].MenuHandles.MIBorder = menuid;
popuppos += 100000;
- {
- //alignment root
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Align");
- mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
- mi.pszService = "";
- mi.pszContactOwner = (char *)0;
- menuid = pfnAdd(&mi);
- if (frameid == -1) _hmiAlignRoot = menuid;
- else g_pfwFrames[framepos].MenuHandles.MIAlignRoot = menuid;
-
- mi.flags = CMIF_CHILDPOPUP;
- //align top
- mi.pszPopupName = (char *)menuid;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Top");
- mi.pszService = CLUIFRAMESSETALIGNALTOP;
- mi.pszContactOwner = (char *)alTop;
- menuid = pfnAdd(&mi);
- if (frameid == -1) _hmiAlignTop = menuid;
- else g_pfwFrames[framepos].MenuHandles.MIAlignTop = menuid;
-
-
- //align client
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Client");
- mi.pszService = CLUIFRAMESSETALIGNALCLIENT;
- mi.pszContactOwner = (char *)alClient;
- menuid = pfnAdd(&mi);
- if (frameid == -1) _hmiAlignClient = menuid;
- else g_pfwFrames[framepos].MenuHandles.MIAlignClient = menuid;
-
- //align bottom
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Bottom");
- mi.pszService = CLUIFRAMESSETALIGNALBOTTOM;
- mi.pszContactOwner = (char *)alBottom;
- menuid = pfnAdd(&mi);
- if (frameid == -1) _hmiAlignBottom = menuid;
- else g_pfwFrames[framepos].MenuHandles.MIAlignBottom = menuid;
-
- }
-
- { //position
- //position root
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Position");
- mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
- mi.pszService = "";
- mi.pszContactOwner = (char *)0;
- menuid = pfnAdd(&mi);
- if (frameid == -1) _hmiPosRoot = menuid;
- else g_pfwFrames[framepos].MenuHandles.MIPosRoot = menuid;
- //??????
- mi.pszPopupName = (char *)menuid;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Up");
- mi.flags = CMIF_CHILDPOPUP;
- mi.pszService = CLUIFRAMESMOVEUP;
- mi.pszContactOwner = (char *)1;
- menuid = pfnAdd(&mi);
- if (frameid == -1) _hmiPosUp = menuid;
- else g_pfwFrames[framepos].MenuHandles.MIPosUp = menuid;
-
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Down");
- mi.flags = CMIF_CHILDPOPUP;
- mi.pszService = CLUIFRAMESMOVEDOWN;
- mi.pszContactOwner = (char *)-1;
- menuid = pfnAdd(&mi);
- if (frameid == -1) _hmiPosDown = menuid;
- else g_pfwFrames[framepos].MenuHandles.MIPosDown = menuid;
+ // alignment root
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Align");
+ mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
+ mi.pszService = "";
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiAlignRoot = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIAlignRoot = menuid;
- }
+ mi.flags = CMIF_CHILDPOPUP;
+ // align top
+ mi.hParentMenu = menuid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Top");
+ mi.pszService = CLUIFRAMESSETALIGNALTOP;
+ mi.pszContactOwner = (char *)alTop;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiAlignTop = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIAlignTop = menuid;
+
+
+ // align client
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Client");
+ mi.pszService = CLUIFRAMESSETALIGNALCLIENT;
+ mi.pszContactOwner = (char *)alClient;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiAlignClient = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIAlignClient = menuid;
+
+ // align bottom
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Bottom");
+ mi.pszService = CLUIFRAMESSETALIGNALBOTTOM;
+ mi.pszContactOwner = (char *)alBottom;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiAlignBottom = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIAlignBottom = menuid;
+
+ // position root
+ mi.hParentMenu = root;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Position");
+ mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
+ mi.pszService = "";
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiPosRoot = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIPosRoot = menuid;
+
+ mi.hParentMenu = menuid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Up");
+ mi.flags = CMIF_CHILDPOPUP;
+ mi.pszService = CLUIFRAMESMOVEUP;
+ mi.pszContactOwner = (char *)1;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiPosUp = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIPosUp = menuid;
+
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Down");
+ mi.pszService = CLUIFRAMESMOVEDOWN;
+ mi.pszContactOwner = (char *)-1;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiPosDown = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIPosDown = menuid;
return 0;
}
@@ -1648,7 +1615,7 @@ static int CLUIFramesLoadMainMenu()
mi.ptszName = g_pfwFrames[i].TitleBar.tbname ? g_pfwFrames[i].TitleBar.tbname : g_pfwFrames[i].name;
mi.pszService = 0;
g_pfwFrames[i].MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi);
- CLUIFramesCreateMenuForFrame(g_pfwFrames[i].id, (int)g_pfwFrames[i].MenuHandles.MainMenuItem, separator, Menu_AddMainMenuItem);
+ CLUIFramesCreateMenuForFrame(g_pfwFrames[i].id, g_pfwFrames[i].MenuHandles.MainMenuItem, separator, Menu_AddMainMenuItem);
CLUIFramesModifyMainMenuItems(g_pfwFrames[i].id, 0);
CallService(MS_CLIST_FRAMEMENUNOTIFY, (WPARAM)g_pfwFrames[i].id, (LPARAM)g_pfwFrames[i].MenuHandles.MainMenuItem);
separator++;
@@ -3564,7 +3531,7 @@ int CLUIFrameOnModulesLoad(WPARAM, LPARAM)
{
/* HOOK */
CLUIFramesLoadMainMenu();
- CLUIFramesCreateMenuForFrame(-1, -1, 000010000, Menu_AddContextFrameMenuItem);
+ CLUIFramesCreateMenuForFrame(-1, HGENMENU_ROOT, 000010000, Menu_AddContextFrameMenuItem);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index b2bbe07d35..f9d532d532 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -101,7 +101,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
CLISTMENUITEM mi = { 0 };
mi.icolibItem = iconList[bContactRate].hIcolib;
- mi.pszPopupName = (char *)-1;
+ mi.hParentMenu = HGENMENU_ROOT;
mi.position = 0;
mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR;
if (!bContactRate)
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index af7a4dad79..9a501b12d6 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -572,7 +572,7 @@ int CLUIFramesGetalClientFrame(void)
return -1;
}
-HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
+HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
HGENMENU menuid;
int framepos = id2pos(frameid);
@@ -581,182 +581,148 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU
return NULL;
CLISTMENUITEM mi = { 0 };
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
- mi.pszPopupName = (char *)root;
mi.popupPosition = frameid;
+
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
+ mi.hParentMenu = root;
mi.position = popuppos++;
mi.pszName = LPGEN("&FrameTitle");
mi.flags = CMIF_CHILDPOPUP | CMIF_GRAYED;
- mi.pszContactOwner = 0;
menuid = pfnAdd(&mi);
if (frameid == -1) contMITitle = menuid;
else Frames[framepos].MenuHandles.MITitle = menuid;
popuppos += 100000;
+
mi.hIcon = NULL;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Visible");
mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
- mi.pszContactOwner = 0;
mi.pszService = MS_CLIST_FRAMES_SHFRAME;
menuid = pfnAdd(&mi);
if (frameid == -1) contMIVisible = menuid;
else Frames[framepos].MenuHandles.MIVisible = menuid;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Show title bar");
mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SHFRAMETITLEBAR;
- mi.pszContactOwner = 0;
menuid = pfnAdd(&mi);
if (frameid == -1) contMITBVisible = menuid;
else Frames[framepos].MenuHandles.MITBVisible = menuid;
-
popuppos += 100000;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Locked");
mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_ULFRAME;
- mi.pszContactOwner = 0;
menuid = pfnAdd(&mi);
if (frameid == -1) contMILock = menuid;
else Frames[framepos].MenuHandles.MILock = menuid;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Collapsed");
mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_UCOLLFRAME;
- mi.pszContactOwner = 0;
menuid = pfnAdd(&mi);
if (frameid == -1) contMIColl = menuid;
else Frames[framepos].MenuHandles.MIColl = menuid;
- //floating
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
+ // floating
mi.position = popuppos++;
mi.pszName = LPGEN("&Floating mode");
mi.flags = CMIF_CHILDPOPUP;
mi.pszService = "Set_Floating";
- mi.pszContactOwner = 0;
menuid = pfnAdd(&mi);
if (frameid == -1) contMIFloating = menuid;
else Frames[framepos].MenuHandles.MIFloating = menuid;
-
popuppos += 100000;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Border");
mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SETUNBORDER;
- mi.pszContactOwner = 0;
menuid = pfnAdd(&mi);
if (frameid == -1) contMIBorder = menuid;
else Frames[framepos].MenuHandles.MIBorder = menuid;
popuppos += 100000;
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
mi.position = popuppos++;
mi.pszName = LPGEN("&Skinned frame");
mi.flags = CMIF_CHILDPOPUP | CMIF_CHECKED;
mi.pszService = MS_CLIST_FRAMES_SETSKINNED;
- mi.pszContactOwner = 0;
menuid = pfnAdd(&mi);
if (frameid == -1) contMISkinned = menuid;
else Frames[framepos].MenuHandles.MISkinned = menuid;
popuppos += 100000;
- {
- //alignment root
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Align");
- mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
- mi.pszService = "";
- mi.pszContactOwner = (char *)0;
- menuid = pfnAdd(&mi);
- if (frameid == -1) contMIAlignRoot = menuid;
- else Frames[framepos].MenuHandles.MIAlignRoot = menuid;
-
- mi.flags = CMIF_CHILDPOPUP;
- //align top
- mi.pszPopupName = (char *)menuid;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Top");
- mi.pszService = CLUIFRAMESSETALIGNALTOP;
- mi.pszContactOwner = (char *)alTop;
- menuid = pfnAdd(&mi);
- if (frameid == -1) contMIAlignTop = menuid;
- else Frames[framepos].MenuHandles.MIAlignTop = menuid;
-
-
- //align client
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Client");
- mi.pszService = CLUIFRAMESSETALIGNALCLIENT;
- mi.pszContactOwner = (char *)alClient;
- menuid = pfnAdd(&mi);
- if (frameid == -1) contMIAlignClient = menuid;
- else Frames[framepos].MenuHandles.MIAlignClient = menuid;
-
- //align bottom
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Bottom");
- mi.pszService = CLUIFRAMESSETALIGNALBOTTOM;
- mi.pszContactOwner = (char *)alBottom;
- menuid = pfnAdd(&mi);
- if (frameid == -1) contMIAlignBottom = menuid;
- else Frames[framepos].MenuHandles.MIAlignBottom = menuid;
- }
-
- { //position
- //position root
- mi.pszPopupName = (char *)root;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Position");
- mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
- mi.pszService = "";
- mi.pszContactOwner = (char *)0;
- menuid = pfnAdd(&mi);
-
- mi.pszPopupName = (char *)menuid;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Up");
- mi.flags = CMIF_CHILDPOPUP;
- mi.pszService = CLUIFRAMESMOVEUP;
- mi.pszContactOwner = (char *)1;
- pfnAdd(&mi);
-
- mi.pszPopupName = (char *)menuid;
- mi.popupPosition = frameid;
- mi.position = popuppos++;
- mi.pszName = LPGEN("&Down");
- mi.flags = CMIF_CHILDPOPUP;
- mi.pszService = CLUIFRAMESMOVEDOWN;
- mi.pszContactOwner = (char *) - 1;
- pfnAdd(&mi);
- }
+ // alignment root
+ mi.hParentMenu = root;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Align");
+ mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
+ mi.pszService = "";
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) contMIAlignRoot = menuid;
+ else Frames[framepos].MenuHandles.MIAlignRoot = menuid;
+
+ mi.flags = CMIF_CHILDPOPUP;
+ // align top
+ mi.hParentMenu = menuid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Top");
+ mi.pszService = CLUIFRAMESSETALIGNALTOP;
+ mi.pszContactOwner = (char *)alTop;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) contMIAlignTop = menuid;
+ else Frames[framepos].MenuHandles.MIAlignTop = menuid;
+
+ // align client
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Client");
+ mi.pszService = CLUIFRAMESSETALIGNALCLIENT;
+ mi.pszContactOwner = (char *)alClient;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) contMIAlignClient = menuid;
+ else Frames[framepos].MenuHandles.MIAlignClient = menuid;
+
+ // align bottom
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Bottom");
+ mi.pszService = CLUIFRAMESSETALIGNALBOTTOM;
+ mi.pszContactOwner = (char *)alBottom;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) contMIAlignBottom = menuid;
+ else Frames[framepos].MenuHandles.MIAlignBottom = menuid;
+ // position root
+ mi.hParentMenu = root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Position");
+ mi.flags = CMIF_CHILDPOPUP | CMIF_ROOTPOPUP;
+ mi.pszService = "";
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+
+ mi.hParentMenu = menuid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Up");
+ mi.flags = CMIF_CHILDPOPUP;
+ mi.pszService = CLUIFRAMESMOVEUP;
+ mi.pszContactOwner = (char *)1;
+ pfnAdd(&mi);
+
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Down");
+ mi.flags = CMIF_CHILDPOPUP;
+ mi.pszService = CLUIFRAMESMOVEDOWN;
+ mi.pszContactOwner = (char *)-1;
+ pfnAdd(&mi);
return 0;
}
@@ -1480,7 +1446,7 @@ static int CLUIFramesLoadMainMenu()
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME);
mi.flags = CMIF_ROOTHANDLE;
mi.position = 3000090000;
- mi.pszPopupName = (char*)-1;
+ mi.hParentMenu = HGENMENU_ROOT;
mi.pszName = LPGEN("Frames");
mi.pszService = 0;
MainMIRoot = Menu_AddMainMenuItem(&mi);
@@ -1495,7 +1461,7 @@ static int CLUIFramesLoadMainMenu()
mi.ptszName = Frames[i].TitleBar.tbname ? Frames[i].TitleBar.tbname : Frames[i].name;
mi.pszService = 0;
Frames[i].MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi);
- CLUIFramesCreateMenuForFrame(Frames[i].id, (int)Frames[i].MenuHandles.MainMenuItem, separator, Menu_AddMainMenuItem);
+ CLUIFramesCreateMenuForFrame(Frames[i].id, Frames[i].MenuHandles.MainMenuItem, separator, Menu_AddMainMenuItem);
CLUIFramesModifyMainMenuItems(Frames[i].id, 0);
//NotifyEventHooks(hPreBuildFrameMenuEvent,i,(LPARAM)Frames[i].MenuHandles.MainMenuItem);
CallService(MS_CLIST_FRAMEMENUNOTIFY, (WPARAM)Frames[i].id, (LPARAM)Frames[i].MenuHandles.MainMenuItem);
@@ -3089,7 +3055,7 @@ static int CLUIFrameOnModulesLoad(WPARAM, LPARAM)
hThreadMFUpdate = mir_forkthread(MF_UpdateThread, NULL);
SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_IDLE);
CLUIFramesLoadMainMenu();
- CLUIFramesCreateMenuForFrame(-1, -1, 000010000, Menu_AddContextFrameMenuItem);
+ CLUIFramesCreateMenuForFrame(-1, HGENMENU_ROOT, 000010000, Menu_AddContextFrameMenuItem);
return 0;
}
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index e9d4461e99..d0b08d00d2 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -383,7 +383,7 @@ int InitCustomMenus(void)
CLISTMENUITEM mi = { 0 };
mi.position = 200000;
- mi.pszPopupName = (char *)-1;
+ mi.hParentMenu = HGENMENU_ROOT;
mi.pszService = "CList/SetContactIgnore";
mi.icolibItem = iconItem[1].hIcolib;
mi.pszName = LPGEN("&Contact list settings...");
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp
index b7ce54db1b..1362e43908 100644
--- a/plugins/CrashDumper/src/crshdmp.cpp
+++ b/plugins/CrashDumper/src/crshdmp.cpp
@@ -261,11 +261,11 @@ static int ModulesLoaded(WPARAM, LPARAM)
mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR;
mi.icolibItem = GetIconHandle(IDI_VI);
mi.ptszName = LPGENT("Version Information");
- mi.pszPopupName = (char *)-1;
- HANDLE hMenuRoot = Menu_AddMainMenuItem(&mi);
+ mi.hParentMenu = HGENMENU_ROOT;
+ HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi);
mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR;
- mi.pszPopupName = (char *)hMenuRoot;
+ mi.hParentMenu = hMenuRoot;
mi.popupPosition = 0;
mi.position = 2000089995;
diff --git a/plugins/CyrTranslit/src/MirandaContact.cpp b/plugins/CyrTranslit/src/MirandaContact.cpp
index d7b32a9f8a..358b313ba6 100644
--- a/plugins/CyrTranslit/src/MirandaContact.cpp
+++ b/plugins/CyrTranslit/src/MirandaContact.cpp
@@ -65,14 +65,8 @@ void MirandaContact::addMenuItem()
{
CLISTMENUITEM mi = { 0 };
mi.pszName = MENU_ITEM_TEXT;
- mi.flags = 0;
mi.position = 65535;
- mi.hIcon = NULL;
mi.pszService = MENU_COMMAND_CALLBACK_SERVICE;
- mi.pszPopupName = NULL;
- mi.popupPosition = 0;
- mi.hotKey = 0;
- mi.pszContactOwner = NULL;
hTransliterateCmdMenuItem = Menu_AddContactMenuItem(&mi);
}
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 875c4e11e6..95ccdbc1d3 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -195,7 +195,7 @@ void RebuildMenu()
CLISTMENUITEM mi = { 0 };
mi.position = 100000 + i;
- mi.pszPopupName = (char *) hMainMenuGroup;
+ mi.hParentMenu = hMainMenuGroup;
mi.popupPosition = 500080000 + i;
mi.pszService = MS_LISTENINGTO_MAINMENU;
mi.ptszName = text;
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 1693a1490c..532736da54 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -992,7 +992,7 @@ static int PluginInit(WPARAM, LPARAM)
hmenuHide = Menu_AddContactMenuItem(&mi);
mi.position++;
- mi.pszPopupName = (char*)-1; // for Miranda 0.7
+ mi.hParentMenu = HGENMENU_ROOT;
mi.ptszName = LPGENT("Ignore");
mi.pszService = 0;
mi.flags |= CMIF_ROOTHANDLE;
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp
index 4f1162ba9b..63339b53b5 100644
--- a/plugins/MirLua/src/m_genmenu.cpp
+++ b/plugins/MirLua/src/m_genmenu.cpp
@@ -3,7 +3,6 @@
static CLISTMENUITEM* MakeMenuItem(lua_State *L)
{
CLISTMENUITEM *pmi = (CLISTMENUITEM*)mir_calloc(sizeof(CLISTMENUITEM));
- pmi->cbSize = sizeof(CLISTMENUITEM);
pmi->hLangpack = hScriptsLangpack;
lua_pushstring(L, "Flags");
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index e6c8f32234..8fe18b2ebe 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -650,7 +650,7 @@ int MirandaLoaded(WPARAM, LPARAM)
memset(&mi, 0, sizeof(mi));
mi.flags = CMIF_TCHAR | CMIF_ROOTPOPUP;
mi.hIcon = NULL;
- mi.pszPopupName = (char*)-1;
+ mi.hParentMenu = HGENMENU_ROOT;
mi.position = 1000020000;
mi.ptszName = LPGENT("Autoreply");
g_hToggleSOEContactMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index 085870dd16..5f1eb6be5b 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -43,7 +43,7 @@ static HGENMENU AddMenuItem(LPCSTR name, int pos, HICON hicon, LPCSTR service, i
mi.position = pos;
mi.hIcon = hicon;
mi.pszName = (char*)name;
- mi.pszPopupName = (char*)-1;
+ mi.hParentMenu = HGENMENU_ROOT;
mi.pszService = (char*)service;
return Menu_AddContactMenuItem(&mi);
}
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp
index 27d071f390..b658a5333d 100644
--- a/plugins/SmileyAdd/src/main.cpp
+++ b/plugins/SmileyAdd/src/main.cpp
@@ -55,7 +55,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
mi.popupPosition = 2000070050;
mi.position = 2000070050;
mi.icolibItem = icon.hIcolib;
- mi.pszPopupName = (char*)-1;
+ mi.hParentMenu = HGENMENU_ROOT;
mi.pszName = LPGEN("Assign smiley category");
hContactMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp
index f3b4f8d1d3..e4d8d73a5b 100644
--- a/plugins/WhenWasIt/src/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/src/WhenWasIt.cpp
@@ -27,14 +27,6 @@ HWND hUpcomingDlg = NULL;
MWindowList hAddBirthdayWndsList = NULL;
int hLangpack;
-HANDLE hmCheckBirthdays = NULL;
-HANDLE hmBirthdayList = NULL;
-HANDLE hmRefreshDetails = NULL;
-HANDLE hmAddChangeBirthday = NULL;
-HANDLE hmImportBirthdays = NULL;
-HANDLE hmExportBirthdays = NULL;
-
-
CommonData commonData = { 0 };
CLIST_INTERFACE *pcli;
@@ -87,35 +79,35 @@ extern "C" int __declspec(dllexport) Load(void)
cl.pszService = MS_WWI_CHECK_BIRTHDAYS;
cl.icolibItem = hCheckMenu;
cl.pszName = LPGEN("Check for birthdays");
- hmCheckBirthdays = Menu_AddMainMenuItem(&cl);
+ Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_LIST_SHOW;
cl.pszName = LPGEN("Birthday list");
cl.icolibItem = hListMenu;
- hmBirthdayList = Menu_AddMainMenuItem(&cl);
+ Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_REFRESH_USERDETAILS;
cl.position = 10100000;
cl.pszName = LPGEN("Refresh user details");
cl.icolibItem = hRefreshUserDetails;
- hmRefreshDetails = Menu_AddMainMenuItem(&cl);
+ Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_IMPORT_BIRTHDAYS;
cl.position = 10200000;
cl.pszName = LPGEN("Import birthdays");
cl.icolibItem = hImportBirthdays;
- hmImportBirthdays = Menu_AddMainMenuItem(&cl);
+ Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_EXPORT_BIRTHDAYS;
cl.pszName = LPGEN("Export birthdays");
cl.icolibItem = hExportBirthdays;
- hmExportBirthdays = Menu_AddMainMenuItem(&cl);
+ Menu_AddMainMenuItem(&cl);
cl.pszService = MS_WWI_ADD_BIRTHDAY;
cl.position = 10000000;
cl.icolibItem = hAddBirthdayContact;
cl.pszName = LPGEN("Add/change user &birthday");
- hmAddChangeBirthday = Menu_AddContactMenuItem(&cl);
+ Menu_AddContactMenuItem(&cl);
// Register hotkeys
HOTKEYDESC hotkey = { sizeof(hotkey) };
@@ -131,7 +123,6 @@ extern "C" int __declspec(dllexport) Load(void)
hotkey.pszService = MS_WWI_CHECK_BIRTHDAYS;
Hotkey_Register(&hotkey);
-
SkinAddNewSoundExT(BIRTHDAY_NEAR_SOUND, LPGENT("WhenWasIt"), LPGENT("Birthday near"));
SkinAddNewSoundExT(BIRTHDAY_TODAY_SOUND, LPGENT("WhenWasIt"), LPGENT("Birthday today"));
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index 5eb4e8d814..6083632b48 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -67,9 +67,6 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) :
CAimProto::~CAimProto()
{
- RemoveMainMenus();
- RemoveContactMenus();
-
if (hServerConn)
Netlib_CloseHandle(hServerConn);
if (hAvatarConn && hAvatarConn != (HANDLE)1)
diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h
index fc4b9b9c37..5ee46474c8 100644
--- a/protocols/AimOscar/src/proto.h
+++ b/protocols/AimOscar/src/proto.h
@@ -136,7 +136,6 @@ struct CAimProto : public PROTO<CAimProto>
HGENMENU hMenuRoot;
HGENMENU hHTMLAwayContextMenuItem;
HGENMENU hAddToServerListContextMenuItem;
- HGENMENU hReadProfileMenuItem;
HGENMENU hBlockContextMenuItem;
HGENMENU hMainMenu[3];
@@ -387,9 +386,7 @@ struct CAimProto : public PROTO<CAimProto>
void InitMainMenus(void);
void InitContactMenus(void);
- void RemoveMainMenus(void);
- void RemoveContactMenus(void);
-
+
//////////////////////////////////////////////////////////////////////////////////////
// thread.cpp
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index 71b3a3b620..c8b6ab7fd0 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -231,8 +231,10 @@ void CAimProto::InitMainMenus(void)
hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
- RemoveMainMenus();
- hMenuRoot = NULL;
+ if (hMenuRoot) {
+ CallService(MO_REMOVEMENUITEM, (WPARAM)hMenuRoot, 0);
+ hMenuRoot = NULL;
+ }
}
mi.pszService = service_name;
@@ -284,7 +286,7 @@ void CAimProto::InitContactMenus(void)
mi.icolibItem = GetIconHandle("profile");
mi.pszName = LPGEN("Read Profile");
mi.flags = CMIF_NOTOFFLINE;
- hReadProfileMenuItem = Menu_AddContactMenuItem(&mi);
+ Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, _countof(service_name), "%s%s", m_szModuleName, "/AddToServerList");
CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
@@ -302,17 +304,3 @@ void CAimProto::InitContactMenus(void)
mi.flags = CMIF_HIDDEN;
hBlockContextMenuItem = Menu_AddContactMenuItem(&mi);
}
-
-void CAimProto::RemoveMainMenus(void)
-{
- if (hMenuRoot)
- CallService(MO_REMOVEMENUITEM, (WPARAM)hMenuRoot, 0);
-}
-
-void CAimProto::RemoveContactMenus(void)
-{
- CallService(MO_REMOVEMENUITEM, (WPARAM)hHTMLAwayContextMenuItem, 0);
- CallService(MO_REMOVEMENUITEM, (WPARAM)hReadProfileMenuItem, 0);
- CallService(MO_REMOVEMENUITEM, (WPARAM)hAddToServerListContextMenuItem, 0);
- CallService(MO_REMOVEMENUITEM, (WPARAM)hBlockContextMenuItem, 0);
-}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 0f5f9633db..7282a96457 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -282,7 +282,7 @@ void g_MenuInit(void)
mi.pszService = "Jabber/DirectPresenceDummySvc";
mi.pszName = LPGEN("Send Presence");
mi.position = -1999901011;
- mi.pszPopupName = (char *)-1;
+ mi.hParentMenu = HGENMENU_ROOT;
mi.icolibItem = g_GetIconHandle(IDI_NOTES);
g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index 66e1d9c6ee..c0acd7d49d 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -264,7 +264,7 @@ void TlenProtocol::initMenuItems()
strncpy_s(text, sizeof(text), m_szModuleName, _TRUNCATE);
char *pSvcName = text + mir_strlen(text);
- CLISTMENUITEM mi = { 0 }, clmi = { sizeof(clmi) };
+ CLISTMENUITEM mi = { 0 }, clmi = { 0 };
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
mi.pszContactOwner = m_szModuleName;
@@ -280,7 +280,6 @@ void TlenProtocol::initMenuItems()
hMenuRoot = Menu_AddMainMenuItem(&mi);
mi.flags = CMIF_CHILDPOPUP;
- //mi.pszPopupName = (char *)hMenuRoot;
mi.hParentMenu = (HGENMENU)hMenuRoot;
hMenuChats = NULL;