From 3abd733254c02e2ca2c9bcc7fbbd1417c4a8ff74 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 16 Dec 2013 16:07:54 +0000 Subject: - new menu object helpers (MO_CreateMenuObject, MO_SetMenuObjectParam); - menu item display names are now translatable; - old nasty pieces of junk removed in CLUIFrames/cluiframes.cpp git-svn-id: http://svn.miranda-ng.org/main/trunk@7247 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_mw/src/clisttray.cpp | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'plugins/Clist_mw/src/clisttray.cpp') diff --git a/plugins/Clist_mw/src/clisttray.cpp b/plugins/Clist_mw/src/clisttray.cpp index de61524292..ddfcb22811 100644 --- a/plugins/Clist_mw/src/clisttray.cpp +++ b/plugins/Clist_mw/src/clisttray.cpp @@ -192,16 +192,11 @@ INT_PTR FreeOwnerDataTrayMenu (WPARAM wParam,LPARAM lParam) void InitTrayMenus(void) { - TMenuParam tmp; - OptParam op; - //Tray menu - memset(&tmp,0,sizeof(tmp)); - tmp.cbSize = sizeof(tmp); - tmp.CheckService = NULL; - tmp.ExecService = "CLISTMENUSTRAY/ExecService"; - tmp.name = "TrayMenu"; - hTrayMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp); + hTrayMenuObject = MO_CreateMenuObject("TrayMenu", LPGEN("Tray menu"), 0, "CLISTMENUSTRAY/ExecService"); + MO_SetMenuObjectParam(hTrayMenuObject, OPT_USERDEFINEDITEMS, TRUE); + MO_SetMenuObjectParam(hTrayMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSTRAY/FreeOwnerDataTrayMenu"); + MO_SetMenuObjectParam(hTrayMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSTRAY/TrayMenuonAddService"); CreateServiceFunction("CLISTMENUSTRAY/ExecService",TrayMenuExecService); CreateServiceFunction("CLISTMENUSTRAY/FreeOwnerDataTrayMenu",FreeOwnerDataTrayMenu); @@ -212,21 +207,6 @@ void InitTrayMenus(void) CreateServiceFunction(MS_CLIST_MENUBUILDTRAY,BuildTrayMenu); hPreBuildTrayMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU); - op.Handle = hTrayMenuObject; - op.Setting = OPT_USERDEFINEDITEMS; - op.Value = TRUE; - CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op); - - op.Handle = hTrayMenuObject; - op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE; - op.Value = (INT_PTR)"CLISTMENUSTRAY/FreeOwnerDataTrayMenu"; - CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op); - - op.Handle = hTrayMenuObject; - op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE; - op.Value = (INT_PTR)"CLISTMENUSTRAY/TrayMenuonAddService"; - CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op); - //add exit command to menu CLISTMENUITEM mi = { sizeof(mi) }; mi.position = 900000; -- cgit v1.2.3