summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-07-03 08:43:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-07-03 08:43:58 +0000
commit1ac5dafa951f57dfca5cf0dd6e7d2eeeea2f6772 (patch)
tree7f7adfefbd54d284072b98dc18bbd2bb26a165d4 /plugins/Clist_modern
parent6c1c4268578dcd59fc78f2ec8336bee991213a93 (diff)
- IDR_CONTEXT resource removed from all clists;
- all menu control rewritten using Menu_* functions, thus making group & tray menu customizable in StdClist & Clist_Nicer; - major gdi resource leak fixed git-svn-id: http://svn.miranda-ng.org/main/trunk@14483 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/res/addgroup.icobin1150 -> 0 bytes
-rw-r--r--plugins/Clist_modern/res/resource.rc32
-rw-r--r--plugins/Clist_modern/src/groupmenu.cpp202
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp9
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp102
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h2
-rw-r--r--plugins/Clist_modern/src/modern_static_clui.h2
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp4
-rw-r--r--plugins/Clist_modern/src/resource.h2
11 files changed, 24 insertions, 348 deletions
diff --git a/plugins/Clist_modern/res/addgroup.ico b/plugins/Clist_modern/res/addgroup.ico
deleted file mode 100644
index 539c32fcd9..0000000000
--- a/plugins/Clist_modern/res/addgroup.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/Clist_modern/res/resource.rc b/plugins/Clist_modern/res/resource.rc
index 70f0e758e6..56dfa30b88 100644
--- a/plugins/Clist_modern/res/resource.rc
+++ b/plugins/Clist_modern/res/resource.rc
@@ -29,7 +29,6 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
// remains consistent on all systems.
IDI_HIDE_AVATAR ICON "hide_avatar.ico"
IDI_SHOW_AVATAR ICON "show_avatar.ico"
-IDI_NEWGROUP2 ICON "addgroup.ico"
IDI_LISTENING_TO ICON "listening_to.ico"
IDI_FAVORITE_0 ICON "rate_none.ico"
IDI_FAVORITE_1 ICON "rate_low.ico"
@@ -937,37 +936,6 @@ BEGIN
END
END
-IDR_CONTEXT MENU
-BEGIN
- POPUP "Tray"
- BEGIN
- MENUITEM "&Hide/Show", ID_TRAY_HIDE
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_TRAY_EXIT
- END
- POPUP "Nowhere"
- BEGIN
- MENUITEM "&New group", POPUP_NEWGROUP
- MENUITEM SEPARATOR
- MENUITEM "&Hide offline users", POPUP_HIDEOFFLINE
- MENUITEM "Hide &offline users out here", POPUP_HIDEOFFLINEROOT
- MENUITEM "Hide &empty groups", POPUP_HIDEEMPTYGROUPS
- MENUITEM "Disable &groups", POPUP_DISABLEGROUPS
- MENUITEM SEPARATOR
- MENUITEM "Hide Miranda", POPUP_HIDEMIRANDA
- END
- POPUP "Group"
- BEGIN
- MENUITEM "&New subgroup", POPUP_NEWSUBGROUP
- MENUITEM "&Hide offline users in here", POPUP_GROUPHIDEOFFLINE
- MENUITEM "&Show offline users in here", POPUP_GROUPSHOWOFFLINE
- MENUITEM SEPARATOR
- MENUITEM "&Rename group", POPUP_RENAMEGROUP
- MENUITEM "&Delete group", POPUP_DELETEGROUP
- END
-END
-
-
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/plugins/Clist_modern/src/groupmenu.cpp b/plugins/Clist_modern/src/groupmenu.cpp
index c5b7781bb8..b557ba1f75 100644
--- a/plugins/Clist_modern/src/groupmenu.cpp
+++ b/plugins/Clist_modern/src/groupmenu.cpp
@@ -29,17 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////// Group MENU //////////////////////////////
-HGENMENU hGroupMainMenuItemProxy;
-HGENMENU hHideShowMainMenuItem;
-HGENMENU hGroupStatusMenuItemProxy;
-
-HGENMENU hHideOfflineUsersMenuItem;
-HGENMENU hHideOfflineUsersOutHereMenuItem;
-HGENMENU hHideEmptyGroupsMenuItem;
-
-HGENMENU hDisableGroupsMenuItem;
-HGENMENU hNewGroupMenuItem;
-HGENMENU hNewSubGroupMenuItem;
+HGENMENU hGroupMainMenuItemProxy, hGroupStatusMenuItemProxy;
void InitSubGroupMenus(void);
@@ -49,11 +39,6 @@ INT_PTR GroupMenuOnAddService(WPARAM wParam, LPARAM lParam)
if (mii == NULL)
return 0;
- if (hHideShowMainMenuItem == (HANDLE)lParam) {
- mii->fMask |= MIIM_STATE;
- mii->fState |= MFS_DEFAULT;
-
- }
if (hGroupMainMenuItemProxy == (HANDLE)lParam) {
mii->fMask |= MIIM_SUBMENU;
mii->hSubMenu = Menu_GetMainMenu();
@@ -67,91 +52,19 @@ INT_PTR GroupMenuOnAddService(WPARAM wParam, LPARAM lParam)
return TRUE;
}
-INT_PTR HideGroupsHelper(WPARAM, LPARAM)
-{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
- db_set_b(NULL, "CList", "HideEmptyGroups", (BYTE)newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
- return 0;
-}
-
-INT_PTR UseGroupsHelper(WPARAM, LPARAM)
-{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- db_set_b(NULL, "CList", "UseGroups", (BYTE)newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal,0);
- return 0;
-}
-
-INT_PTR HideOfflineRootHelper(WPARAM, LPARAM)
-{
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT,
- !SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0),
- 0);
- return 0;
-}
-
-INT_PTR CreateGroupHelper(WPARAM, LPARAM)
-{
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
- SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
- Clist_CreateGroup(0, 0);
- return 0;
-};
-
-static int OnBuildGroupMenu(WPARAM, LPARAM)
-{
- if (MirandaExiting()) return 0;
-
- int flags = db_get_b(NULL, "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;
- Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
-
- 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;
- Menu_ModifyItem(hDisableGroupsMenuItem, NULL, INVALID_HANDLE_VALUE, flags);
- return 0;
-}
-
-static IconItemT iconItem[] =
-{
- { LPGENT("New group"), "NewGroup", IDI_NEWGROUP2 }
-};
-
-void GroupMenus_Init(void)
-{
- Icon_RegisterT(g_hInst, LPGENT("Contact list"), iconItem, _countof(iconItem));
-}
-
void InitGroupMenus(void)
{
CreateServiceFunction("CLISTMENUSGroup/GroupMenuOnAddService", GroupMenuOnAddService);
- CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper", HideGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper", UseGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper", HideOfflineRootHelper);
- CreateServiceFunction("CLISTMENUSGroup/CreateGroupHelper", CreateGroupHelper);
-
- HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
InitSubGroupMenus();
// add exit command to menu
CMenuItem mi;
- mi.position = 1900000;
- mi.pszService = "CloseAction";
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
- mi.name.a = LPGEN("E&xit");
- Menu_AddGroupMenuItem(&mi);
-
mi.position = 500;
mi.pszService = MS_CLIST_SHOWHIDE;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
mi.name.a = LPGEN("&Hide/show");
- hHideShowMainMenuItem = Menu_AddGroupMenuItem(&mi);
+ Menu_AddGroupMenuItem(&mi);
mi.position = 200000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
@@ -177,121 +90,45 @@ void InitGroupMenus(void)
mi.name.a = LPGEN("&Options...");
Menu_AddGroupMenuItem(&mi);
- mi.position = 500000;
+ mi.position = 1000000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszService = "Help/AboutCommand";
mi.name.a = LPGEN("&About");
Menu_AddGroupMenuItem(&mi);
-
- GroupMenuParam gmp = {};
- mi.flags = 0;
- mi.position = 100000;
- mi.hIcolibItem = iconItem[0].hIcolib;
- mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
- mi.name.a = LPGEN("&New group");
- hNewGroupMenuItem = Menu_AddGroupMenuItem(&mi, &gmp);
- DestroyIcon_protect((HICON)mi.hIcolibItem);
-
- mi.position = 100001;
- mi.hIcolibItem = NULL;
- mi.hIcolibItem = NULL;
- mi.pszService = MS_CLIST_SETHIDEOFFLINE;
- mi.name.a = LPGEN("&Hide offline users");
- gmp.wParam = -1;
- hHideOfflineUsersMenuItem = Menu_AddGroupMenuItem(&mi, &gmp);
-
- mi.position = 100002;
- mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
- mi.name.a = LPGEN("Hide &offline users out here");
- hHideOfflineUsersOutHereMenuItem = Menu_AddGroupMenuItem(&mi);
-
- mi.position = 100003;
- mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
- mi.name.a = LPGEN("Hide &empty groups");
- hHideEmptyGroupsMenuItem = Menu_AddGroupMenuItem(&mi);
-
- mi.position = 100004;
- mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
- mi.name.a = LPGEN("Disable &groups");
- hDisableGroupsMenuItem = Menu_AddGroupMenuItem(&mi);
}
/////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////// SubGroup MENU //////////////////////////////
-HGENMENU hHideOfflineUsersHereMenuItem, hShowOfflineUsersHereMenuItem;
+static HGENMENU hShowOfflineUsersHereMenuItem;
// wparam menu handle to pass to clc.c
// lparam WM_COMMAND HWND
static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
{
- BOOL gray1 = FALSE;
- BOOL gray2 = FALSE;
- BOOL showOfflineinGroup = FALSE;
-
ClcGroup *group = (ClcGroup *)wParam;
- if (wParam == 0) return 0;
-
- if (MirandaExiting()) return 0;
- //contact->group
-
- showOfflineinGroup = CLCItems_IsShowOfflineGroup(group);
- gray1 = (showOfflineinGroup != FALSE);
- gray2 = (group->hideOffline != FALSE);
-
- if (gray1 && gray2) gray1 = FALSE; //should not be cause CLCItems_IsShowOfflineGroup return false if group->hideOffline
-
- Menu_EnableItem(hHideOfflineUsersHereMenuItem, !gray1);
- Menu_SetChecked(hHideOfflineUsersHereMenuItem, group->hideOffline && !gray1);
-
- Menu_EnableItem(hShowOfflineUsersHereMenuItem, !gray2);
- Menu_SetChecked(hShowOfflineUsersHereMenuItem, showOfflineinGroup && !gray2);
- return 0;
-}
+ if (wParam == 0)
+ return 0;
-INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM)
-{
- MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
- if (mii == NULL)
+ if (MirandaExiting())
return 0;
- return TRUE;
-}
+ bool showOfflineinGroup = CLCItems_IsShowOfflineGroup(group);
+ bool gray2 = group->hideOffline == 0;
-INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
-{
- SendMessage(lParam ? (HWND)lParam : (HWND)pcli->hwndContactTree, WM_COMMAND, wParam, 0);
+ Menu_EnableItem(hShowOfflineUsersHereMenuItem, gray2);
+ Menu_SetChecked(hShowOfflineUsersHereMenuItem, showOfflineinGroup && gray2);
return 0;
}
void InitSubGroupMenus(void)
{
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuOnAddService", SubGroupMenuonAddService);
- CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy", GroupMenuExecProxy);
-
HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
// add exit command to menu
GroupMenuParam gmp;
CMenuItem mi;
- mi.position = 1000;
- mi.hIcolibItem = iconItem[0].hIcolib;
- mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.name.a = LPGEN("&New subgroup");
- gmp.lParam = 0;
- gmp.wParam = POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem = Menu_AddSubGroupMenuItem(&mi, &gmp);
-
- mi.position = 1001;
- mi.hIcolibItem = NULL;
- mi.hIcolibItem = NULL;
- mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.name.a = LPGEN("&Hide offline users in here");
- gmp.lParam = 0;
- gmp.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = Menu_AddSubGroupMenuItem(&mi, &gmp);
-
mi.position = 1002;
mi.hIcolibItem = NULL;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
@@ -299,21 +136,4 @@ void InitSubGroupMenus(void)
gmp.lParam = 0;
gmp.wParam = POPUP_GROUPSHOWOFFLINE;
hShowOfflineUsersHereMenuItem = Menu_AddSubGroupMenuItem(&mi, &gmp);
-
- memset(&mi, 0, sizeof(mi));
- mi.position = 900001;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
- mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.name.a = LPGEN("&Rename group");
- gmp.lParam = 0;
- gmp.wParam = POPUP_RENAMEGROUP;
- Menu_AddSubGroupMenuItem(&mi, &gmp);
-
- mi.position = 900002;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
- mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.name.a = LPGEN("&Delete group");
- gmp.lParam = 0;
- gmp.wParam = POPUP_DELETEGROUP;
- Menu_AddSubGroupMenuItem(&mi, &gmp);
}
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index c7753ca7a1..58843ea517 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -285,13 +285,14 @@ void cli_DeleteItemFromTree(HWND hwnd, MCONTACT hItem)
ClearRowByIndexCache();
}
-BOOL CLCItems_IsShowOfflineGroup(ClcGroup* group)
+bool CLCItems_IsShowOfflineGroup(ClcGroup *group)
{
+ if (!group) return false;
+ if (group->hideOffline) return false;
+
DWORD groupFlags = 0;
- if (!group) return FALSE;
- if (group->hideOffline) return FALSE;
pcli->pfnGetGroupName(group->groupId, &groupFlags);
- return (groupFlags&GROUPF_SHOWOFFLINE) != 0;
+ return (groupFlags & GROUPF_SHOWOFFLINE) != 0;
}
MCONTACT SaveSelection(ClcData *dat)
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 409b4eb300..79faa36b59 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -47,8 +47,6 @@ int EventsProcessContactDoubleClick(MCONTACT hContact);
INT_PTR TrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam);
-void InitTrayMenus(void);
-
// returns normal icon or combined with status overlay. Needs to be destroyed.
HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status)
@@ -182,8 +180,7 @@ HRESULT CluiLoadModule()
CreateServiceFunction(MS_CLIST_SETUSEGROUPS, SetUseGroups);
InitCustomMenus();
- InitTrayMenus();
-
+
CLUI::InitClui();
return S_OK;
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 9c3a3d0250..38f12b14e3 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -29,10 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "modern_statusbar.h"
#include <m_protoint.h>
-HGENMENU hTrayMainMenuItemProxy, hTrayStatusMenuItemProxy, hTrayHideShowMainMenuItem;
int g_mutex_bOnTrayRightClick = 0;
BOOL g_bMultiConnectionMode = FALSE;
-static HMENU hMainMenu, hStatusMenu;
BOOL IS_WM_MOUSE_DOWN_IN_TRAY;
BOOL g_trayTooltipActive = FALSE;
POINT tray_hover_pos = { 0 };
@@ -143,17 +141,6 @@ int cliTrayIconPauseAutoHide(WPARAM, LPARAM)
return 0;
}
-void DestroyTrayMenu(HMENU hMenu)
-{
- int cnt = GetMenuItemCount(hMenu);
- for (int i = 0; i < cnt; ++i) {
- HMENU hSubMenu = GetSubMenu(hMenu, i);
- if (hSubMenu && ((hSubMenu == hStatusMenu) || (hSubMenu == hMainMenu)))
- RemoveMenu(hMenu, i--, MF_BYPOSITION);
- }
- DestroyMenu(hMenu);
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// Tray event handler
@@ -169,7 +156,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
case TIM_CALLBACK:
if ((GetAsyncKeyState(VK_CONTROL) & 0x8000) && msg->lParam == WM_LBUTTONDOWN && !db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT)) {
POINT pt;
- HMENU hMenu = (HMENU)Menu_GetStatusMenu();
+ HMENU hMenu = Menu_GetStatusMenu();
g_mutex_bOnTrayRightClick = 1;
IS_WM_MOUSE_DOWN_IN_TRAY = 1;
SetForegroundWindow(msg->hwnd);
@@ -184,20 +171,6 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
else if (msg->lParam == WM_MBUTTONDOWN || msg->lParam == WM_LBUTTONDOWN || msg->lParam == WM_RBUTTONDOWN) {
IS_WM_MOUSE_DOWN_IN_TRAY = 1;
}
- else if (msg->lParam == WM_RBUTTONUP) {
- HMENU hMenu = Menu_BuildTrayMenu();
- g_mutex_bOnTrayRightClick = 1;
-
- SetForegroundWindow(msg->hwnd);
- SetFocus(msg->hwnd);
-
- POINT pt;
- GetCursorPos(&pt);
- pcli->bTrayMenuOnScreen = TRUE;
- TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
- DestroyTrayMenu(hMenu);
- PostMessage(msg->hwnd, WM_NULL, 0, 0);
- }
else break;
*((LRESULT*)lParam) = 0;
return TRUE;
@@ -228,79 +201,6 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// Tray module init
-INT_PTR TrayMenuOnAddService(WPARAM wParam, LPARAM lParam)
-{
- MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
- if (mii == NULL)
- return 0;
-
- if (hTrayMainMenuItemProxy == (HGENMENU)lParam) {
- mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = Menu_GetMainMenu();
- }
-
- if (hTrayStatusMenuItemProxy == (HGENMENU)lParam) {
- mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = (HMENU)Menu_GetStatusMenu();
- }
-
- return TRUE;
-}
-
-void InitTrayMenus(void)
-{
- CreateServiceFunction("CLISTMENUSTRAY/TrayMenuOnAddService", TrayMenuOnAddService);
-
- // add exit command to menu
- CMenuItem mi;
- mi.position = 900000;
- mi.pszService = "CloseAction";
- mi.name.a = LPGEN("E&xit");
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
- Menu_AddTrayMenuItem(&mi);
-
- mi.flags = CMIF_DEFAULT;
- mi.position = 100000;
- mi.pszService = MS_CLIST_SHOWHIDE;
- mi.name.a = LPGEN("&Hide/show");
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SHOWHIDE);
- hTrayHideShowMainMenuItem = Menu_AddTrayMenuItem(&mi);
-
- mi.flags = 0;
- mi.position = 200000;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER);
- mi.pszService = "FindAdd/FindAddCommand";
- mi.name.a = LPGEN("&Find/add contacts...");
- Menu_AddTrayMenuItem(&mi);
-
- mi.position = 300000;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
- mi.pszService = "FakeService_1";
- mi.name.a = LPGEN("&Main menu");
- hTrayMainMenuItemProxy = Menu_AddTrayMenuItem(&mi);
-
- mi.position = 300100;
- mi.pszService = "FakeService_2";
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS); // eternity #004
- mi.name.a = LPGEN("&Status");
- hTrayStatusMenuItemProxy = Menu_AddTrayMenuItem(&mi);
-
- mi.position = 400000;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
- mi.pszService = "Options/OptionsCommand";
- mi.name.a = LPGEN("&Options...");
- Menu_AddTrayMenuItem(&mi);
-
- mi.position = 500000;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
- mi.pszService = "Help/AboutCommand";
- mi.name.a = LPGEN("&About");
- Menu_AddTrayMenuItem(&mi);
-
- hMainMenu = Menu_GetMainMenu();
- hStatusMenu = Menu_GetStatusMenu();
-}
-
VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
{
if (!pcli->trayIconCount)
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 9a73b66c63..f320d043e8 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -56,7 +56,6 @@ int MetaStatusChanged(WPARAM, LPARAM);
HRESULT(WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT& result);
-void DestroyTrayMenu(HMENU hMenu);
// new sources
#include <crtdbg.h>
@@ -221,11 +220,9 @@ INT_PTR CLUI::Service_ShowMainMenu(WPARAM, LPARAM)
INT_PTR CLUI::Service_ShowStatusMenu(WPARAM, LPARAM)
{
- HMENU hMenu = (HMENU)Menu_GetStatusMenu();
-
POINT pt;
GetCursorPos(&pt);
- TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, NULL);
+ TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, NULL);
return 0;
}
@@ -255,7 +252,7 @@ HRESULT CLUI::CreateCluiFrames()
mii.hSubMenu = Menu_GetMainMenu();
SetMenuItemInfo(g_hMenuMain, 0, TRUE, &mii);
- mii.hSubMenu = (HMENU)Menu_GetStatusMenu();
+ mii.hSubMenu = Menu_GetStatusMenu();
SetMenuItemInfo(g_hMenuMain, 1, TRUE, &mii);
CreateCLCWindow(pcli->hwndContactList);
@@ -284,9 +281,6 @@ m_hDwmapiDll(NULL)
CLUIServices_LoadModule();
- // Call InitGroup menus before
- GroupMenus_Init();
-
CreateServiceFunction(MS_CLUI_SHOWMAINMENU, Service_ShowMainMenu);
CreateServiceFunction(MS_CLUI_SHOWSTATUSMENU, Service_ShowStatusMenu);
@@ -2432,7 +2426,7 @@ LRESULT CLUI::OnContextMenu(UINT, WPARAM, LPARAM lParam)
if (PtInRect(&rc, pt)) {
HMENU hMenu = Menu_BuildGroupMenu();
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, m_hWnd, NULL);
- DestroyTrayMenu(hMenu);
+ Menu_DestroyNestedMenu(hMenu);
}
return FALSE;
}
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index dc07bbc5ba..790ce5c7c2 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -75,7 +75,7 @@ typedef INT_PTR(*PSYNCCALLBACKPROC)(WPARAM, LPARAM);
/* CLCItems */
-BOOL CLCItems_IsShowOfflineGroup(ClcGroup* group);
+bool CLCItems_IsShowOfflineGroup(ClcGroup* group);
/* CListMod */
int CListMod_HideWindow();
diff --git a/plugins/Clist_modern/src/modern_static_clui.h b/plugins/Clist_modern/src/modern_static_clui.h
index 8aea29123b..4795892b8f 100644
--- a/plugins/Clist_modern/src/modern_static_clui.h
+++ b/plugins/Clist_modern/src/modern_static_clui.h
@@ -73,8 +73,6 @@ int EventArea_Create(HWND hCluiWnd);
int ExtraImage_ExtraIDToColumnNum(int extra);
-void GroupMenus_Init();
-
int ModernSkinButtonLoadModule();
int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r);
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index 793fffc989..b3d6537c91 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -834,10 +834,10 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if (a ^ bShift)
hMenu = Menu_GetMainMenu();
else
- hMenu = (HMENU)Menu_GetStatusMenu();
+ hMenu = Menu_GetStatusMenu();
}
else {
- hMenu = (HMENU)Menu_GetStatusMenu();
+ hMenu = Menu_GetStatusMenu();
HMENU hSubMenu = GetSubMenu(hMenu, p.iProtoPos);
if (hSubMenu)
hMenu = hSubMenu;
diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h
index 7fbac92156..c8b30bff2f 100644
--- a/plugins/Clist_modern/src/resource.h
+++ b/plugins/Clist_modern/src/resource.h
@@ -17,7 +17,6 @@
#define IDI_OPTIONS 163
#define IDI_RENAME 173
#define IDI_DELETE 175
-#define IDR_CONTEXT 180
#define IDC_DROP 183
#define IDI_SENDEMAIL 193
#define IDR_CLISTMENU 199
@@ -63,7 +62,6 @@
#define IDD_OPT_SKIN 251
#define IDD_OPT_META_CLC 279
#define IDI_ACCMGR 281
-#define IDI_NEWGROUP2 283
#define IDD_MODERNOPTS 288
#define IDC_DEFAULTSUB 293
#define IDC_DROPMETA 295