diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 23:13:56 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 23:13:56 +0000 |
commit | 4810d4b1b7a47701b8e6c45490fb2643ea425123 (patch) | |
tree | fb94dd5889fdd0558605ffe738f0b2d6d2f08ca2 /plugins/Clist_modern/src | |
parent | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (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_modern/src')
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_cluiframes.h | 10 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistmenus.cpp | 15 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_cluiframes.cpp | 18 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_groupmenu.cpp | 61 |
4 files changed, 52 insertions, 52 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_cluiframes.h b/plugins/Clist_modern/src/hdr/modern_cluiframes.h index d10b828a17..f4cc677610 100644 --- a/plugins/Clist_modern/src/hdr/modern_cluiframes.h +++ b/plugins/Clist_modern/src/hdr/modern_cluiframes.h @@ -59,12 +59,10 @@ typedef struct struct FrameMenuHandles
{
- HANDLE MainMenuItem;
- HANDLE MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
- HANDLE MIAlignTop,MIAlignClient,MIAlignBottom;
- HANDLE MIBorder;
- HANDLE MIPosRoot;
- HANDLE MIPosUp,MIPosDown;
+ HGENMENU MainMenuItem;
+ HGENMENU MIVisible,MITitle,MITBVisible,MILock,MIColl,MIFloating,MIAlignRoot;
+ HGENMENU MIAlignTop,MIAlignClient,MIAlignBottom;
+ HGENMENU MIBorder, MIPosRoot, MIPosUp, MIPosDown;
};
struct FrameTitleBar
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 444fc233b3..42a1d0b016 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -67,9 +67,10 @@ void UninitCustomMenus(void) #define CLUI_FAVSETRATE "CLUI/SetContactRate" //LParam is rate, Wparam is contact handle
#define CLUI_FAVTOGGLESHOWOFFLINE "CLUI/ToggleContactShowOffline"
-static HGENMENU hFavoriteContactMenu = NULL;
-static HANDLE *hFavoriteContactMenuItems = NULL;
-static HANDLE hShowIfOflineItem = NULL;
+static HGENMENU hFavoriteContactMenu = NULL;
+static HGENMENU *hFavoriteContactMenuItems = NULL;
+
+static HGENMENU hShowIfOflineItem = NULL;
static HANDLE hOnContactMenuBuild_FAV = NULL;
static TCHAR * FAVMENUROOTNAME = LPGENT("&Contact rate");
@@ -114,7 +115,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
else {
mi.flags |= CMIM_FLAGS | CMIM_NAME;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hFavoriteContactMenu, (LPARAM)&mi);
+ Menu_ModifyItem(hFavoriteContactMenu, &mi);
bModifyMenu = TRUE;
}
@@ -126,7 +127,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) mi.hParentMenu = hFavoriteContactMenu;
if ( !hFavoriteContactMenuItems) {
- hFavoriteContactMenuItems = (HANDLE*)malloc(sizeof(HANDLE)*SIZEOF(rates));
+ hFavoriteContactMenuItems = (HGENMENU*)malloc(sizeof(HANDLE)*SIZEOF(rates));
memset(hFavoriteContactMenuItems, 0, sizeof(HANDLE)*SIZEOF(rates));
}
@@ -139,7 +140,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) mi.popupPosition = i;
if (bModifyMenu && hFavoriteContactMenuItems[i]) {
mi.flags |= CMIM_FLAGS | CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenuItems[i], (LPARAM)&mi);
+ Menu_ModifyItem(hFavoriteContactMenuItems[i], &mi);
}
else hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
}
@@ -152,7 +153,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) mi.position = -100000000;
if (bModifyMenu && hShowIfOflineItem) {
mi.flags |= CMIM_FLAGS | CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hShowIfOflineItem, (LPARAM)&mi);
+ Menu_ModifyItem(hShowIfOflineItem, &mi);
}
else hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp index ff162fc7f7..1f0bdb8beb 100644 --- a/plugins/Clist_modern/src/modern_cluiframes.cpp +++ b/plugins/Clist_modern/src/modern_cluiframes.cpp @@ -1055,42 +1055,42 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam) mi.flags = CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
if (g_pfwFrames[pos].visible) mi.flags |= CMIF_CHECKED;
mi.ptszName = g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIVisible,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIVisible, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].Locked) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MILock,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MILock, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MITBVisible,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MITBVisible, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].floating) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIFloating,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIFloating, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if ( g_CluiData.fLayered ) mi.flags |= CMIF_GRAYED;
else if ((g_pfwFrames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIBorder,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIBorder, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
if (g_pfwFrames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignTop,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIAlignTop, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignClient,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIAlignClient, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
if (g_pfwFrames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignBottom,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIAlignBottom, &mi);
mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
if (g_pfwFrames[pos].collapsed) mi.flags |= CMIF_CHECKED;
if ((!g_pfwFrames[pos].visible) || g_pfwFrames[pos].Locked || (pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIColl,(LPARAM)&mi);
+ Menu_ModifyItem(g_pfwFrames[pos].MenuHandles.MIColl, &mi);
}
return 0;
diff --git a/plugins/Clist_modern/src/modern_groupmenu.cpp b/plugins/Clist_modern/src/modern_groupmenu.cpp index df63d36e8f..ab78f0f0b6 100644 --- a/plugins/Clist_modern/src/modern_groupmenu.cpp +++ b/plugins/Clist_modern/src/modern_groupmenu.cpp @@ -28,16 +28,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //////////////////////////////Group MENU/////////////////////////
HANDLE hGroupMenuObject;
-HANDLE hGroupMainMenuItemProxy;
-HANDLE hHideShowMainMenuItem;
-HANDLE hGroupStatusMenuItemProxy;
+HGENMENU hGroupMainMenuItemProxy;
+HGENMENU hHideShowMainMenuItem;
+HGENMENU hGroupStatusMenuItemProxy;
-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;
@@ -209,16 +210,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;
}
@@ -235,8 +236,8 @@ int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam) CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_ICON;
clmi.hIcon = ske_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;
}
@@ -302,7 +303,7 @@ void GroupMenus_Init(void) mi.pszService = MS_CLIST_SHOWHIDE;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.pszName = LPGEN("&Hide/Show");
- hHideShowMainMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 200000;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
@@ -314,13 +315,13 @@ void GroupMenus_Init(void) mi.pszService = "";
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
mi.pszName = LPGEN("&Main Menu");
- hGroupMainMenuItemProxy = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 300100;
mi.pszService = "";
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
mi.pszName = LPGEN("&Status");
- hGroupStatusMenuItemProxy = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 400000;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
@@ -339,7 +340,7 @@ void GroupMenus_Init(void) mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
mi.pszName = LPGEN("&New Group");
- hNewGroupMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
mi.position = 100001;
@@ -347,22 +348,22 @@ void GroupMenus_Init(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);
mi.position = 100002;
mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
mi.pszName = LPGEN("Hide &Offline Users out here");
- hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 100003;
mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
mi.pszName = LPGEN("Hide &Empty Groups");
- hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem(0, (LPARAM)&mi);
+ hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 100004;
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);
}
@@ -374,8 +375,8 @@ HANDLE hSubGroupMenuObject; HANDLE hSubGroupMainMenuItemProxy;
HANDLE hSubGroupStatusMenuItemProxy;
-HANDLE hHideOfflineUsersHereMenuItem;
-HANDLE hShowOfflineUsersHereMenuItem;
+
+HGENMENU hHideOfflineUsersHereMenuItem, hShowOfflineUsersHereMenuItem;
//SubGroupmenu exec param(ownerdata)
typedef struct{
@@ -413,10 +414,10 @@ static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam) CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | ((group->hideOffline && !gray1)?CMIF_CHECKED:0)| (gray1?CMIF_GRAYED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
mi.flags = CMIM_FLAGS | ((showOfflineinGroup && !gray2) ? CMIF_CHECKED:0)| (gray2?CMIF_GRAYED:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowOfflineUsersHereMenuItem, (LPARAM)&mi);
+ Menu_ModifyItem(hShowOfflineUsersHereMenuItem, &mi);
return 0;
}
@@ -586,7 +587,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);
DestroyIcon_protect(mi.hIcon);
mi.position = 1001;
@@ -595,7 +596,7 @@ void InitSubGroupMenus(void) 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);
mi.position = 1002;
mi.hIcon = NULL;
@@ -603,7 +604,7 @@ void InitSubGroupMenus(void) mi.pszName = LPGEN("&Show Offline Users in here");
gmp.lParam = 0;
gmp.wParam = POPUP_GROUPSHOWOFFLINE;
- hShowOfflineUsersHereMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ hShowOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
|