summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 23:13:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 23:13:56 +0000
commit4810d4b1b7a47701b8e6c45490fb2643ea425123 (patch)
treefb94dd5889fdd0558605ffe738f0b2d6d2f08ca2 /plugins/Clist_mw
parent007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (diff)
rest of menu cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4325 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw')
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp29
-rw-r--r--plugins/Clist_mw/src/groupmenu.cpp44
2 files changed, 32 insertions, 41 deletions
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
index 498dc2e896..4441022cfa 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
@@ -77,10 +77,9 @@ static int sortfunc(const void *a,const void *b)
#define CLUIFRAMESMOVEUPDOWN "CLUIFramesMoveUpDown"
typedef struct tagMenuHandles
{
- HANDLE MainMenuItem;
- HANDLE MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
- HANDLE MIAlignTop,MIAlignClient,MIAlignBottom;
- HANDLE MIBorder;
+ HGENMENU MainMenuItem;
+ HGENMENU MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
+ HGENMENU MIAlignTop,MIAlignClient,MIAlignBottom,MIBorder;
} FrameMenuHandles;
typedef struct tagFrameTitleBar{
@@ -632,7 +631,7 @@ int CLUIFramesGetalClientFrame(void)
HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
- HANDLE menuid;
+ HGENMENU menuid;
int framepos = id2pos(frameid);
CLISTMENUITEM mi = { sizeof(mi) };
@@ -864,44 +863,44 @@ INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MITitle,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MITitle, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].visible) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIVisible,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIVisible, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].Locked) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MILock,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MILock, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MITBVisible,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MITBVisible, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].floating) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIFloating,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIFloating, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if ((Frames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIBorder,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIBorder, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
if (Frames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignTop,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignTop, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignClient,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignClient, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
if (Frames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIAlignBottom,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIAlignBottom, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (Frames[pos].collapsed) mi.flags |= CMIF_CHECKED;
if ((!Frames[pos].visible)||Frames[pos].Locked||(pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MIColl,(LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MIColl, &mi);
}
ulockfrm();
return 0;
diff --git a/plugins/Clist_mw/src/groupmenu.cpp b/plugins/Clist_mw/src/groupmenu.cpp
index 118d66a463..121f166b26 100644
--- a/plugins/Clist_mw/src/groupmenu.cpp
+++ b/plugins/Clist_mw/src/groupmenu.cpp
@@ -34,12 +34,8 @@ HANDLE hGroupMainMenuItemProxy;
HANDLE hGroupStatusMenuItemProxy;
HANDLE hPreBuildGroupMenuEvent;
-HANDLE hHideOfflineUsersMenuItem;
-HANDLE hHideOfflineUsersOutHereMenuItem;
-HANDLE hHideEmptyGroupsMenuItem;
-HANDLE hDisableGroupsMenuItem;
-HANDLE hNewGroupMenuItem;
-HANDLE hNewSubGroupMenuItem;
+HGENMENU hHideOfflineUsersMenuItem, hHideOfflineUsersOutHereMenuItem, hHideEmptyGroupsMenuItem;
+HGENMENU hDisableGroupsMenuItem, hNewGroupMenuItem, hNewSubGroupMenuItem;
int NewGroupIconidx;
@@ -211,16 +207,16 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | ( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersMenuItem, &mi);
mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT,0,0)?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersOutHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, &mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideEmptyGroupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideEmptyGroupsMenuItem, &mi);
mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDisableGroupsMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hDisableGroupsMenuItem, &mi);
return 0;
}
@@ -232,8 +228,8 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON;
mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewSubGroupMenuItem,(LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewGroupMenuItem,(LPARAM)&mi);
+ Menu_ModifyItem(hNewSubGroupMenuItem, &mi);
+ Menu_ModifyItem(hNewGroupMenuItem, &mi);
return 0;
}
@@ -334,7 +330,6 @@ void InitGroupMenus(void)
AddGroupMenuItem(0,(LPARAM)&mi);
-
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 500000;
@@ -350,7 +345,7 @@ void InitGroupMenus(void)
mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
mi.pszService = MS_CLIST_GROUPCREATE;
mi.pszName = LPGEN("&New Group");
- hNewGroupMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -359,7 +354,7 @@ void InitGroupMenus(void)
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.pszName = LPGEN("&Hide Offline Users");
gmp.lParam = 0;gmp.wParam = -1;
- hHideOfflineUsersMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -367,8 +362,7 @@ void InitGroupMenus(void)
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
mi.pszName = LPGEN("Hide &Offline Users out here");
- hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
+ hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -376,9 +370,7 @@ void InitGroupMenus(void)
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
mi.pszName = LPGEN("Hide &Empty Groups");
- hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
-
+ hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -386,8 +378,7 @@ void InitGroupMenus(void)
mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
mi.pszName = LPGEN("Disable &Groups");
- hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
-
+ hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
@@ -407,7 +398,8 @@ HANDLE hSubGroupMenuObject;
HANDLE hSubGroupMainMenuItemProxy;
HANDLE hSubGroupStatusMenuItemProxy;
HANDLE hPreBuildSubGroupMenuEvent;
-HANDLE hHideOfflineUsersHereMenuItem;
+
+HGENMENU hHideOfflineUsersHereMenuItem;
//SubGroupmenu exec param(ownerdata)
typedef struct{
@@ -433,7 +425,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
//contact->group
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (group->hideOffline?CMIF_CHECKED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
return 0;
}
@@ -590,7 +582,7 @@ void InitSubGroupMenus(void)
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&New SubGroup");
gmp.lParam = 0;gmp.wParam = POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);
@@ -599,7 +591,7 @@ void InitSubGroupMenus(void)
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&Hide Offline Users in here");
gmp.lParam = 0;gmp.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize = sizeof(mi);