diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-26 18:21:10 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-26 18:21:10 +0000 |
commit | 68924bfc1a213e619563c2cffb6d44b5b5346f6d (patch) | |
tree | 139f501b225080e4f895dbd40083df5956c3e339 /plugins/Clist_nicer | |
parent | b7a7d90f054d48dfda64e8a11d4f5cbb3fe2a521 (diff) |
next slice of cutting out unused menu features - popupPosition
git-svn-id: http://svn.miranda-ng.org/main/trunk@14400 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r-- | plugins/Clist_nicer/clist_nicer_10.vcxproj | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/clist_nicer_10.vcxproj.filters | 3 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp | 9 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp | 112 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp | 76 |
5 files changed, 28 insertions, 173 deletions
diff --git a/plugins/Clist_nicer/clist_nicer_10.vcxproj b/plugins/Clist_nicer/clist_nicer_10.vcxproj index 3ecc98f72c..1ec643fc74 100644 --- a/plugins/Clist_nicer/clist_nicer_10.vcxproj +++ b/plugins/Clist_nicer/clist_nicer_10.vcxproj @@ -189,7 +189,6 @@ </ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\CLUIFrames\cluiframes.cpp" />
- <ClCompile Include="src\CLUIFrames\framesmenu.cpp" />
<ClCompile Include="src\CLUIFrames\groupmenu.cpp" />
<ClCompile Include="src\Coolsb\coolsblib.cpp" />
<ClCompile Include="src\Coolsb\coolscroll.cpp" />
diff --git a/plugins/Clist_nicer/clist_nicer_10.vcxproj.filters b/plugins/Clist_nicer/clist_nicer_10.vcxproj.filters index 6d4ffdcf72..29bb3c0e63 100644 --- a/plugins/Clist_nicer/clist_nicer_10.vcxproj.filters +++ b/plugins/Clist_nicer/clist_nicer_10.vcxproj.filters @@ -105,9 +105,6 @@ <ClCompile Include="src\CLUIFrames\cluiframes.cpp">
<Filter>Source Files\CLUIFrames</Filter>
</ClCompile>
- <ClCompile Include="src\CLUIFrames\framesmenu.cpp">
- <Filter>Source Files\CLUIFrames</Filter>
- </ClCompile>
<ClCompile Include="src\CLUIFrames\groupmenu.cpp">
<Filter>Source Files\CLUIFrames</Filter>
</ClCompile>
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index 6591280c40..298addb76f 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -36,9 +36,6 @@ void MF_UpdateThread(LPVOID); HANDLE hStatusBarShowToolTipEvent, hStatusBarHideToolTipEvent; HANDLE g_hEventThread = 0; -//not needed,now use MS_CLIST_FRAMEMENUNOTIFY service -//HANDLE hPreBuildFrameMenuEvent;//external event from clistmenus - LOGFONT TitleBarLogFont = {0}; extern HINSTANCE g_hInst; @@ -59,7 +56,6 @@ extern HINSTANCE g_hInst; static int UpdateTBToolTip(int framepos); INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam); int CLUIFrameResizeFloatingFrame(int framepos); -extern int InitFramesMenus(void); static int CLUIFramesReSort(); boolean FramesSysNotStarted = TRUE; @@ -577,8 +573,6 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGE FrameMenuHandles &fmh = (frameid == -1) ? cont : Frames[framepos].MenuHandles; CLISTMENUITEM mi = { 0 }; - mi.popupPosition = frameid; - mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA); mi.hParentMenu = root; mi.position = popuppos++; @@ -673,7 +667,6 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, HGE // position root mi.hParentMenu = root; - mi.popupPosition = frameid; mi.position = popuppos++; mi.pszName = LPGEN("&Position"); mi.flags = CMIF_ROOTHANDLE; @@ -1373,7 +1366,6 @@ static int CLUIFramesLoadMainMenu() Frames[i].MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi); CLUIFramesCreateMenuForFrame(Frames[i].id, Frames[i].MenuHandles.MainMenuItem, separator, Menu_AddMainMenuItem); CLUIFramesModifyMainMenuItems(Frames[i].id, 0); - //NotifyEventHooks(hPreBuildFrameMenuEvent,i,(LPARAM)Frames[i].MenuHandles.MainMenuItem); CallService(MS_CLIST_FRAMEMENUNOTIFY, (WPARAM)Frames[i].id, (LPARAM)Frames[i].MenuHandles.MainMenuItem); separator++; } @@ -3030,7 +3022,6 @@ int LoadCLUIFramesModule(void) GapBetweenFrames = cfg::dat.gapBetweenFrames; nFramescount = 0; - InitFramesMenus(); HookEvent(ME_SYSTEM_MODULESLOADED, CLUIFrameOnModulesLoad); HookEvent(ME_CLIST_PREBUILDFRAMEMENU, CLUIFramesModifyContextMenuForFrame); diff --git a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp deleted file mode 100644 index 3b7d343b8f..0000000000 --- a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include <commonheaders.h>
-#include "cluiframes.h"
-
-//========================== Frames
-HANDLE hFrameMenuObject;
-static HANDLE hPreBuildFrameMenuEvent;
-
-//contactmenu exec param(ownerdata)
-//also used in checkservice
-typedef struct{
- char *szServiceName;
- int Frameid;
- INT_PTR param1;
-} FrameMenuExecParam, *lpFrameMenuExecParam;
-
-INT_PTR FreeOwnerDataFrameMenu(WPARAM, LPARAM lParam)
-{
- lpFrameMenuExecParam cmep = (lpFrameMenuExecParam)lParam;
- if (cmep != NULL){
- mir_free(cmep->szServiceName);
- mir_free(cmep);
- }
- return 0;
-}
-
-static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam)
-{
- CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
-
- TMO_MenuItem tmi;
- if (!pcli->pfnConvertMenu(mi, &tmi))
- return NULL;
-
- tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL;
-
- lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mir_alloc(sizeof(FrameMenuExecParam));
- if (fmep == NULL)
- return 0;
-
- fmep->szServiceName = mir_strdup(mi->pszService);
- fmep->Frameid = mi->popupPosition;
- fmep->param1 = (INT_PTR)mi->pszContactOwner;
- tmi.ownerdata = fmep;
- return (INT_PTR)Menu_AddItem(hFrameMenuObject, &tmi);
-}
-
-//called with:
-//wparam - ownerdata
-//lparam - lparam from winproc
-INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam)
-{
- lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)wParam;
- if (fmep == NULL)
- return -1;
-
- CallService(fmep->szServiceName, lParam, fmep->param1);
- RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
- return 0;
-}
-
-//true - ok,false ignore
-INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM)
-{
- TCheckProcParam *pcpp = (TCheckProcParam*)wParam;
- if (pcpp == NULL)
- return FALSE;
-
- TMO_MenuItem mi;
- if (Menu_GetItemInfo(pcpp->MenuItemHandle, mi) == 0) {
- lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mi.ownerdata;
- if (fmep != NULL) {
- //pcpp->wParam - frameid
- if (((WPARAM)fmep->Frameid == pcpp->wParam) || fmep->Frameid == -1)
- return TRUE;
- }
- }
- return FALSE;
-}
-
-static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam)
-{
- NotifyEventHooks(hPreBuildFrameMenuEvent, wParam, lParam);
- return 0;
-}
-
-static INT_PTR BuildContextFrameMenu(WPARAM wParam, LPARAM lParam)
-{
- ContextFrameMenuNotify(wParam, -1);
-
- HMENU hMenu = CreatePopupMenu();
- Menu_Build(hMenu, hFrameMenuObject, wParam, lParam);
- return (INT_PTR)hMenu;
-}
-
-//========================== Frames end
-
-int InitFramesMenus(void)
-{
- CreateServiceFunction("FrameMenuExecService", FrameMenuExecService);
- CreateServiceFunction("FrameMenuCheckService", FrameMenuCheckService);
- CreateServiceFunction("FrameMenuFreeService", FreeOwnerDataFrameMenu);
-
- CreateServiceFunction("CList/AddContextFrameMenuItem", AddContextFrameMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDFRAMECONTEXT, BuildContextFrameMenu);
- CreateServiceFunction(MS_CLIST_FRAMEMENUNOTIFY, ContextFrameMenuNotify);
- hPreBuildFrameMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
-
- // frame menu object
- hFrameMenuObject = Menu_AddObject("FrameMenu", LPGEN("Frame menu"), "FrameMenuCheckService", "FrameMenuExecService");
- Menu_ConfigureObject(hFrameMenuObject, MCO_OPT_FREE_SERVICE, "FrameMenuFreeService");
- return 0;
-}
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index 34e8222803..86bff0d6a2 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -3,7 +3,7 @@ Miranda NG: the free IM client for Microsoft* Windows*
Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org),
-Copyright (c) 2000-03 Miranda ICQ/IM project,
+Copyright (c) 2000-08 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -46,10 +46,12 @@ HGENMENU hNewSubGroupMenuItem; void InitSubGroupMenus(void);
//Groupmenu exec param(ownerdata)
-typedef struct {
+typedef struct
+{
char *szServiceName;
- int Param1,Param2;
-} GroupMenuExecParam, *lpGroupMenuExecParam;
+ int Param1, Param2;
+}
+GroupMenuExecParam, *lpGroupMenuExecParam;
static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
{
@@ -67,13 +69,13 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam) if (!pcli->pfnConvertMenu(mi, &tmi))
return NULL;
- lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_alloc(sizeof(GroupMenuExecParam));
+ lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)mir_calloc(sizeof(GroupMenuExecParam));
if (mmep == NULL)
return 0;
//we need just one parametr.
mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = mi->popupPosition;
+ mmep->Param1 = 0; // mi->popupPosition; !!!!!!!!!!!!!!!!!!
lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
if (gmp != NULL) {
mmep->Param1 = gmp->wParam;
@@ -89,14 +91,9 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam) return (INT_PTR)hNewItem;
}
-INT_PTR GroupMenuCheckService(WPARAM, LPARAM)
-{
- return 0;
-}
-
INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
{
- MENUITEMINFO *mii = (MENUITEMINFO *)wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
if (mii == NULL)
return 0;
@@ -107,13 +104,11 @@ INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam) }
if (hGroupMainMenuItemProxy == (HANDLE)lParam) {
mii->fMask |= MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
}
if (hGroupStatusMenuItemProxy == (HANDLE)lParam) {
mii->fMask |= MIIM_SUBMENU;
- //mi.fType = MFT_STRING;
mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
}
if (hAppearanceMenuItemProxy == (HANDLE)lParam) {
@@ -128,8 +123,8 @@ INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam) mii->fMask |= MIIM_SUBMENU;
mii->hSubMenu = (HMENU)hMenuOldContext;
}
- return (TRUE);
-};
+ return TRUE;
+}
//called with:
//wparam - ownerdata
@@ -143,9 +138,7 @@ INT_PTR GroupMenuExecService(WPARAM wParam, LPARAM lParam) mmep->Param1 = 0;
CallService(mmep->szServiceName, mmep->Param1, lParam);
}
- else
- CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
-
+ else CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
}
return 1;
}
@@ -157,6 +150,7 @@ INT_PTR FreeOwnerDataGroupMenu(WPARAM, LPARAM lParam) mir_free(mmep->szServiceName);
mir_free(mmep);
}
+
return 0;
}
@@ -189,13 +183,13 @@ static int OnBuildGroupMenu(WPARAM, LPARAM) int flags = (cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
- flags = (SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? CMIF_CHECKED : 0);
+ flags = SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? CMIF_CHECKED : 0;
Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
- flags = (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? CMIF_CHECKED : 0);
+ flags = GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? CMIF_CHECKED : 0;
Menu_ModifyItem(hHideEmptyGroupsMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
- flags = (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS ? 0 : CMIF_CHECKED);
+ flags = GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS ? 0 : CMIF_CHECKED;
Menu_ModifyItem(hDisableGroupsMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
Menu_ModifyItem(hGroupMainMenuItemProxy, NULL, INVALID_HANDLE_VALUE, flags);
@@ -245,108 +239,95 @@ void InitGroupMenus(void) mi.pszName = LPGEN("E&xit");
AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 500;
mi.pszService = MS_CLIST_SHOWHIDE;
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.pszName = LPGEN("&Hide/show");
hHideShowMainMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 200000;
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
mi.pszService = "FindAdd/FindAddCommand";
mi.pszName = LPGEN("&Find/add contacts...");
AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 300000;
mi.pszService = "";
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU);
mi.pszName = LPGEN("&Main menu");
hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 300100;
mi.pszService = "";
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS);
mi.pszName = LPGEN("&Status");
hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 390100;
- mi.pszService = "";
mi.icolibItem = iconItem[1].hIcolib;
mi.pszName = LPGEN("Appearance");
hAppearanceMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 400000;
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.pszService = "Options/OptionsCommand";
mi.pszName = LPGEN("&Options...");
AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 500000;
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszService = "CLN/About";
mi.pszName = LPGEN("&About the contact list...");
AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
+ mi.flags = 0;
mi.position = 100000;
mi.icolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&New group");
- gmp.lParam = 0;
- gmp.wParam = POPUP_NEWGROUP;
hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 100001;
mi.hIcon = NULL;
+ mi.icolibItem = NULL;
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.pszName = LPGEN("&Hide offline users");
- gmp.lParam = 0;
- gmp.wParam = -1;
+ gmp.lParam = 0; gmp.wParam = -1;
hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 100002;
- mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
mi.pszName = LPGEN("Hide &offline users out here");
hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 100003;
- mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
mi.pszName = LPGEN("Hide &empty groups");
hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 100004;
- mi.hIcon = NULL;
mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
mi.pszName = LPGEN("Disable &groups");
hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
}
+//////////////////////////////END Group MENU/////////////////////////
+
+//////////////////////////////SubGroup MENU/////////////////////////
HANDLE hSubGroupMenuObject;
HANDLE hSubGroupMainMenuItemProxy;
-//HANDLE hHideShowMainMenuItem;
HANDLE hSubGroupStatusMenuItemProxy;
HANDLE hPreBuildSubGroupMenuEvent;
HGENMENU hHideOfflineUsersHereMenuItem;
//SubGroupmenu exec param(ownerdata)
-typedef struct {
+typedef struct
+{
char *szServiceName;
int Param1, Param2;
-} SubGroupMenuExecParam, *lpSubGroupMenuExecParam;
+}
+SubGroupMenuExecParam, *lpSubGroupMenuExecParam;
static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
{
@@ -379,7 +360,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam) //we need just one parametr.
lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = mi->popupPosition;
+ mmep->Param1 = 0; // mi->popupPosition; !!!!!!!!!!!!!!!!!!!!!!!!!
if (gmp != NULL) {
mmep->Param1 = gmp->wParam;
mmep->Param2 = gmp->lParam;
@@ -488,9 +469,9 @@ void InitSubGroupMenus(void) gmp.wParam = POPUP_NEWSUBGROUP;
hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 1001;
mi.hIcon = NULL;
+ mi.icolibItem = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&Hide offline users in here");
gmp.lParam = 0;
@@ -506,7 +487,6 @@ void InitSubGroupMenus(void) gmp.wParam = POPUP_RENAMEGROUP;
AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
- memset(&mi, 0, sizeof(mi));
mi.position = 900002;
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
|