summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src
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_nicer/src
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_nicer/src')
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp24
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.h7
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp73
3 files changed, 49 insertions, 55 deletions
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index 0eb0752233..052ef37f2d 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -636,7 +636,7 @@ int CLUIFramesGetalClientFrame(void)
HMENU CLUIFramesCreateMenuForFrame(int frameid, int root, int popuppos, HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
- HANDLE menuid;
+ HGENMENU menuid;
int framepos = id2pos(frameid);
if (FramesSysNotStarted)
@@ -902,48 +902,48 @@ 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;
if ((Frames[pos].Skinned)) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)Frames[pos].MenuHandles.MISkinned, (LPARAM)&mi);
+ Menu_ModifyItem(Frames[pos].MenuHandles.MISkinned, &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_nicer/src/CLUIFrames/cluiframes.h b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
index 083066ca6d..60caca8ab8 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.h
@@ -49,10 +49,9 @@ typedef struct _DockOpt {
DockOpt;
typedef struct tagMenuHandles {
- HANDLE MainMenuItem;
- HANDLE MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
- HANDLE MIAlignTop,MIAlignClient,MIAlignBottom;
- HANDLE MIBorder, MISkinned;
+ HGENMENU MainMenuItem;
+ HGENMENU MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
+ HGENMENU MIAlignTop,MIAlignClient,MIAlignBottom,MIBorder,MISkinned;
} FrameMenuHandles;
typedef struct tagFrameTitleBar {
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
index 7e3e32361d..fd261b6f6a 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp
@@ -24,22 +24,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////Group MENU/////////////////////////
HANDLE hGroupMenuObject;
-
-HANDLE hGroupMainMenuItemProxy;
-HANDLE hHideShowMainMenuItem;
-HANDLE hGroupStatusMenuItemProxy;
HANDLE hPreBuildGroupMenuEvent;
-HANDLE hAppearanceMenuItemProxy;
-HANDLE hEventAreaMenuItemProxy;
+
+HGENMENU hGroupMainMenuItemProxy;
+HGENMENU hHideShowMainMenuItem;
+HGENMENU hGroupStatusMenuItemProxy;
+HGENMENU hAppearanceMenuItemProxy;
+HGENMENU hEventAreaMenuItemProxy;
static HMENU hMenuOldContext;
-HANDLE hHideOfflineUsersMenuItem;
-HANDLE hHideOfflineUsersOutHereMenuItem;
-HANDLE hHideEmptyGroupsMenuItem;
-HANDLE hDisableGroupsMenuItem;
-HANDLE hNewGroupMenuItem;
-HANDLE hNewSubGroupMenuItem;
+HGENMENU hHideOfflineUsersMenuItem;
+HGENMENU hHideOfflineUsersOutHereMenuItem;
+HGENMENU hHideEmptyGroupsMenuItem;
+HGENMENU hDisableGroupsMenuItem;
+HGENMENU hNewGroupMenuItem;
+HGENMENU hNewSubGroupMenuItem;
int NewGroupIconidx;
@@ -220,22 +220,22 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | (cfg::getByte("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);
mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hGroupMainMenuItemProxy, (LPARAM)&mi);
+ Menu_ModifyItem(hGroupMainMenuItemProxy, &mi);
mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAppearanceMenuItemProxy, (LPARAM)&mi);
+ Menu_ModifyItem(hAppearanceMenuItemProxy, &mi);
return 0;
}
@@ -244,8 +244,8 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON;
clmi.hIcon = ImageList_GetIcon(hCListImages, NewGroupIconidx, 0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hNewSubGroupMenuItem, (LPARAM)&clmi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hNewGroupMenuItem, (LPARAM)&clmi);
+ Menu_ModifyItem(hNewSubGroupMenuItem, &clmi);
+ Menu_ModifyItem(hNewGroupMenuItem, &clmi);
return 0;
}
@@ -266,7 +266,7 @@ void InitGroupMenus(void)
CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
- hPreBuildGroupMenuEvent=CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
+ hPreBuildGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
HookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);
InitSubGroupMenus();
@@ -310,7 +310,7 @@ void InitGroupMenus(void)
mi.position=500;
mi.pszService=MS_CLIST_SHOWHIDE;
mi.pszName=LPGEN("&Hide/Show");
- hHideShowMainMenuItem=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -326,21 +326,21 @@ void InitGroupMenus(void)
mi.position=300000;
mi.pszService="";
mi.pszName=LPGEN("&Main Menu");
- hGroupMainMenuItemProxy=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=300100;
mi.pszService="";
mi.pszName=LPGEN("&Status");
- hGroupStatusMenuItemProxy=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=390100;
mi.pszService="";
mi.pszName=LPGEN("Appearance");
- hAppearanceMenuItemProxy=(HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);
+ hAppearanceMenuItemProxy = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -371,7 +371,7 @@ void InitGroupMenus(void)
//mi.pszService="CLISTMENUSGroup/ExecService";
mi.pszName=LPGEN("&New Group");
gmp.lParam=0;gmp.wParam=POPUP_NEWGROUP;
- hNewGroupMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
mi.cbSize=sizeof(mi);
@@ -380,7 +380,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);
@@ -388,8 +388,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);
@@ -397,9 +396,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);
@@ -407,8 +404,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);
//MS_CLIST_GROUPCREATE
@@ -421,7 +417,7 @@ HANDLE hSubGroupMainMenuItemProxy;
//HANDLE hHideShowMainMenuItem;
HANDLE hSubGroupStatusMenuItemProxy;
HANDLE hPreBuildSubGroupMenuEvent;
-HANDLE hHideOfflineUsersHereMenuItem;
+HGENMENU hHideOfflineUsersHereMenuItem;
//SubGroupmenu exec param(ownerdata)
typedef struct {
@@ -448,8 +444,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;
}
@@ -628,7 +623,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);
@@ -637,7 +632,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);