summaryrefslogtreecommitdiff
path: root/plugins/Ping/src/menu.cpp
blob: dbec0a3447b97a3a0c3c71d5ff32317d4d6c3e92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#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 = CMIF_TCHAR;
	menu.popupPosition = 500099900;
	menu.ptszPopupName = LPGENT("PING");
	menu.cbSize = sizeof( menu );
	menu.position = 2000060000;
	menu.hIcon = hIconResponding;
	menu.ptszName = LPGENT("Enable All Pings");
	menu.pszService = PLUG "/EnableAll";
	Menu_AddMainMenuItem(&menu);

	menu.popupPosition = 500299901;
	menu.cbSize = sizeof( menu );
	menu.position = 2000060001;
	menu.popupPosition = 0;
	menu.hIcon = hIconDisabled;
	menu.ptszName = LPGENT("Disable All Pings");
	menu.pszService = PLUG "/DisableAll";
	Menu_AddMainMenuItem(&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);
	*/
}