From b61df7acc1235b3b2a66217d0d7358199c5d37f9 Mon Sep 17 00:00:00 2001 From: sje Date: Wed, 1 Nov 2006 14:44:17 +0000 Subject: git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@11 4f64403b-2f21-0410-a795-97e2b3489a10 --- ping/menu.cpp | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 ping/menu.cpp (limited to 'ping/menu.cpp') diff --git a/ping/menu.cpp b/ping/menu.cpp new file mode 100644 index 0000000..7d87b13 --- /dev/null +++ b/ping/menu.cpp @@ -0,0 +1,100 @@ +#include "common.h" +#include "menu.h" + +HANDLE hMenuDisable, hMenuGraph, hMenuEdit; +HANDLE hEventMenuBuild; + +/* +int MenuBuild(WPARAM wParam, LPARAM lParam) { + CLISTMENUITEM menu; + ZeroMemory(&menu,sizeof(menu)); + menu.cbSize=sizeof(menu); + + menu.flags = CMIM_NAME | CMIM_ICON; + bool disable = DBGetContactSettingWord((HANDLE)wParam, PLUG, "Status", ID_STATUS_OFFLINE) != options.off_status; + if(disable) { + menu.hIcon = hIconDisabled; + menu.pszName = Translate("Disable"); + } else { + menu.hIcon = hIconEnabled; + menu.pszName = Translate("Enable"); + } + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDisable, (LPARAM)&menu); + + // hide graph menu item if window displayed + //menu.flags = CMIM_FLAGS | (DBGetContactSettingDword((HANDLE)wParam, PLUG, "WindowHandle", 0) == 0 ? 0 : CMIF_HIDDEN); + //CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuGraph, (LPARAM)&menu); + + return 0; +} +*/ + +void InitMenus() { + + CLISTMENUITEM menu; + ZeroMemory(&menu,sizeof(menu)); + menu.cbSize=sizeof(menu); + + // main menu + menu.flags = 0; + menu.popupPosition = 500099900; + menu.pszPopupName = Translate( "PING" ); + menu.cbSize = sizeof( menu ); + menu.position = 2000060000; + menu.hIcon = hIconResponding; + menu.pszName = Translate( "Enable All Pings" ); + menu.pszService = PLUG "/EnableAll"; + CallService( MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu ); + + menu.flags = 0; + menu.popupPosition = 500299901; + menu.pszPopupName = Translate( "PING" ); + menu.cbSize = sizeof( menu ); + menu.position = 2000060001; + menu.popupPosition = 0; + menu.hIcon = hIconDisabled; + menu.pszName = Translate( "Disable All Pings" ); + menu.pszService = PLUG "/DisableAll"; + CallService( MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu ); + + /* + // list items + menu.flags = 0; + menu.popupPosition = 0; + menu.pszPopupName = 0; + menu.cbSize = sizeof( menu ); + menu.position =-300100; + //menu.popupPosition = 0; + menu.hIcon = hIconDisabled; + menu.pszName = Translate( "Disable" ); + menu.pszService = PLUG "/ToggleEnabled"; + menu.pszContactOwner = PLUG; + hMenuDisable = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu ); + + menu.flags = 0; + menu.popupPosition = 0; + menu.pszPopupName = 0; + menu.cbSize = sizeof( menu ); + menu.position =-300090; + //menu.popupPosition = 0; + menu.hIcon = hIconResponding + menu.pszName = Translate( "Graph" ); + menu.pszService = PLUG "/ShowGraph"; + menu.pszContactOwner = PLUG; + hMenuGraph = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu ); + + menu.flags = 0; + menu.popupPosition = 0; + menu.pszPopupName = 0; + menu.cbSize = sizeof( menu ); + menu.position =-300080; + //menu.popupPosition = 0; + menu.hIcon = hIconResponding; + menu.pszName = Translate( "Edit..." ); + menu.pszService = PLUG "/Edit"; + menu.pszContactOwner = PLUG; + hMenuGraph = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&menu ); + + hEventMenuBuild = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MenuBuild); + */ +} -- cgit v1.2.3