diff options
Diffstat (limited to 'plugins')
19 files changed, 80 insertions, 625 deletions
diff --git a/plugins/Clist_modern/res/addgroup.ico b/plugins/Clist_modern/res/addgroup.ico Binary files differdeleted file mode 100644 index 539c32fcd9..0000000000 --- a/plugins/Clist_modern/res/addgroup.ico +++ /dev/null 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
diff --git a/plugins/Clist_nicer/res/addgroup.ico b/plugins/Clist_nicer/res/addgroup.ico Binary files differdeleted file mode 100644 index 539c32fcd9..0000000000 --- a/plugins/Clist_nicer/res/addgroup.ico +++ /dev/null diff --git a/plugins/Clist_nicer/res/resource.rc b/plugins/Clist_nicer/res/resource.rc index 28fbc2cd53..e37a5911d5 100644 --- a/plugins/Clist_nicer/res/resource.rc +++ b/plugins/Clist_nicer/res/resource.rc @@ -537,7 +537,6 @@ END // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-IDI_ADDGROUP ICON "addgroup.ico"
IDI_CLIST ICON "clist.ico"
IDI_DELETE ICON "delete.ico"
IDI_CLVM_OPTIONS ICON "options_clvm.ico"
@@ -601,47 +600,6 @@ BEGIN END
END
-IDR_CONTEXT MENU
-BEGIN
- POPUP "Tray"
- BEGIN
- MENUITEM "&Hide/Show", 40038
- 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 SEPARATOR
- MENUITEM "Hide Miranda", POPUP_HIDEMIRANDA
- END
- POPUP "Group"
- BEGIN
- MENUITEM "&New subgroup", POPUP_NEWSUBGROUP
- MENUITEM "&Hide offline users in here", POPUP_GROUPHIDEOFFLINE
- MENUITEM SEPARATOR
- MENUITEM "&Rename group", POPUP_RENAMEGROUP
- MENUITEM "&Delete group", POPUP_DELETEGROUP
- MENUITEM SEPARATOR
- MENUITEM "Move marked contacts to this group", POPUP_MOVEMARKEDHERE, GRAYED
- END
- POPUP "Appearance"
- BEGIN
- MENUITEM "Show status icons", POPUP_SHOWSTATUSICONS
- MENUITEM "Show metacontact protocol icons", POPUP_SHOWMETAICONS
- MENUITEM SEPARATOR
- MENUITEM "Show additional buttons", POPUP_BUTTONS
- MENUITEM "Draw sunken frame", POPUP_FRAME
- END
-END
-
-
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index abaf6cda54..61e0570f26 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -29,23 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma hdrstop
-static HMENU hMainMenu, hMainStatusMenu;
-
-void InitIconLibMenuIcons();
extern IconItemT iconItem[];
-
-void DestroyTrayMenu(HMENU hMenu)
-{
- int i, cnt;
-
- cnt = GetMenuItemCount(hMenu);
- for (i = 0; i < cnt; ++i) {
- HMENU hSubMenu = GetSubMenu(hMenu, i);
- if (hSubMenu == hMainStatusMenu || hSubMenu == hMainMenu)
- RemoveMenu(hMenu, i--, MF_BYPOSITION);
- }
- DestroyMenu(hMenu);
-}
+void InitIconLibMenuIcons();
INT_PTR CloseAction(WPARAM, LPARAM)
{
@@ -384,13 +369,9 @@ int InitCustomMenus(void) CMenuItem mi;
mi.position = 200000;
mi.pszService = "CList/SetContactIgnore";
- mi.hIcolibItem = iconItem[1].hIcolib;
+ mi.hIcolibItem = iconItem[0].hIcolib;
mi.name.a = LPGEN("&Contact list settings...");
Menu_AddContactMenuItem(&mi);
-
- hMainStatusMenu = (HMENU)Menu_GetStatusMenu();
- hMainMenu = Menu_GetMainMenu();
-
return 0;
}
diff --git a/plugins/Clist_nicer/src/clisttray.cpp b/plugins/Clist_nicer/src/clisttray.cpp index d60405fecc..6ef9e834d1 100644 --- a/plugins/Clist_nicer/src/clisttray.cpp +++ b/plugins/Clist_nicer/src/clisttray.cpp @@ -24,9 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-#define TRAYICON_ID_BASE 100
-#define TIM_CALLBACK (WM_USER+1857)
-#define TIM_CREATE (WM_USER+1858)
+#define TRAYICON_ID_BASE 100
extern HIMAGELIST hCListImages;
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 80b01a7a48..ec0cf9dc97 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -73,7 +73,6 @@ void InitGroupMenus(); void FS_RegisterFonts(); void LoadExtraIconModule(); void RemoveFromTaskBar(HWND hWnd); -void DestroyTrayMenu(HMENU hMenu); extern LONG g_cxsmIcon, g_cysmIcon; @@ -778,6 +777,8 @@ static void GetButtonRect(HWND hwnd, RECT *rc) LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + RECT rc; + switch (msg) { case WM_CREATE: { @@ -906,7 +907,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case WM_PAINT: { PAINTSTRUCT ps; - RECT rc, rcFrame, rcClient; + RECT rcFrame, rcClient; HDC hdc; HRGN rgn = 0; HDC hdcReal = BeginPaint(hwnd, &ps); @@ -1022,7 +1023,6 @@ skipbg: case WM_ENTERSIZEMOVE: { - RECT rc; POINT pt = { 0 }; GetWindowRect(hwnd, &g_PreSizeRect); @@ -1098,7 +1098,6 @@ skipbg: if (pcli->hwndContactList != 0) { SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0); - RECT rc; GetWindowRect(hwnd, &rc); WINDOWPOS wp = { 0 }; wp.cx = rc.right - rc.left; @@ -1113,7 +1112,6 @@ skipbg: case WM_MOVE: if (!IsIconic(hwnd)) { - RECT rc; GetWindowRect(hwnd, &rc); if (!Docking_IsDocked(0, 0)) { @@ -1123,7 +1121,6 @@ skipbg: } cluiPos.right = rc.right - rc.left; if (cfg::dat.realTimeSaving) { - RECT rc; GetWindowRect(hwnd, &rc); // if docked, dont remember pos (except for width) @@ -1346,9 +1343,8 @@ skipbg: if (cfg::clcdat) { pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, NULL); - if (contact && contact->type == CLCIT_CONTACT) { + if (contact && contact->type == CLCIT_CONTACT) hContact = contact->hContact; - } } while (item) { if (item->uId == (DWORD)LOWORD(wParam)) { @@ -1438,26 +1434,17 @@ skipbg: case IDC_TBMENU: case IDC_TBTOPMENU: case IDC_STBTOPMENU: - { - RECT rc; - HMENU hMenu = Menu_GetMainMenu(); - GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc); - TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBMENU ? rc.top : rc.bottom, 0, hwnd, NULL); - } + GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc); + TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBMENU ? rc.top : rc.bottom, 0, hwnd, NULL); return 0; case IDC_TBTOPSTATUS: case IDC_STBTOPSTATUS: case IDC_TBGLOBALSTATUS: - { - RECT rc; - HMENU hmenu = (HMENU)Menu_GetStatusMenu(); - GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc); - TrackPopupMenu(hmenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBGLOBALSTATUS ? rc.top : rc.bottom, 0, hwnd, NULL); - } + GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc); + TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBGLOBALSTATUS ? rc.top : rc.bottom, 0, hwnd, NULL); return 0; - case IDC_TBSOUND: case IDC_STBSOUND: cfg::dat.soundsOff = !cfg::dat.soundsOff; @@ -1613,10 +1600,8 @@ buttons_done: break; case WM_CONTEXTMENU: + GetWindowRect(pcli->hwndContactTree, &rc); { - RECT rc; - GetWindowRect(pcli->hwndContactTree, &rc); - // x/y might be -1 if it was generated by a kb click POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; if (pt.x == -1 && pt.y == -1) { @@ -1631,7 +1616,7 @@ buttons_done: if (PtInRect(&rc, pt)) { HMENU hMenu = Menu_BuildGroupMenu(); TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL); - DestroyTrayMenu(hMenu); + Menu_DestroyNestedMenu(hMenu); return 0; } GetWindowRect(pcli->hwndStatus, &rc); @@ -1640,7 +1625,7 @@ buttons_done: if (cfg::getByte("CLUI", "SBarRightClk", 0)) hMenu = Menu_GetMainMenu(); else - hMenu = (HMENU)Menu_GetStatusMenu(); + hMenu = Menu_GetStatusMenu(); TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL); return 0; } @@ -1924,12 +1909,9 @@ static INT_PTR CLN_ShowMainMenu(WPARAM, LPARAM) static INT_PTR CLN_ShowStatusMenu(WPARAM, LPARAM) { - HMENU hMenu; POINT pt; - - hMenu = (HMENU)Menu_GetStatusMenu(); 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; } diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp index a3be204ae6..29700f1415 100644 --- a/plugins/Clist_nicer/src/groupmenu.cpp +++ b/plugins/Clist_nicer/src/groupmenu.cpp @@ -27,34 +27,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////// Group MENU //////////////////////////////
-HGENMENU hGroupMainMenuItemProxy;
-HGENMENU hHideShowMainMenuItem;
-HGENMENU hGroupStatusMenuItemProxy;
-HGENMENU hAppearanceMenuItemProxy;
-HGENMENU hEventAreaMenuItemProxy;
+static HGENMENU hGroupMainMenuItemProxy;
+static HGENMENU hHideShowMainMenuItem;
+static HGENMENU hGroupStatusMenuItemProxy;
+static HGENMENU hEventAreaMenuItemProxy;
-static HMENU hMenuOldContext;
-
-HGENMENU hHideOfflineUsersMenuItem;
-HGENMENU hHideOfflineUsersOutHereMenuItem;
-HGENMENU hHideEmptyGroupsMenuItem;
-HGENMENU hDisableGroupsMenuItem;
-HGENMENU hNewGroupMenuItem;
-HGENMENU hNewSubGroupMenuItem;
+struct
+{
+ char *name;
+ int command, mask, position;
+ HGENMENU hMenu;
+}
+static hAppearanceItems[] =
+{
+ { LPGEN("Show status icons"), POPUP_SHOWSTATUSICONS, CLUI_FRAME_STATUSICONS, 10001 },
+ { LPGEN("Show metacontact protocol icons"), POPUP_SHOWMETAICONS, CLUI_USEMETAICONS, 10002 },
+ { LPGEN("Show additional buttons"), POPUP_BUTTONS, CLUI_FRAME_SHOWBOTTOMBUTTONS, 110001 },
+ { LPGEN("Draw sunken frame"), POPUP_FRAME, CLUI_FRAME_CLISTSUNKEN, 110002 }
+};
-void InitSubGroupMenus(void);
+static HMENU hMenuOldContext;
-INT_PTR GroupMenu_OnAddService(WPARAM wParam, LPARAM lParam)
+static INT_PTR GroupMenu_OnAddService(WPARAM wParam, LPARAM lParam)
{
MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
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();
@@ -64,65 +63,24 @@ INT_PTR GroupMenu_OnAddService(WPARAM wParam, LPARAM lParam) mii->fMask |= MIIM_SUBMENU;
mii->hSubMenu = Menu_GetStatusMenu();
}
- if (hAppearanceMenuItemProxy == (HANDLE)lParam) {
- hMenuOldContext = GetSubMenu(LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 3);
- TranslateMenu(hMenuOldContext);
-
- CheckMenuItem(hMenuOldContext, POPUP_FRAME, MF_BYCOMMAND | (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN ? MF_CHECKED : MF_UNCHECKED));
- CheckMenuItem(hMenuOldContext, POPUP_BUTTONS, MF_BYCOMMAND | (cfg::dat.dwFlags & CLUI_FRAME_SHOWBOTTOMBUTTONS ? MF_CHECKED : MF_UNCHECKED));
- CheckMenuItem(hMenuOldContext, POPUP_SHOWMETAICONS, MF_BYCOMMAND | (cfg::dat.dwFlags & CLUI_USEMETAICONS ? MF_CHECKED : MF_UNCHECKED));
- CheckMenuItem(hMenuOldContext, POPUP_SHOWSTATUSICONS, MF_BYCOMMAND | (cfg::dat.dwFlags & CLUI_FRAME_STATUSICONS ? MF_CHECKED : MF_UNCHECKED));
-
- mii->fMask |= MIIM_SUBMENU;
- mii->hSubMenu = hMenuOldContext;
- }
return TRUE;
}
-INT_PTR HideGroupsHelper(WPARAM, LPARAM)
-{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
- cfg::writeByte("CList", "HideEmptyGroups", (BYTE)newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
- return 0;
-}
-
-INT_PTR UseGroupsHelper(WPARAM, LPARAM)
+static INT_PTR CommandHelper(WPARAM wParam, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- cfg::writeByte("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);
+ SendMessage(pcli->hwndContactList, WM_COMMAND, MAKELONG(wParam, BN_CLICKED), 1);
return 0;
}
static int OnBuildGroupMenu(WPARAM, LPARAM)
{
- bool bEnabled = 0 != cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- Menu_EnableItem(hHideOfflineUsersMenuItem, bEnabled);
-
- bEnabled = 0 != SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0);
- Menu_EnableItem(hHideOfflineUsersOutHereMenuItem, bEnabled);
-
- bEnabled = 0 != (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
- Menu_EnableItem(hHideEmptyGroupsMenuItem, bEnabled);
-
- bEnabled = 0 != (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- Menu_EnableItem(hDisableGroupsMenuItem, bEnabled);
-
- Menu_EnableItem(hGroupMainMenuItemProxy, bEnabled);
- Menu_EnableItem(hAppearanceMenuItemProxy, bEnabled);
+ for (int i = 0; i < _countof(hAppearanceItems); i++)
+ Menu_SetChecked(hAppearanceItems[i].hMenu, (cfg::dat.dwFlags & hAppearanceItems[i].mask) != 0);
return 0;
}
IconItemT iconItem[] = {
- { LPGENT("New group"), "new_group", IDI_ADDGROUP },
- { LPGENT("Contact list"), "clist", IDI_CLIST }
+ { LPGENT("Contact list"), "clist", IDI_CLIST }
};
void InitIconLibMenuIcons(void)
@@ -133,24 +91,11 @@ void InitIconLibMenuIcons(void) void InitGroupMenus(void)
{
CreateServiceFunction("CLISTMENUSGroup/GroupMenuOnAddService", GroupMenu_OnAddService);
- CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper", HideGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper", UseGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper", HideOfflineRootHelper);
HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
- InitSubGroupMenus();
-
// add exit command to menu
- GroupMenuParam gmp;
-
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);
@@ -175,114 +120,33 @@ void InitGroupMenus(void) mi.name.a = LPGEN("&Status");
hGroupStatusMenuItemProxy = Menu_AddGroupMenuItem(&mi);
+ // Appearance menu
mi.position = 390100;
- mi.hIcolibItem = iconItem[1].hIcolib;
+ mi.hIcolibItem = iconItem[0].hIcolib;
mi.name.a = LPGEN("Appearance");
- hAppearanceMenuItemProxy = Menu_AddGroupMenuItem(&mi);
+ mi.root = Menu_AddGroupMenuItem(&mi);
+
+ mi.hIcolibItem = NULL;
+ mi.pszService = "CLISTMENUSGroup/CommandHelper";
+ CreateServiceFunction(mi.pszService, CommandHelper);
+ for (int i = 0; i < _countof(hAppearanceItems); i++) {
+ GroupMenuParam gmp;
+ gmp.wParam = hAppearanceItems[i].command;
+ mi.name.a = hAppearanceItems[i].name;
+ mi.position = hAppearanceItems[i].position;
+ hAppearanceItems[i].hMenu = Menu_AddGroupMenuItem(&mi, &gmp);
+ }
+ mi.root = NULL;
mi.position = 400000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.pszService = "Options/OptionsCommand";
mi.name.a = LPGEN("&Options...");
Menu_AddGroupMenuItem(&mi);
- mi.position = 500000;
+ mi.position = 1000000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszService = "CLN/About";
mi.name.a = LPGEN("&About the contact list...");
Menu_AddGroupMenuItem(&mi);
-
- mi.flags = 0;
- mi.position = 100000;
- mi.hIcolibItem = iconItem[0].hIcolib;
- mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.name.a = LPGEN("&New group");
- hNewGroupMenuItem = Menu_AddGroupMenuItem(&mi, &gmp);
-
- 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/////////////////////////
-HANDLE hSubGroupMainMenuItemProxy;
-HANDLE hSubGroupStatusMenuItemProxy;
-HANDLE hPreBuildSubGroupMenuEvent;
-HGENMENU hHideOfflineUsersHereMenuItem;
-
-static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
-{
- ClcGroup *group = (ClcGroup*)wParam;
- if (group != 0) // contact->group
- Menu_ModifyItem(hHideOfflineUsersHereMenuItem, NULL, INVALID_HANDLE_VALUE, group->hideOffline ? CMIF_CHECKED : 0);
- return 0;
-}
-
-// wparam menu handle to pass to clc.c
-INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM)
-{
- SendMessage(pcli->hwndContactTree, WM_COMMAND, wParam, 0);
- return 0;
-}
-
-void InitSubGroupMenus(void)
-{
- 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.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.wParam = POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem = (HGENMENU)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.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.wParam = POPUP_DELETEGROUP;
- Menu_AddSubGroupMenuItem(&mi, &gmp);
}
-
-//////////////////////////////END SubGroup MENU/////////////////////////
diff --git a/plugins/Clist_nicer/src/resource.h b/plugins/Clist_nicer/src/resource.h index abb763ae2e..93b50e6938 100644 --- a/plugins/Clist_nicer/src/resource.h +++ b/plugins/Clist_nicer/src/resource.h @@ -10,13 +10,11 @@ #define IDD_OPTIONSDIALOG 101
#define IDD_CLNABOUT 102
#define IDD_OPT_CLIST 126
-#define IDI_ADDGROUP 143
#define IDI_CLIST 146
#define IDI_OPTIONS 163
#define IDI_DELETE 175
#define IDI_CLVM_OPTIONS 176
#define IDI_CLVM_SELECT 177
-#define IDR_CONTEXT 180
#define IDC_DROP 183
#define IDR_CLISTMENU 199
#define IDI_BLANK 200
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp index 8ed9c6022d..697b78ac27 100644 --- a/plugins/TopToolBar/src/InternalButtons.cpp +++ b/plugins/TopToolBar/src/InternalButtons.cpp @@ -71,11 +71,9 @@ INT_PTR TTBInternalMainMenuButt(WPARAM wParam, LPARAM lParam) INT_PTR TTBInternalStatusMenuButt(WPARAM wParam, LPARAM lParam)
{
- HMENU hMenu = (HMENU)Menu_GetStatusMenu();
-
POINT pt;
GetCursorPos(&pt);
- TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, NULL);
+ TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, NULL);
return 0;
}
|