summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw/src/CLUIFrames
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-16 16:07:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-16 16:07:54 +0000
commit3abd733254c02e2ca2c9bcc7fbbd1417c4a8ff74 (patch)
treef797b88d7a3c6993d447ac35b240a20fee4186b7 /plugins/Clist_mw/src/CLUIFrames
parentcaf5e0116248d00c0b6beaed6e4e7817a0158fbb (diff)
- 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
Diffstat (limited to 'plugins/Clist_mw/src/CLUIFrames')
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp11
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.h9
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp98
3 files changed, 16 insertions, 102 deletions
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
index 5374b67ae1..a624ec563f 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
@@ -36,11 +36,9 @@ extern HINSTANCE g_hInst;
#define frame_menu_visible 2
#define frame_menu_showtitlebar 3
#define frame_menu_floating 4
-extern int ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam);
static int UpdateTBToolTip(int framepos);
INT_PTR CLUIFrameSetFloat(WPARAM wParam,LPARAM lParam);
int CLUIFrameResizeFloatingFrame(int framepos);
-extern int ProcessCommandProxy(WPARAM wParam,LPARAM lParam);
extern int InitFramesMenus(void);
int GapBetweenTitlebar;
@@ -796,7 +794,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*
INT_PTR ModifyMItem(WPARAM wParam,LPARAM lParam)
{
- return ModifyMenuItemProxy(wParam,lParam);
+ return CallService(MS_CLIST_MODIFYMENUITEM, wParam, lParam);
}
static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
@@ -2168,13 +2166,10 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return 0;
case WM_COMMAND:
- if ( ServiceExists(MO_CREATENEWMENUOBJECT)) {
- if (ProcessCommandProxy(MAKEWPARAM(LOWORD(wParam),0),(LPARAM)Frameid)) break;
- }
- else if ( CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wParam),MPCF_CONTEXTFRAMEMENU),(LPARAM)Frameid))
+ if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam),0), Frameid))
break;
- if (HIWORD(wParam) == 0) {//mouse events for self created menu
+ if (HIWORD(wParam) == 0) { //mouse events for self created menu
int framepos = id2pos(Frameid);
if (framepos == -1)
break;
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.h b/plugins/Clist_mw/src/CLUIFrames/cluiframes.h
index 6430c6655d..d36dff07da 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.h
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.h
@@ -33,12 +33,3 @@ typedef struct tagProtocolData {
#define CLUIFrameTitleBarClassName _T("CLUIFrameTitleBar")
#define CLUIFrameModule "CLUIFrames"
-
-//integrated menu module
-#define MS_INT_MENUMEASUREITEM "CLUIFrames/IntMenuMeasureItem"
-#define MS_INT_MENUDRAWITEM "CLUIFrames/IntMenuDrawItem"
-#define MS_INT_MENUPROCESSCOMMAND "CLUIFrames/IntMenuProcessCommand"
-#define MS_INT_MODIFYMENUITEM "CLUIFrames/IntModifyMenuItem"
-
-
-
diff --git a/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp
index f850143c20..4e94c8b75f 100644
--- a/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp
@@ -127,93 +127,21 @@ static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam)
}
// == == == == == == == == == == == == == Frames end
-boolean InternalGenMenuModule = FALSE;
-
-int MeasureItemProxy(WPARAM wParam,LPARAM lParam)
-{
- int val;
- if (InternalGenMenuModule)
- {
- val = CallService(MS_INT_MENUMEASUREITEM,wParam,lParam);
- if (val) return(val);
- }
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
-}
-
-int DrawItemProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MENUDRAWITEM,wParam,lParam);
- if (val) return(val);
- }
- return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
-}
-
-int ProcessCommandProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MENUPROCESSCOMMAND,wParam,lParam);
- if (val) return(val);
- }
-
- return CallService(MS_CLIST_MENUPROCESSCOMMAND,wParam,lParam);
-
-}
-
-int ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam)
-{
- if (InternalGenMenuModule)
- {
- int val;
- val = CallService(MS_INT_MODIFYMENUITEM,wParam,lParam);
- if (val) return(val);
- }
-
- return CallService(MS_CLIST_MODIFYMENUITEM,wParam,lParam);
-}
int InitFramesMenus(void)
{
- TMenuParam tmp;
-
- if ( !ServiceExists(MO_REMOVEMENUOBJECT))
- {
-
- InitCustomMenus();
- InternalGenMenuModule = TRUE;
- }
-
- if (ServiceExists(MO_REMOVEMENUOBJECT))
- {
- CreateServiceFunction("FrameMenuExecService",FrameMenuExecService);
- CreateServiceFunction("FrameMenuCheckService",FrameMenuCheckService);
- CreateServiceFunction("FrameMenuFreeService",FreeOwnerDataFrameMenu);
-
-
- CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM,RemoveContextFrameMenuItem);
- CreateServiceFunction("CList/AddContextFrameMenuItem",AddContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT,BuildContextFrameMenu);
- CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY,ContextFrameMenuNotify);
- hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
-
- //frame menu object
- memset(&tmp,0,sizeof(tmp));
- tmp.cbSize = sizeof(tmp);
- tmp.CheckService = "FrameMenuCheckService";
- tmp.ExecService = "FrameMenuExecService";
- tmp.name = "FrameMenu";
- hFrameMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
- {
- OptParam op;
- op.Handle = hFrameMenuObject;
- op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value = (INT_PTR)"FrameMenuFreeService";
- CallService(MO_SETOPTIONSMENUOBJECT,0,(LPARAM)&op);
- }
- }
+ CreateServiceFunction("FrameMenuExecService", FrameMenuExecService);
+ CreateServiceFunction("FrameMenuCheckService", FrameMenuCheckService);
+ CreateServiceFunction("FrameMenuFreeService", FreeOwnerDataFrameMenu);
+
+ CreateServiceFunction(MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, RemoveContextFrameMenuItem);
+ CreateServiceFunction("CList/AddContextFrameMenuItem", AddContextFrameMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT, BuildContextFrameMenu);
+ CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY, ContextFrameMenuNotify);
+ hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
+
+ // frame menu object
+ hFrameMenuObject = MO_CreateMenuObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
+ MO_SetMenuObjectParam(hFrameMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "FrameMenuFreeService");
return 0;
}