summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-26 18:21:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-26 18:21:10 +0000
commit68924bfc1a213e619563c2cffb6d44b5b5346f6d (patch)
tree139f501b225080e4f895dbd40083df5956c3e339
parentb7a7d90f054d48dfda64e8a11d4f5cbb3fe2a521 (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
-rw-r--r--include/delphi/m_clist.inc2
-rw-r--r--include/m_clist.h117
-rw-r--r--include/m_clistint.h6
-rw-r--r--include/m_cluiframes.h4
-rw-r--r--include/m_genmenu.h168
-rw-r--r--plugins/Alarms/src/stdafx.h1
-rw-r--r--plugins/AuthState/src/stdafx.h1
-rw-r--r--plugins/AutoShutdown/src/stdafx.h2
-rw-r--r--plugins/BASS_interface/src/stdafx.h2
-rw-r--r--plugins/BasicHistory/src/BasicHistory.cpp2
-rw-r--r--plugins/Boltun/src/stdafx.h15
-rw-r--r--plugins/Clist_modern/clist_modern_10.vcxproj3
-rw-r--r--plugins/Clist_modern/clist_modern_10.vcxproj.filters3
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp4
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp44
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonprototypes.h1
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp4
-rw-r--r--plugins/Clist_nicer/clist_nicer_10.vcxproj1
-rw-r--r--plugins/Clist_nicer/clist_nicer_10.vcxproj.filters3
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp9
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp112
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp76
-rw-r--r--plugins/CrashDumper/src/crshdmp.cpp11
-rw-r--r--plugins/FTPFileYM/src/ftpfile.cpp14
-rw-r--r--plugins/HistoryStats/src/main.cpp9
-rw-r--r--plugins/HistoryStats/src/mu_common.cpp3
-rw-r--r--plugins/HistoryStats/src/mu_common.h2
-rw-r--r--plugins/ListeningTo/src/commons.h1
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp28
-rw-r--r--plugins/ListeningTo/src/options.h20
-rw-r--r--plugins/MenuItemEx/src/main.cpp6
-rw-r--r--plugins/MirOTR/src/stdafx.h1
-rw-r--r--plugins/MyDetails/src/commons.h1
-rw-r--r--plugins/MyDetails/src/frame.cpp2
-rw-r--r--plugins/MyDetails/src/mydetails.cpp3
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp1
-rw-r--r--plugins/New_GPG/src/commonheaders.h1
-rw-r--r--plugins/NewsAggregator/Src/Menus.cpp2
-rw-r--r--plugins/Non-IM Contact/src/main.cpp2
-rw-r--r--plugins/Nudge/src/main.cpp2
-rw-r--r--plugins/PasteIt/src/PasteIt.cpp10
-rw-r--r--plugins/Ping/src/common.h2
-rw-r--r--plugins/Ping/src/menu.cpp4
-rw-r--r--plugins/Ping/src/pingthread.cpp2
-rw-r--r--plugins/Popup/src/main.cpp1
-rw-r--r--plugins/ProfileManager/src/Common.h1
-rw-r--r--plugins/Quotes/src/Forex.cpp14
-rw-r--r--plugins/Quotes/src/stdafx.h1
-rw-r--r--plugins/Restart/src/Common.h1
-rw-r--r--plugins/SecureIM/src/commonheaders.h1
-rw-r--r--plugins/SecureIM/src/main.cpp5
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp2
-rw-r--r--plugins/SmileyAdd/src/general.h1
-rw-r--r--plugins/SmileyAdd/src/main.cpp1
-rw-r--r--plugins/SmileyAdd/src/services.cpp19
-rw-r--r--plugins/StatusPlugins/StartupStatus/profiles.cpp2
-rw-r--r--plugins/TopToolBar/src/common.h3
-rw-r--r--plugins/TrafficCounter/src/commonheaders.h1
-rw-r--r--plugins/UserInfoEx/src/mir_menuitems.cpp12
-rw-r--r--plugins/Utils/mir_buffer.h2
-rw-r--r--plugins/Watrack/i_gui.inc8
-rw-r--r--plugins/Watrack/lastfm/lastfm.pas8
-rw-r--r--plugins/Watrack/myshows/myshows.pas8
-rw-r--r--plugins/Watrack/popup/popups.pas10
-rw-r--r--plugins/Watrack/stat/statlog.pas10
-rw-r--r--plugins/Weather/src/weather_svcs.cpp2
-rw-r--r--plugins/WhoUsesMyFiles/src/wumfplug.cpp4
-rw-r--r--plugins/mRadio/i_visual.inc2
-rw-r--r--protocols/AimOscar/src/theme.cpp1
-rw-r--r--protocols/FacebookRM/src/theme.cpp2
-rw-r--r--protocols/IRCG/src/services.cpp8
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp2
-rw-r--r--protocols/MRA/src/Mra_menus.cpp4
-rw-r--r--protocols/MSN/src/msn_menu.cpp2
-rw-r--r--protocols/Sametime/src/sametime_session.cpp1
-rw-r--r--protocols/Tlen/src/tlen.cpp4
-rw-r--r--protocols/Twitter/src/proto.cpp2
-rw-r--r--protocols/WhatsApp/src/theme.cpp2
-rw-r--r--protocols/Xfire/src/Xfire_game.cpp2
-rw-r--r--protocols/Xfire/src/Xfire_gamelist.cpp2
-rw-r--r--src/core/stdhelp/src/help.cpp2
-rw-r--r--src/mir_app/src/clistmenus.cpp72
-rw-r--r--src/mir_app/src/clistmod.cpp2
-rw-r--r--src/mir_app/src/framesmenu.cpp (renamed from plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp)12
-rw-r--r--src/mir_app/src/genmenu.cpp7
-rw-r--r--src/mir_app/src/genmenu.h1
-rw-r--r--src/mir_app/src/movetogroup.cpp6
87 files changed, 393 insertions, 567 deletions
diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc
index c92f468a82..d8e9147711 100644
--- a/include/delphi/m_clist.inc
+++ b/include/delphi/m_clist.inc
@@ -62,8 +62,6 @@ type
szPopupName : TChar; // [TRANSLATED-BY-CORE] name of the popup menu that this item is on, if this
// is NULL the iteem is on the root of the menu
// or hParentMenu:HGENMENU - valid if CMIF_ROOTHANDLE is set. NULL or (HGENMENU)-1 means the root menu
- popupPosition : int; // position of the popup menu on the root menu, ignored
- // if pszPopupName is NULL(0) or if the popup menu already exists
pszContactOwner: PAnsiChar; // contact menus only, the protocol module that owns
// the contacts to which this to which this menu item
// applies, NULL(0) if it applies to all contacts.
diff --git a/include/m_clist.h b/include/m_clist.h
index 9362080589..4bc8d25709 100644
--- a/include/m_clist.h
+++ b/include/m_clist.h
@@ -31,14 +31,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "statusmodes.h"
+#ifndef M_CORE_H__
#include <m_core.h>
+#endif
-extern int hLangpack;
-
-#if defined MIR_APP_EXPORTS
- typedef struct TMO_IntMenuItem* HGENMENU;
-#else
- DECLARE_HANDLE(HGENMENU);
+#ifndef M_GENMENU_H__
+#include <m_genmenu.h>
#endif
//sent when the user asks to change their status
@@ -107,9 +105,6 @@ struct CLISTMENUITEM
HGENMENU hParentMenu; // valid if CMIF_ROOTHANDLE is set. NULL or (HGENMENU)-1 means the root menu
};
- int popupPosition; //position of the popup menu on the root menu. Ignored
- //if pszPopupName is NULL or the popup menu already
- //existed
char *pszContactOwner; //contact menus only. The protocol module that owns
//the contacts to which this menu item applies. NULL if it
//applies to all contacts. If it applies to multiple but not all
@@ -117,8 +112,6 @@ struct CLISTMENUITEM
int hLangpack; //plugin's hLangpack (added automatically)
};
-#define HGENMENU_ROOT ((HGENMENU)-1)
-
#define CMIF_GRAYED 1
#define CMIF_CHECKED 2
#define CMIF_HIDDEN 4 //only works on contact menus
@@ -168,27 +161,6 @@ __forceinline HGENMENU Menu_AddProtoMenuItem(CLISTMENUITEM *mi)
return (HGENMENU)CallService("CList/AddProtoMenuItem", 0, (LPARAM)mi);
}
-/////////////////////////////////////////////////////////////////////////////////////////
-// modify an existing menu item
-// returns 0 on success, nonzero on failure
-
-EXTERN_C MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HANDLE hIcon = INVALID_HANDLE_VALUE, int iFlags = -1);
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// changes menu item's visibility
-
-EXTERN_C MIR_APP_DLL(void) Menu_ShowItem(HGENMENU hMenuItem, bool bShow);
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// enables or disables a menu item
-
-EXTERN_C MIR_APP_DLL(void) Menu_EnableItem(HGENMENU hMenuItem, bool bEnable);
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// turns a menu item's check on & off
-
-EXTERN_C MIR_APP_DLL(void) Menu_SetChecked(HGENMENU hMenuItem, bool bSet);
-
//the context menu for a contact is about to be built v0.1.0.1+
//wParam = (MCONTACT)hContact
//lParam = 0
@@ -367,8 +339,89 @@ typedef struct {
//returns a HMENU. This need not be freed since it's owned by clist
#define MS_CLIST_MENUGETSTATUS "CList/MenuGetStatus"
+// Group MENU
+typedef struct
+{
+ int wParam;
+ int lParam;
+}
+GroupMenuParam, *lpGroupMenuParam;
+
+//builds the SubGroup menu
+//wParam=lParam=0
+//returns a HMENU identifying the menu.
+#define MS_CLIST_MENUBUILDSUBGROUP "CList/MenuBuildSubGroup"
+
+//add a new item to the SubGroup menus
+//wParam=lpGroupMenuParam, params to call when exec menuitem
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+
+__forceinline HGENMENU Menu_AddSubGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM *mi)
+{
+ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddSubGroupMenuItem", (WPARAM)gmp, (LPARAM)mi);
+}
+
+//the SubGroup menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDSUBGROUPMENU "CList/PreBuildSubGroupMenu"
+
+// Group MENU
+
+//builds the Group menu
+//wParam=lParam=0
+//returns a HMENU identifying the menu.
+#define MS_CLIST_MENUBUILDGROUP "CList/MenuBuildGroup"
+
+//add a new item to the Group menus
+//wParam=lpGroupMenuParam, params to call when exec menuitem
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+
+__forceinline HGENMENU Menu_AddGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM *mi)
+{
+ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddGroupMenuItem", (WPARAM)gmp, (LPARAM)mi);
+}
+
+//the Group menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDGROUPMENU "CList/PreBuildGroupMenu"
+
+// TRAY MENU
+
+//builds the tray menu
+//wParam=lParam=0
+//returns a HMENU identifying the menu.
+#define MS_CLIST_MENUBUILDTRAY "CList/MenuBuildTray"
+
+//add a new item to the tray menus
+//wParam=0
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+
+__forceinline HGENMENU Menu_AddTrayMenuItem(CLISTMENUITEM *mi)
+{
+ mi->hLangpack = hLangpack;
+ return (HGENMENU)CallService("CList/AddTrayMenuItem", 0, (LPARAM)mi);
+}
+
+//the tray menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDTRAYMENU "CList/PreBuildTrayMenu"
+
+// STATUS MENU
+
+//the status menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDSTATUSMENU "CList/PreBuildStatusMenu"
+//builds the main menu
+//wParam=lParam=0
+//returns a HMENU identifying the menu.
+#define MS_CLIST_MENUBUILDMAIN "CList/MenuBuildMain"
+//the main menu is about to be built
+//wParam=lParam=0
+#define ME_CLIST_PREBUILDMAINMENU "CList/PreBuildMainMenu"
//processes a menu selection from a menu v0.1.1.0+
//wParam = MAKEWPARAM(LOWORD(wParam from WM_COMMAND), flags)
diff --git a/include/m_clistint.h b/include/m_clistint.h
index 976f20d8df..d518d92a79 100644
--- a/include/m_clistint.h
+++ b/include/m_clistint.h
@@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <CommCtrl.h>
-#include "m_genmenu.h"
-#include "m_protocols.h"
-#include "m_clc.h"
+#include <m_clist.h>
+#include <m_protocols.h>
+#include <m_clc.h>
#define HCONTACT_ISGROUP 0x80000000
#define HCONTACT_ISINFO 0xFFFF0000
diff --git a/include/m_cluiframes.h b/include/m_cluiframes.h
index 98af031ab1..a52f65375e 100644
--- a/include/m_cluiframes.h
+++ b/include/m_cluiframes.h
@@ -23,8 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef M_CLUIFRAMES_H__
#define M_CLUIFRAMES_H__ 1
-#if !defined(M_GENMENU_H)
-#include "m_genmenu.h"
+#if !defined(M_GENMENU_H__)
+#include <m_genmenu.h>
#endif
/************************************************************************/
diff --git a/include/m_genmenu.h b/include/m_genmenu.h
index d62b5463eb..1d97fa6dcf 100644
--- a/include/m_genmenu.h
+++ b/include/m_genmenu.h
@@ -1,94 +1,17 @@
-#ifndef M_GENMENU_H
-#define M_GENMENU_H
+#ifndef M_GENMENU_H__
+#define M_GENMENU_H__
-#ifndef M_CLIST_H__
- #include <m_clist.h>
+#ifndef M_CORE_H__
+#include <m_core.h>
#endif
-extern int hLangpack;
-
-// Group MENU
-typedef struct
-{
- int wParam;
- int lParam;
-}
-GroupMenuParam,*lpGroupMenuParam;
-
-//builds the SubGroup menu
-//wParam=lParam=0
-//returns a HMENU identifying the menu.
-#define MS_CLIST_MENUBUILDSUBGROUP "CList/MenuBuildSubGroup"
-
-//add a new item to the SubGroup menus
-//wParam=lpGroupMenuParam, params to call when exec menuitem
-//lParam=(LPARAM)(CLISTMENUITEM*)&mi
-
-__forceinline HGENMENU Menu_AddSubGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM *mi)
-{ mi->hLangpack = hLangpack;
- return (HGENMENU)CallService("CList/AddSubGroupMenuItem", (WPARAM)gmp, (LPARAM)mi);
-}
-
-//the SubGroup menu is about to be built
-//wParam=lParam=0
-#define ME_CLIST_PREBUILDSUBGROUPMENU "CList/PreBuildSubGroupMenu"
-
-// Group MENU
-
-//builds the Group menu
-//wParam=lParam=0
-//returns a HMENU identifying the menu.
-#define MS_CLIST_MENUBUILDGROUP "CList/MenuBuildGroup"
-
-//add a new item to the Group menus
-//wParam=lpGroupMenuParam, params to call when exec menuitem
-//lParam=(LPARAM)(CLISTMENUITEM*)&mi
-
-__forceinline HGENMENU Menu_AddGroupMenuItem(lpGroupMenuParam gmp, CLISTMENUITEM *mi)
-{ mi->hLangpack = hLangpack;
- return (HGENMENU)CallService("CList/AddGroupMenuItem", (WPARAM)gmp, (LPARAM)mi);
-}
-
-//the Group menu is about to be built
-//wParam=lParam=0
-#define ME_CLIST_PREBUILDGROUPMENU "CList/PreBuildGroupMenu"
-
-// TRAY MENU
-
-//builds the tray menu
-//wParam=lParam=0
-//returns a HMENU identifying the menu.
-#define MS_CLIST_MENUBUILDTRAY "CList/MenuBuildTray"
-
-//add a new item to the tray menus
-//wParam=0
-//lParam=(LPARAM)(CLISTMENUITEM*)&mi
-
-__forceinline HGENMENU Menu_AddTrayMenuItem(CLISTMENUITEM *mi)
-{ mi->hLangpack = hLangpack;
- return (HGENMENU)CallService("CList/AddTrayMenuItem", 0, (LPARAM)mi);
-}
-
-//the tray menu is about to be built
-//wParam=lParam=0
-#define ME_CLIST_PREBUILDTRAYMENU "CList/PreBuildTrayMenu"
-
-// STATUS MENU
-
-//the status menu is about to be built
-//wParam=lParam=0
-#define ME_CLIST_PREBUILDSTATUSMENU "CList/PreBuildStatusMenu"
-
-//builds the main menu
-//wParam=lParam=0
-//returns a HMENU identifying the menu.
-#define MS_CLIST_MENUBUILDMAIN "CList/MenuBuildMain"
-
-//the main menu is about to be built
-//wParam=lParam=0
-#define ME_CLIST_PREBUILDMAINMENU "CList/PreBuildMainMenu"
-
-/*GENMENU_MODULE*/
+#if defined MIR_APP_EXPORTS
+ typedef struct TMO_IntMenuItem* HGENMENU;
+#else
+ DECLARE_HANDLE(HGENMENU);
+#endif
+
+#define HGENMENU_ROOT ((HGENMENU)INVALID_HANDLE_VALUE)
#define SETTING_NOOFFLINEBOTTOM_DEFAULT 0
@@ -146,20 +69,30 @@ EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessCommand(HGENMENU hMenuItem, LPARAM lParam
EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessCommandById(int command, LPARAM lParam);
/////////////////////////////////////////////////////////////////////////////////////////
-// Removes a menu item from genmenu
-// Returns 0 on success,-1 on failure.
-// You must free ownerdata before this call.
-// If MenuItemHandle is root, all children will be removed too.
-
-EXTERN_C MIR_APP_DLL(int) Menu_RemoveItem(HGENMENU hMenuItem);
-
-/////////////////////////////////////////////////////////////////////////////////////////
// Adds a menu item to genmenu
// Returns MenuItemHandle on success, or NULL on failure
EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddItem(HANDLE hMenuObject, TMO_MenuItem *pItem);
/////////////////////////////////////////////////////////////////////////////////////////
+// process a WM_DRAWITEM message for user context menus v0.1.1.0+
+// wParam, lParam, return value as for WM_MEASUREITEM
+// See comments for clist/menumeasureitem
+
+EXTERN_C MIR_APP_DLL(BOOL) Menu_DrawItem(DRAWITEMSTRUCT *dis);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// enables or disables a menu item
+
+EXTERN_C MIR_APP_DLL(void) Menu_EnableItem(HGENMENU hMenuItem, bool bEnable);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Retrieves a default menu item for the menu passed
+// Returns a menu handle on success or NULL on failure
+
+EXTERN_C MIR_APP_DLL(HGENMENU) Menu_GetDefaultItem(HGENMENU hMenu);
+
+/////////////////////////////////////////////////////////////////////////////////////////
// Retrieves user info from a menu item
// Returns ownerdata on success, NULL on failure
// Useful to get and free ownerdata before delete menu item.
@@ -173,10 +106,19 @@ EXTERN_C MIR_APP_DLL(void*) Menu_GetItemData(HGENMENU hMenuItem);
EXTERN_C MIR_APP_DLL(int) Menu_GetItemInfo(HGENMENU hMenuItem, TMO_MenuItem &pInfo);
/////////////////////////////////////////////////////////////////////////////////////////
-// Retrieves a default menu item for the menu passed
-// Returns a menu handle on success or NULL on failure
+// process a WM_MEASUREITEM message for user context menus v0.1.1.0+
+// wParam, lParam, return value as for WM_MEASUREITEM
+// This is for displaying the icons by the menu items. If you don't call this
+// and clist/menudrawitem whne drawing a menu returned by one of the three menu
+// services below then it'll work but you won't get any icons
-EXTERN_C MIR_APP_DLL(HGENMENU) Menu_GetDefaultItem(HGENMENU hMenu);
+EXTERN_C MIR_APP_DLL(BOOL) Menu_MeasureItem(MEASUREITEMSTRUCT *mis);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// modify an existing menu item
+// returns 0 on success, nonzero on failure
+
+EXTERN_C MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HANDLE hIcon = INVALID_HANDLE_VALUE, int iFlags = -1);
/////////////////////////////////////////////////////////////////////////////////////////
// Tries to process a keystroke
@@ -185,19 +127,23 @@ EXTERN_C MIR_APP_DLL(HGENMENU) Menu_GetDefaultItem(HGENMENU hMenu);
EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessHotKey(HANDLE hMenuObject, int key);
-//process a WM_MEASUREITEM message for user context menus v0.1.1.0+
-//wParam, lParam, return value as for WM_MEASUREITEM
-//This is for displaying the icons by the menu items. If you don't call this
-//and clist/menudrawitem whne drawing a menu returned by one of the three menu
-//services below then it'll work but you won't get any icons
+/////////////////////////////////////////////////////////////////////////////////////////
+// Removes a menu item from genmenu
+// Returns 0 on success,-1 on failure.
+// You must free ownerdata before this call.
+// If MenuItemHandle is root, all children will be removed too.
-EXTERN_C MIR_APP_DLL(BOOL) Menu_MeasureItem(MEASUREITEMSTRUCT *mis);
+EXTERN_C MIR_APP_DLL(int) Menu_RemoveItem(HGENMENU hMenuItem);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// changes menu item's visibility
-//process a WM_DRAWITEM message for user context menus v0.1.1.0+
-//wParam, lParam, return value as for WM_MEASUREITEM
-//See comments for clist/menumeasureitem
+EXTERN_C MIR_APP_DLL(void) Menu_ShowItem(HGENMENU hMenuItem, bool bShow);
-EXTERN_C MIR_APP_DLL(BOOL) Menu_DrawItem(DRAWITEMSTRUCT *dis);
+/////////////////////////////////////////////////////////////////////////////////////////
+// turns a menu item's check on & off
+
+EXTERN_C MIR_APP_DLL(void) Menu_SetChecked(HGENMENU hMenuItem, bool bSet);
/////////////////////////////////////////////////////////////////////////////////////////
// Creates a new menu object
@@ -251,6 +197,7 @@ __forceinline int Menu_ConfigureObject(HANDLE hMenu, int iSetting, LPCSTR pszVal
#define MCI_OPT_UNIQUENAME 1 // a unique name to menuitem(used to store it in database when enabled OPT_USERDEFINEDITEMS)
#define MCI_OPT_HOTKEY 2 // DWORD value = MAKELONG(VK_*, VK_SHIFT)
+#define MCI_OPT_EXECPARAM 3 // INT_PTR or void*, associated with this item
EXTERN_C MIR_APP_DLL(int) Menu_ConfigureItem(HGENMENU hItem, int iOption, INT_PTR value);
@@ -268,4 +215,5 @@ EXTERN_C MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(const char *szProtoName);
EXTERN_C MIR_APP_DLL(void) KillModuleMenus(int hLangpack);
-#endif
+#endif // M_GENMENU_H__
+
diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h
index 0bc8575e9d..0b184aef19 100644
--- a/plugins/Alarms/src/stdafx.h
+++ b/plugins/Alarms/src/stdafx.h
@@ -14,6 +14,7 @@
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_popup.h>
+#include <m_clist.h>
#include <m_idle.h>
#include <m_clui.h>
#include <m_cluiframes.h>
diff --git a/plugins/AuthState/src/stdafx.h b/plugins/AuthState/src/stdafx.h
index 213e900423..dc1fceea6d 100644
--- a/plugins/AuthState/src/stdafx.h
+++ b/plugins/AuthState/src/stdafx.h
@@ -26,6 +26,7 @@
#include <newpluginapi.h>
#include <m_database.h>
#include <m_protocols.h>
+#include <m_clist.h>
#include <m_options.h>
#include <m_langpack.h>
#include <m_icolib.h>
diff --git a/plugins/AutoShutdown/src/stdafx.h b/plugins/AutoShutdown/src/stdafx.h
index f557ed810f..65e8dc8596 100644
--- a/plugins/AutoShutdown/src/stdafx.h
+++ b/plugins/AutoShutdown/src/stdafx.h
@@ -51,8 +51,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_file.h>
#include <m_idle.h>
#include <win2k.h>
-#include <m_cluiframes.h>
#include <m_clistint.h>
+#include <m_cluiframes.h>
#include <m_fontservice.h>
#include <m_icolib.h>
#include <m_hotkeys.h>
diff --git a/plugins/BASS_interface/src/stdafx.h b/plugins/BASS_interface/src/stdafx.h
index e69ef0f03c..2afa76cc75 100644
--- a/plugins/BASS_interface/src/stdafx.h
+++ b/plugins/BASS_interface/src/stdafx.h
@@ -12,9 +12,9 @@ Copyright (C) 2010, 2011 tico-tico
#include <m_database.h>
#include <m_options.h>
#include <win2k.h>
-#include <m_cluiframes.h>
#include <m_clui.h>
#include <m_clistint.h>
+#include <m_cluiframes.h>
#include <m_fontservice.h>
#include <m_button_int.h>
#include <m_icolib.h>
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp
index 1bfc47a413..9c35ce146f 100644
--- a/plugins/BasicHistory/src/BasicHistory.cpp
+++ b/plugins/BasicHistory/src/BasicHistory.cpp
@@ -142,9 +142,9 @@ void InitTaskMenuItems()
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.pszService = MS_HISTORY_EXECUTE_TASK;
mi.hParentMenu = hTaskMainMenu;
- mi.popupPosition = pos++;
mi.ptszName = (TCHAR*)taskIt->taskName.c_str();
HGENMENU menu = Menu_AddMainMenuItem(&mi);
+ Menu_ConfigureItem(menu, MCI_OPT_EXECPARAM, pos++);
taskMenus.push_back(menu);
}
}
diff --git a/plugins/Boltun/src/stdafx.h b/plugins/Boltun/src/stdafx.h
index 06ca9c2e2e..e75e59ffdd 100644
--- a/plugins/Boltun/src/stdafx.h
+++ b/plugins/Boltun/src/stdafx.h
@@ -29,13 +29,14 @@
#include <string>
#include <list>
-#include "newpluginapi.h"
-#include "m_clist.h"
-#include "m_system_cpp.h"
-#include "m_database.h"
-#include "m_options.h"
-#include "m_langpack.h"
-#include "m_skin.h"
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_system_cpp.h>
+#include <m_database.h>
+#include <m_genmenu.h>
+#include <m_options.h>
+#include <m_langpack.h>
+#include <m_skin.h>
#include "resource.h"
#include "version.h"
diff --git a/plugins/Clist_modern/clist_modern_10.vcxproj b/plugins/Clist_modern/clist_modern_10.vcxproj
index f0bab6adda..cf99c372d8 100644
--- a/plugins/Clist_modern/clist_modern_10.vcxproj
+++ b/plugins/Clist_modern/clist_modern_10.vcxproj
@@ -194,9 +194,6 @@
<ClCompile Include="src\CLUIFrames\cluiframes.cpp">
<PrecompiledHeaderFile>../hdr/modern_commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
- <ClCompile Include="src\CLUIFrames\framesmenu.cpp">
- <PrecompiledHeaderFile>../hdr/modern_commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
<ClCompile Include="src\CLUIFrames\groupmenu.cpp">
<PrecompiledHeaderFile>../hdr/modern_commonheaders.h</PrecompiledHeaderFile>
</ClCompile>
diff --git a/plugins/Clist_modern/clist_modern_10.vcxproj.filters b/plugins/Clist_modern/clist_modern_10.vcxproj.filters
index e6e68ac8f9..7c1674cd34 100644
--- a/plugins/Clist_modern/clist_modern_10.vcxproj.filters
+++ b/plugins/Clist_modern/clist_modern_10.vcxproj.filters
@@ -153,9 +153,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_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index 06cb843063..8f364c467f 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -758,7 +758,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp
CLISTMENUITEM mi = { 0 };
mi.hParentMenu = root;
- mi.popupPosition = frameid;
+ // mi.popupPosition = frameid; !!!!!!!!!!!!!!!!!!!!!!!!!!
mi.position = popuppos++;
mi.pszName = LPGEN("&Visible");
mi.flags = CMIF_ROOTHANDLE | CMIF_CHECKED;
@@ -3526,8 +3526,6 @@ int LoadCLUIFramesModule(void)
g_nFramesCount = 0;
- InitFramesMenus();
-
HookEvent(ME_SYSTEM_MODULESLOADED, CLUIFrameOnModulesLoad);
HookEvent(ME_CLIST_PREBUILDFRAMEMENU, CLUIFramesModifyContextMenuForFrame);
HookEvent(ME_CLIST_PREBUILDMAINMENU, CLUIFrameOnMainMenuBuild);
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
index b9f6f06870..b901fa7678 100644
--- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
@@ -62,8 +62,8 @@ INT_PTR BuildGroupMenu(WPARAM, LPARAM)
static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM *)lParam;
if (!pcli->pfnConvertMenu(mi, &tmi))
return NULL;
@@ -73,7 +73,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
//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,12 +89,6 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
return (INT_PTR)hNewItem;
}
-int GroupMenuCheckService(WPARAM, LPARAM)
-{
- //not used
- return 0;
-};
-
INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
{
MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
@@ -149,7 +143,7 @@ INT_PTR FreeOwnerDataGroupMenu(WPARAM, LPARAM lParam)
INT_PTR HideGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
+ 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;
@@ -157,17 +151,15 @@ INT_PTR HideGroupsHelper(WPARAM, LPARAM)
INT_PTR UseGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_USEGROUPS);
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
db_set_b(NULL, "CList", "UseGroups", (BYTE)newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
+ SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal,0);
return 0;
}
INT_PTR HideOfflineRootHelper(WPARAM, LPARAM)
{
- SendMessage(
- pcli->hwndContactTree,
- CLM_SETHIDEOFFLINEROOT,
+ SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT,
!SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0),
0);
return 0;
@@ -199,12 +191,18 @@ static int OnBuildGroupMenu(WPARAM, LPARAM)
return 0;
}
-static IconItemT iconItem = { LPGENT("New group"), "NewGroup", IDI_NEWGROUP2 };
+static IconItemT iconItem[] =
+{
+ { LPGENT("New group"), "NewGroup", IDI_NEWGROUP2 }
+};
void GroupMenus_Init(void)
{
- Icon_RegisterT(g_hInst, LPGENT("Contact list"), &iconItem, 1);
+ Icon_RegisterT(g_hInst, LPGENT("Contact list"), iconItem, _countof(iconItem));
+}
+void InitGroupMenus(void)
+{
CreateServiceFunction("CLISTMENUSGroup/ExecService", GroupMenuExecService);
CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu", FreeOwnerDataGroupMenu);
CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService", GroupMenuonAddService);
@@ -226,7 +224,7 @@ void GroupMenus_Init(void)
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
- //add exit command to menu
+ // add exit command to menu
GroupMenuParam gmp;
CLISTMENUITEM mi = { 0 };
@@ -250,13 +248,13 @@ void GroupMenus_Init(void)
mi.position = 300000;
mi.pszService = "";
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MAINMENU);
mi.pszName = LPGEN("&Main menu");
hGroupMainMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
mi.position = 300100;
mi.pszService = "";
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS); // eternity #004
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_STATUS);
mi.pszName = LPGEN("&Status");
hGroupStatusMenuItemProxy = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
@@ -274,10 +272,10 @@ void GroupMenus_Init(void)
mi.flags = 0;
mi.position = 100000;
- mi.icolibItem = iconItem.hIcolib;
+ mi.icolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
mi.pszName = LPGEN("&New group");
- hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0, (LPARAM)&mi);
+ hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
mi.position = 100001;
@@ -375,7 +373,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
//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;
@@ -472,7 +470,7 @@ void InitSubGroupMenus(void)
CLISTMENUITEM mi = { 0 };
mi.position = 1000;
- mi.icolibItem = iconItem.hIcolib;
+ mi.icolibItem = iconItem[0].hIcolib;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
mi.pszName = LPGEN("&New subgroup");
gmp.lParam = 0;
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
index d67cacb842..7ea8b2d8dc 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
@@ -201,7 +201,6 @@ int GetContactIconC(ClcCacheEntry *cacheEntry); //
int GetContactIndex(ClcGroup *group, ClcContact *contact); //clcidents.c
int GetStatusForContact(MCONTACT hContact, char *szProto); //clistsettings.c
int InitCustomMenus(void); //clistmenus.c
-int InitFramesMenus(void); //framesmenus.c
int LoadMoveToGroup(); //movetogroup.c
int LoadStatusBarData(); //modern_statusbar.c
int MenuModulesLoaded(WPARAM wParam, LPARAM lParam); //clistmenu.c
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 77de5d473f..fb18a985cd 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -138,8 +138,8 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
mi.icolibItem = iconList[i].hIcolib;
mi.ptszName = rates[i];
mi.pszService = CLUI_FAVSETRATE;
- mi.popupPosition = i;
hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hFavoriteContactMenuItems[i], MCI_OPT_EXECPARAM, i);
}
}
@@ -149,10 +149,10 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
Menu_ModifyItem(hShowIfOflineItem, NULL, INVALID_HANDLE_VALUE, mi.flags);
else {
mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
- mi.popupPosition = i + 100000000;
mi.position = -100000000;
mi.ptszName = LPGENT("Show even if offline");
hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hShowIfOflineItem, MCI_OPT_EXECPARAM, i + 100000000);
}
return 0;
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";
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp
index 3ab828ca0f..cbbc44a885 100644
--- a/plugins/CrashDumper/src/crshdmp.cpp
+++ b/plugins/CrashDumper/src/crshdmp.cpp
@@ -256,7 +256,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
}
CLISTMENUITEM mi = { 0 };
- mi.popupPosition = 2000089999;
+ // mi.popupPosition = 2000089999; !!!!!!!!!!!!!!!!!!!!!!!
mi.position = 2000089999;
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
mi.icolibItem = GetIconHandle(IDI_VI);
@@ -266,7 +266,6 @@ static int ModulesLoaded(WPARAM, LPARAM)
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
mi.hParentMenu = hMenuRoot;
- mi.popupPosition = 0;
mi.position = 2000089995;
mi.ptszName = LPGENT("Copy to clipboard");
@@ -286,21 +285,18 @@ static int ModulesLoaded(WPARAM, LPARAM)
mi.pszService = MS_CRASHDUMPER_VIEWINFO;
Menu_AddMainMenuItem(&mi);
- mi.popupPosition = 1;
mi.position = 2000089998;
mi.ptszName = LPGENT("Show with DLLs");
mi.icolibItem = GetIconHandle(IDI_VIUPLOAD);
mi.pszService = MS_CRASHDUMPER_VIEWINFO;
- Menu_AddMainMenuItem(&mi);
+ Menu_ConfigureItem(Menu_AddMainMenuItem(&mi), MCI_OPT_EXECPARAM, 1);
- mi.popupPosition = 0;
mi.position = 2000089999;
mi.ptszName = LPGENT("Upload");
mi.icolibItem = GetIconHandle(IDI_VIUPLOAD);
mi.pszService = MS_CRASHDUMPER_UPLOAD;
Menu_AddMainMenuItem(&mi);
- mi.popupPosition = 0;
mi.position = 2000089999;
mi.ptszName = LPGENT("Copy link to clipboard");
mi.icolibItem = GetIconHandle(IDI_LINKTOCLIP);//need icon
@@ -315,12 +311,11 @@ static int ModulesLoaded(WPARAM, LPARAM)
Menu_AddMainMenuItem(&mi);
}
- mi.popupPosition = 1;
mi.position = 2000099991;
mi.ptszName = LPGENT("Open online Version Info");
mi.icolibItem = Skin_GetIconHandle(SKINICON_EVENT_URL);
mi.pszService = MS_CRASHDUMPER_URL;
- Menu_AddMainMenuItem(&mi);
+ Menu_ConfigureItem(Menu_AddMainMenuItem(&mi), MCI_OPT_EXECPARAM, 1);
HOTKEYDESC hk = { 0 };
hk.cbSize = sizeof(hk);
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp
index f039edde87..f0f4efad27 100644
--- a/plugins/FTPFileYM/src/ftpfile.cpp
+++ b/plugins/FTPFileYM/src/ftpfile.cpp
@@ -122,8 +122,8 @@ void InitMenuItems()
}
mi.icolibItem = iconList[i].hIcolib;
- mi.popupPosition = i + 1000;
hSubMenu[i] = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hSubMenu[i], MCI_OPT_EXECPARAM, i + 1000);
mi.flags |= CMIF_ROOTHANDLE;
mi.hParentMenu = hMainMenu;
@@ -131,9 +131,9 @@ void InitMenuItems()
mi2.hParentMenu = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.popupPosition = mi2.position = i + UploadJob::FTP_RAWFILE;
mi2.ptszName = LPGENT("Upload file(s)");
- Menu_AddContactMenuItem(&mi2);
+ HGENMENU tmp = Menu_AddContactMenuItem(&mi2);
+ Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, mi2.position = i + UploadJob::FTP_RAWFILE);
mi2.pszService = MS_FTPFILE_MAINMENU;
mi2.hParentMenu = hMainSubMenu[i];
@@ -141,9 +141,9 @@ void InitMenuItems()
mi2.hParentMenu = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.popupPosition = i + UploadJob::FTP_ZIPFILE;
mi2.ptszName = LPGENT("Zip and upload file(s)");
- Menu_AddContactMenuItem(&mi2);
+ tmp = Menu_AddContactMenuItem(&mi2);
+ Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, i + UploadJob::FTP_ZIPFILE);
mi2.pszService = MS_FTPFILE_MAINMENU;
mi2.hParentMenu = hMainSubMenu[i];
@@ -151,9 +151,9 @@ void InitMenuItems()
mi2.hParentMenu = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.popupPosition = i + UploadJob::FTP_ZIPFOLDER;
mi2.ptszName = LPGENT("Zip and upload folder");
- Menu_AddContactMenuItem(&mi2);
+ tmp = Menu_AddContactMenuItem(&mi2);
+ Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, i + UploadJob::FTP_ZIPFOLDER);
mi2.pszService = MS_FTPFILE_MAINMENU;
mi2.hParentMenu = hMainSubMenu[i];
diff --git a/plugins/HistoryStats/src/main.cpp b/plugins/HistoryStats/src/main.cpp
index fceb2edb9b..28536605e8 100644
--- a/plugins/HistoryStats/src/main.cpp
+++ b/plugins/HistoryStats/src/main.cpp
@@ -161,8 +161,7 @@ void AddMainMenu()
1910000000,
IconLib::getIcon(IconLib::iiMenuCreateStatistics),
con::SvcCreateStatistics,
- bInPopup ? LPGENT("Statistics") : NULL, // MEMO: implicit translation
- bInPopup ? 1910000000 : 0);
+ bInPopup ? LPGENT("Statistics") : NULL);
g_hMenuShowStatistics = mu::clist::addMainMenuItem(
LPGENT("Show statistics"), // MEMO: implicit translation
@@ -170,8 +169,7 @@ void AddMainMenu()
1910000001,
IconLib::getIcon(IconLib::iiMenuShowStatistics),
con::SvcShowStatistics,
- bInPopup ? LPGENT("Statistics") : NULL, // MEMO: implicit translation
- bInPopup ? 1910000000 : 0);
+ bInPopup ? LPGENT("Statistics") : NULL);
g_hMenuConfigure = mu::clist::addMainMenuItem(
bInPopup ? LPGENT("Configure...") : LPGENT("Configure statistics..."), // MEMO: implicit translation
@@ -179,8 +177,7 @@ void AddMainMenu()
1910000002,
IconLib::getIcon(IconLib::iiMenuConfigure),
con::SvcConfigure,
- bInPopup ? LPGENT("Statistics") : NULL, // MEMO: implicit translation
- bInPopup ? 1910000000 : 0);
+ bInPopup ? LPGENT("Statistics") : NULL);
}
/*
diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp
index 0edf3fa601..0446013c4d 100644
--- a/plugins/HistoryStats/src/mu_common.cpp
+++ b/plugins/HistoryStats/src/mu_common.cpp
@@ -12,7 +12,7 @@ namespace mu
namespace clist
{
- HGENMENU addMainMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, const TCHAR* pszPopupName /* = NULL */, int popupPosition /* = 0 */)
+ HGENMENU addMainMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, const TCHAR* pszPopupName /* = NULL */)
{
// TODO: support for unicode-core with unicode-aware CList
CLISTMENUITEM mi = { 0 };
@@ -22,7 +22,6 @@ namespace mu
mi.hIcon = hIcon;
mi.pszService = const_cast<char*>(pszService);
mi.ptszPopupName = (TCHAR*)pszPopupName;
- mi.popupPosition = popupPosition;
return Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h
index 080b0fb931..e05b36c078 100644
--- a/plugins/HistoryStats/src/mu_common.h
+++ b/plugins/HistoryStats/src/mu_common.h
@@ -13,7 +13,7 @@ namespace mu
namespace clist
{
- HGENMENU addMainMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, const TCHAR* pszPopupName = NULL, int popupPosition = 0);
+ HGENMENU addMainMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, const TCHAR* pszPopupName = NULL);
HGENMENU addContactMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, const char* pszContactOwner = NULL);
const TCHAR* getContactDisplayName(MCONTACT hContact);
const TCHAR* getStatusModeDescription(int nStatusMode);
diff --git a/plugins/ListeningTo/src/commons.h b/plugins/ListeningTo/src/commons.h
index 8ac3c7d235..895d445d3b 100644
--- a/plugins/ListeningTo/src/commons.h
+++ b/plugins/ListeningTo/src/commons.h
@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA.
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_database.h>
+#include <m_clistint.h>
#include <m_options.h>
#include <m_xstatus.h>
#include <m_clui.h>
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 8ca0d1aead..116786208f 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA.
#include "commons.h"
+CLIST_INTERFACE *pcli;
int hLangpack;
PLUGININFOEX pluginInfo={
@@ -56,10 +57,10 @@ int TopToolBarLoaded(WPARAM wParam, LPARAM lParam);
int SettingChanged(WPARAM wParam,LPARAM lParam);
INT_PTR MainMenuClicked(WPARAM wParam, LPARAM lParam);
-BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal = FALSE);
+bool ListeningToEnabled(char *proto, bool ignoreGlobal = false);
INT_PTR ListeningToEnabled(WPARAM wParam, LPARAM lParam);
INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam);
-INT_PTR EnableListeningTo(char *proto = NULL,BOOL enabled = FALSE);
+INT_PTR EnableListeningTo(char *proto = NULL, bool enabled = false);
INT_PTR GetTextFormat(WPARAM wParam,LPARAM lParam);
TCHAR* GetParsedFormat(LISTENINGTOINFO *lti);
INT_PTR GetParsedFormat(WPARAM wParam,LPARAM lParam);
@@ -112,6 +113,7 @@ static IconItem iconList[] =
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
+ mir_getCLI();
CoInitialize(NULL);
@@ -157,7 +159,7 @@ extern "C" int __declspec(dllexport) Unload(void)
void UpdateGlobalStatusMenus()
{
- BOOL enabled = ListeningToEnabled(NULL, TRUE);
+ bool enabled = ListeningToEnabled(NULL, true);
Menu_SetChecked(proto_items[0].hMenu, enabled);
Menu_EnableItem(proto_items[0].hMenu, opts.enable_sending);
@@ -193,7 +195,7 @@ void RebuildMenu()
CLISTMENUITEM mi = { 0 };
mi.position = 100000 + i;
mi.hParentMenu = hMainMenuGroup;
- mi.popupPosition = 500080000 + i;
+ mi.position = 500080000 + i;
mi.pszService = MS_LISTENINGTO_MAINMENU;
mi.ptszName = text;
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR
@@ -299,7 +301,7 @@ int ModulesLoaded(WPARAM, LPARAM)
hMainMenuGroup = Menu_AddMainMenuItem(&mi);
mi.hParentMenu = hMainMenuGroup;
- mi.popupPosition = 500080000;
+ // mi.popupPosition = 500080000; !!!!!!!!!!!!!!!
mi.position = 0;
mi.pszService = MS_LISTENINGTO_MAINMENU;
mi.hIcon = NULL;
@@ -307,7 +309,7 @@ int ModulesLoaded(WPARAM, LPARAM)
// Add all protos
mi.ptszName = LPGENT("Send to all protocols");
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR
- | (ListeningToEnabled(NULL, TRUE) ? CMIF_CHECKED : 0)
+ | (ListeningToEnabled(NULL, true) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
proto_items.resize(1);
proto_items[0].hMenu = Menu_AddMainMenuItem(&mi);
@@ -441,14 +443,14 @@ int PreShutdown(WPARAM, LPARAM)
static INT_PTR TopToolBarClick(WPARAM, LPARAM)
{
- EnableListeningTo(NULL, !ListeningToEnabled(NULL, TRUE));
+ EnableListeningTo(NULL, !ListeningToEnabled(NULL, true));
return 0;
}
// Toptoolbar hook to put an icon in the toolbar
int TopToolBarLoaded(WPARAM, LPARAM)
{
- BOOL enabled = ListeningToEnabled(NULL, TRUE);
+ BOOL enabled = ListeningToEnabled(NULL, true);
CreateServiceFunction(MS_LISTENINGTO_TTB, TopToolBarClick);
@@ -477,7 +479,7 @@ INT_PTR MainMenuClicked(WPARAM wParam, LPARAM lParam)
return 0;
}
-BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
+bool ListeningToEnabled(char *proto, bool ignoreGlobal)
{
if (!ignoreGlobal && !opts.enable_sending)
return FALSE;
@@ -498,7 +500,7 @@ BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
{
char setting[256];
mir_snprintf(setting, "%sEnabled", proto);
- return (BOOL) db_get_b(NULL, MODULE_NAME, setting, FALSE);
+ return db_get_b(NULL, MODULE_NAME, setting, false) != 0;
}
}
@@ -684,7 +686,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL)
}
}
-INT_PTR EnableListeningTo(char *proto,BOOL enabled)
+INT_PTR EnableListeningTo(char *proto, bool enabled)
{
if (!loaded)
return -1;
@@ -727,12 +729,12 @@ INT_PTR EnableListeningTo(char *proto,BOOL enabled)
INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam)
{
- return EnableListeningTo((char*)wParam,(BOOL)lParam);
+ return EnableListeningTo((char*)wParam, lParam != 0);
}
INT_PTR HotkeysEnable(WPARAM,LPARAM lParam)
{
- return EnableListeningTo(lParam, TRUE);
+ return EnableListeningTo(lParam, true);
}
INT_PTR HotkeysDisable(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/ListeningTo/src/options.h b/plugins/ListeningTo/src/options.h
index b0848e871c..8c14185eb3 100644
--- a/plugins/ListeningTo/src/options.h
+++ b/plugins/ListeningTo/src/options.h
@@ -42,22 +42,22 @@ Boston, MA 02111-1307, USA.
struct Options {
- BOOL enable_sending;
- BOOL enable_music;
- BOOL enable_radio;
- BOOL enable_video;
- BOOL enable_others;
+ bool enable_sending;
+ bool enable_music;
+ bool enable_radio;
+ bool enable_video;
+ bool enable_others;
TCHAR templ[1024];
TCHAR unknown[128];
- BOOL override_contact_template;
- BOOL show_adv_icon;
+ bool override_contact_template;
+ bool show_adv_icon;
int adv_icon_slot;
- BOOL get_info_from_watrack;
- BOOL enable_other_players;
- BOOL enable_code_injection;
+ bool get_info_from_watrack;
+ bool enable_other_players;
+ bool enable_code_injection;
int time_to_pool;
WORD xstatus_set;
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 846b1bb65d..8937e6f198 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -737,13 +737,15 @@ static HGENMENU AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD fl
{
CLISTMENUITEM mi = { 0 };
mi.hParentMenu = hRoot;
- mi.popupPosition = param;
mi.position = pos;
mi.ptszName = name;
mi.hIcon = icon;
mi.flags = CMIF_UNICODE | CMIF_ROOTHANDLE | flag;
mi.pszService = service;
- return Menu_AddContactMenuItem(&mi);
+
+ HGENMENU res = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(res, MCI_OPT_EXECPARAM, param);
+ return res;
}
static void ModifySubmenuItem(HGENMENU hItem, int checked, int hidden)
diff --git a/plugins/MirOTR/src/stdafx.h b/plugins/MirOTR/src/stdafx.h
index 450ebdc342..b675f3314c 100644
--- a/plugins/MirOTR/src/stdafx.h
+++ b/plugins/MirOTR/src/stdafx.h
@@ -27,6 +27,7 @@ using namespace std;
#include <m_langpack.h>
#include <m_database.h>
#include <m_message.h>
+#include <m_clist.h>
#include <m_popup.h>
#include <m_protosvc.h>
#include <m_contacts.h>
diff --git a/plugins/MyDetails/src/commons.h b/plugins/MyDetails/src/commons.h
index 735b1751ae..afefec9dd1 100644
--- a/plugins/MyDetails/src/commons.h
+++ b/plugins/MyDetails/src/commons.h
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA.
#include <m_skin.h>
#include <m_protosvc.h>
#include <m_database.h>
+#include <m_clist.h>
#include <m_langpack.h>
#include <m_contacts.h>
#include <m_options.h>
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp
index efeaad5c0f..f4f98dd258 100644
--- a/plugins/MyDetails/src/frame.cpp
+++ b/plugins/MyDetails/src/frame.cpp
@@ -329,13 +329,13 @@ int CreateFrame()
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_TCHAR;
- mi.popupPosition = -0x7FFFFFFF;
mi.ptszPopupName = LPGENT("My details");
mi.position = 1; // 500010000
mi.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERDETAILS);
mi.ptszName = LPGENT("Show my details");
mi.pszService = MODULE_NAME"/ShowHideMyDetails";
hMenuShowHideFrame = Menu_AddMainMenuItem(&mi);
+ Menu_ConfigureItem(hMenuShowHideFrame, MCI_OPT_EXECPARAM, -0x7FFFFFFF);
if (db_get_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 1) == 1) {
ShowWindow(hwnd_container, SW_SHOW);
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp
index 88dc26a77c..9fb9ce467c 100644
--- a/plugins/MyDetails/src/mydetails.cpp
+++ b/plugins/MyDetails/src/mydetails.cpp
@@ -88,7 +88,7 @@ static int MainInit(WPARAM, LPARAM)
// Add options to menu
CLISTMENUITEM mi = { 0 };
- mi.popupPosition = 500050000;
+ mi.position = 500050000;
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
mi.ptszName = LPGENT("My details");
@@ -96,7 +96,6 @@ static int MainInit(WPARAM, LPARAM)
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
mi.hParentMenu = hMenuRoot;
- mi.popupPosition = 0;
mi.icolibItem = NULL;
if (protocols->CanSetAvatars()) {
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index 5eab194bd1..5a404dce92 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -645,7 +645,6 @@ int MirandaLoaded(WPARAM, LPARAM)
mi.flags = CMIF_TCHAR | CMIF_ROOTHANDLE;
mi.hParentMenu = g_hToggleSOEContactMenuItem;
- mi.popupPosition = 1000020000;
mi.position = 1000020000;
mi.icolibItem = iconList[1].hIcolib;
diff --git a/plugins/New_GPG/src/commonheaders.h b/plugins/New_GPG/src/commonheaders.h
index 6cc28e31b6..c3ff37eede 100644
--- a/plugins/New_GPG/src/commonheaders.h
+++ b/plugins/New_GPG/src/commonheaders.h
@@ -63,6 +63,7 @@ using std::fstream;
#include <m_jabber.h>
#include <m_icq.h>
#include <m_message.h>
+#include <m_clist.h>
#include <m_cluiframes.h>
#include <m_icolib.h>
#include <m_extraicons.h>
diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp
index 89fd65cdd1..b92ec6f3e5 100644
--- a/plugins/NewsAggregator/Src/Menus.cpp
+++ b/plugins/NewsAggregator/Src/Menus.cpp
@@ -29,7 +29,7 @@ void InitMenu()
// adding main menu items
mi.ptszPopupName = LPGENT("News Aggregator");
- mi.popupPosition = 500099000;
+ // mi.popupPosition = 500099000; !!!!!!!!!!!!!!!!!!!!!!!
mi.position = 10100001;
if (db_get_b(NULL, MODULE, "AutoUpdate", 1))
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp
index 4610f12156..35793bfe8d 100644
--- a/plugins/Non-IM Contact/src/main.cpp
+++ b/plugins/Non-IM Contact/src/main.cpp
@@ -144,7 +144,7 @@ extern "C" __declspec(dllexport) int Load()
CLISTMENUITEM mi = { 0 };
mi.position = 600090000;
mi.pszPopupName = LPGEN("&Non-IM Contact");
- mi.popupPosition = 600090000;
+ // mi.popupPosition = 600090000; !!!!!!!!!!!!!!!!!!!!
mi.pszName = LPGEN("&Add Non-IM Contact");
mi.pszService = "AddLCcontact";
mi.icolibItem = icoList[0].hIcolib;
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index 5ff5cf9a86..16aa865de1 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -337,7 +337,7 @@ extern "C" int __declspec(dllexport) Load(void)
// Add contact menu entry
CLISTMENUITEM mi = { 0 };
- mi.popupPosition = 500085000;
+ // mi.popupPosition = 500085000; !!!!!!!!!!!!!!!!!!!!!
mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR;
mi.position = -500050004;
mi.icolibItem = iconList[0].hIcolib;
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp
index a19f1f2e7c..21e4945c32 100644
--- a/plugins/PasteIt/src/PasteIt.cpp
+++ b/plugins/PasteIt/src/PasteIt.cpp
@@ -303,17 +303,15 @@ void InitMenuItems()
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
mi.pszService = MS_PASTEIT_CONTACTMENU;
mi.hParentMenu = hContactMenu;
- mi.popupPosition = FROM_CLIPBOARD;
mi.ptszName = LPGENT("Paste from clipboard");
- Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(Menu_AddContactMenuItem(&mi), MCI_OPT_EXECPARAM, FROM_CLIPBOARD);
- mi.popupPosition = FROM_FILE;
mi.ptszName = LPGENT("Paste from file");
- Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(Menu_AddContactMenuItem(&mi), MCI_OPT_EXECPARAM, FROM_FILE);
- mi.popupPosition = DEF_PAGES_START - 1;
mi.ptszName = LPGENT("Default web page");
HGENMENU hDefWebMenu = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hDefWebMenu, MCI_OPT_EXECPARAM, DEF_PAGES_START - 1);
CLISTMENUITEM mi2 = { 0 };
mi2.pszService = MS_PASTEIT_CONTACTMENU;
@@ -324,8 +322,8 @@ void InitMenuItems()
if (Options::instance->defWeb == i)
mi2.flags |= CMIF_CHECKED;
mi2.ptszName = pasteToWebs[i]->GetName();
- mi2.popupPosition = mi2.position = DEF_PAGES_START + i;
hWebPageMenus[i] = Menu_AddContactMenuItem(&mi2);
+ Menu_ConfigureItem(hWebPageMenus[i], MCI_OPT_EXECPARAM, mi2.position = DEF_PAGES_START + i);
}
hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
diff --git a/plugins/Ping/src/common.h b/plugins/Ping/src/common.h
index b044c440d5..79dfbcf6f5 100644
--- a/plugins/Ping/src/common.h
+++ b/plugins/Ping/src/common.h
@@ -23,8 +23,8 @@
#include <m_database.h>
#include <m_protosvc.h>
#include <m_clui.h>
-#include <m_cluiframes.h>
#include <m_clistint.h>
+#include <m_cluiframes.h>
#include <m_fontservice.h>
#include <m_icolib.h>
#include <win2k.h>
diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp
index 8cb8855d3e..564d2ee8bf 100644
--- a/plugins/Ping/src/menu.cpp
+++ b/plugins/Ping/src/menu.cpp
@@ -8,7 +8,7 @@ void InitMenus()
// main menu
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_TCHAR;
- mi.popupPosition = 500099900;
+ // mi.popupPosition = 500099900; !!!!!!!!!!!!!!!!!!!!
mi.ptszPopupName = LPGENT("Ping");
mi.position = 2000060000;
mi.hIcon = hIconResponding;
@@ -16,9 +16,7 @@ void InitMenus()
mi.pszService = PLUG "/EnableAll";
Menu_AddMainMenuItem(&mi);
- mi.popupPosition = 500299901;
mi.position = 2000060001;
- mi.popupPosition = 0;
mi.hIcon = hIconDisabled;
mi.ptszName = LPGENT("Disable all pings");
mi.pszService = PLUG "/DisableAll";
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp
index 1534edbfee..e5c6061d6b 100644
--- a/plugins/Ping/src/pingthread.cpp
+++ b/plugins/Ping/src/pingthread.cpp
@@ -993,7 +993,7 @@ void InitList()
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_TCHAR;
- mi.popupPosition = 1000200001;
+ // mi.popupPosition = 1000200001; !!!!!!!!!!!!!
mi.ptszPopupName = LPGENT("Ping");
mi.position = 3000320001;
mi.hIcon = 0;//LoadIcon( hInst, 0);
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 2adce19774..ab37a4f16b 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -201,7 +201,6 @@ void InitMenuItems(void)
// Popup History
CreateServiceFunction(MENUCOMMAND_HISTORY, svcShowHistory);
mi.position = 1000000000;
- mi.popupPosition = 1999990000;
mi.ptszName = LPGENT("Popup History");
mi.hIcon = IcoLib_GetIcon(ICO_HISTORY, 0);
mi.pszService = MENUCOMMAND_HISTORY;
diff --git a/plugins/ProfileManager/src/Common.h b/plugins/ProfileManager/src/Common.h
index 1d8c64d6bc..322407e554 100644
--- a/plugins/ProfileManager/src/Common.h
+++ b/plugins/ProfileManager/src/Common.h
@@ -5,6 +5,7 @@
#include <newpluginapi.h>
#include <m_langpack.h>
#include <m_genmenu.h>
+#include <m_clist.h>
#include <m_utils.h>
#include <win2k.h>
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp
index 23c9b5b191..837220368f 100644
--- a/plugins/Quotes/src/Forex.cpp
+++ b/plugins/Quotes/src/Forex.cpp
@@ -159,17 +159,17 @@ namespace
}
mi.ptszName = LPGENT("Refresh");
- mi.popupPosition = 0;
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_REFRESH);
mi.pszService = "Quotes/RefreshContact";
g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(g_hMenuRefresh, MCI_OPT_EXECPARAM, INT_PTR(0));
CreateServiceFunction(mi.pszService, QuotesMenu_RefreshContact);
mi.ptszName = LPGENT("Open Log File...");
- mi.popupPosition = 1;
mi.icolibItem = NULL;
mi.pszService = "Quotes/OpenLogFile";
g_hMenuOpenLogFile = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(g_hMenuOpenLogFile, MCI_OPT_EXECPARAM, 1);
CreateServiceFunction(mi.pszService, QuotesMenu_OpenLogFile);
#ifdef CHART_IMPLEMENT
@@ -182,14 +182,14 @@ namespace
#endif
mi.ptszName = LPGENT("Edit Settings...");
-#ifdef CHART_IMPLEMENT
- mi.popupPosition = 3;
-#else
- mi.popupPosition = 2;
-#endif
mi.icolibItem = NULL;
mi.pszService = "Quotes/EditSettings";
g_hMenuEditSettings = Menu_AddContactMenuItem(&mi);
+#ifdef CHART_IMPLEMENT
+ Menu_ConfigureItem(g_hMenuEditSettings, MCI_OPT_EXECPARAM, 3);
+#else
+ Menu_ConfigureItem(g_hMenuEditSettings, MCI_OPT_EXECPARAM, 2);
+#endif
CreateServiceFunction(mi.pszService, QuotesMenu_EditSettings);
}
diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h
index 7ee55294c5..ecc31d20b9 100644
--- a/plugins/Quotes/src/stdafx.h
+++ b/plugins/Quotes/src/stdafx.h
@@ -23,6 +23,7 @@
#include <m_database.h>
#include <win2k.h>
#include <m_xml.h>
+#include <m_clist.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_protosvc.h>
diff --git a/plugins/Restart/src/Common.h b/plugins/Restart/src/Common.h
index 9a508effa5..1f4daccd36 100644
--- a/plugins/Restart/src/Common.h
+++ b/plugins/Restart/src/Common.h
@@ -6,6 +6,7 @@
#include <newpluginapi.h>
#include <m_langpack.h>
#include <m_genmenu.h>
+#include <m_clist.h>
#include <m_utils.h>
#include <win2k.h>
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h
index 18908fb146..482289edce 100644
--- a/plugins/SecureIM/src/commonheaders.h
+++ b/plugins/SecureIM/src/commonheaders.h
@@ -24,6 +24,7 @@
#include <m_database.h>
#include <m_protosvc.h>
#include <m_langpack.h>
+#include <m_clist.h>
#include <m_options.h>
#include <m_skin.h>
#include <m_popup.h>
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index a7f46db025..7fb923a5bb 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -53,11 +53,12 @@ static HGENMENU AddSubItem(HANDLE rootid, LPCSTR name, int pos, int poppos, LPCS
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_ROOTHANDLE | CMIF_HIDDEN;
mi.position = pos;
- mi.popupPosition = poppos;
mi.pszName = (char*)name;
mi.pszPopupName = (char*)rootid;
mi.pszService = (char*)service;
- return Menu_AddContactMenuItem(&mi);
+ HGENMENU res = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(res, MCI_OPT_EXECPARAM, poppos);
+ return res;
}
static int onModuleLoad(WPARAM, LPARAM)
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index 94e87a8682..2eb4e4f36b 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -1463,7 +1463,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam)
mi.position = 2000200000;
Menu_AddStatusMenuItem(&mi);
- mi.popupPosition = 500084000;
+ // mi.popupPosition = 500084000; !!!!!!!!!!!!!!!!!!!!!!!
mi.position = 2000040000;
for (int i = 0; i < count; ++i)
diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h
index 7497c25396..964eea0f8b 100644
--- a/plugins/SmileyAdd/src/general.h
+++ b/plugins/SmileyAdd/src/general.h
@@ -36,6 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <sys/stat.h>
#include <time.h>
#include <gdiplus.h>
+#include <m_clist.h>
#include <commctrl.h>
#include <richedit.h>
#include <delayimp.h>
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp
index 44aed70e7e..51c13ae50d 100644
--- a/plugins/SmileyAdd/src/main.cpp
+++ b/plugins/SmileyAdd/src/main.cpp
@@ -52,7 +52,6 @@ static int ModulesLoaded(WPARAM, LPARAM)
{
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_ROOTHANDLE;
- mi.popupPosition = 2000070050;
mi.position = 2000070050;
mi.icolibItem = icon.hIcolib;
mi.hParentMenu = HGENMENU_ROOT;
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp
index 5dd9c3bf07..44de589741 100644
--- a/plugins/SmileyAdd/src/services.cpp
+++ b/plugins/SmileyAdd/src/services.cpp
@@ -305,10 +305,8 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
continue;
const int ind = i + 3;
-
- mi.position = ind;
- mi.popupPosition = ind;
- mi.ptszName = (TCHAR*)smc[i].GetDisplayName().c_str();
+ mi.position = ind;
+ mi.ptszName = (TCHAR*)smc[i].GetDisplayName().c_str();
if (cat == smc[i].GetName()) {
mi.flags |= CMIF_CHECKED;
@@ -316,27 +314,28 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
}
hMenu = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hMenu, MCI_OPT_EXECPARAM, ind);
menuHandleArray.insert(hMenu);
mi.flags &= ~CMIF_CHECKED;
}
- mi.position = 1;
- mi.popupPosition = 1;
- mi.ptszName = _T("<None>");
+ mi.position = 1;
+ mi.ptszName = _T("<None>");
if (cat == _T("<None>")) {
mi.flags |= CMIF_CHECKED;
nonecheck = false;
}
hMenu = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hMenu, MCI_OPT_EXECPARAM, 1);
menuHandleArray.insert(hMenu);
- mi.position = 2;
- mi.popupPosition = 2;
- mi.ptszName = LPGENT("Protocol specific");
+ mi.position = 2;
+ mi.ptszName = LPGENT("Protocol specific");
if (nonecheck) mi.flags |= CMIF_CHECKED; else mi.flags &= ~CMIF_CHECKED;
hMenu = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(hMenu, MCI_OPT_EXECPARAM, 2);
menuHandleArray.insert(hMenu);
}
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp
index 3daa46c40b..697793b8da 100644
--- a/plugins/StatusPlugins/StartupStatus/profiles.cpp
+++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp
@@ -93,7 +93,7 @@ static int CreateMainMenuItems(WPARAM, LPARAM)
int i, count;
CLISTMENUITEM mi = { 0 };
- mi.popupPosition = 2000100000;
+ mi.position = 2000100000;
mi.flags = CMIF_TCHAR;
mcount = 0;
count = GetProfileCount(0, 0);
diff --git a/plugins/TopToolBar/src/common.h b/plugins/TopToolBar/src/common.h
index e5e4ac6e1e..a7a9322a7d 100644
--- a/plugins/TopToolBar/src/common.h
+++ b/plugins/TopToolBar/src/common.h
@@ -12,8 +12,9 @@
#include <newpluginapi.h>
#include <m_database.h>
#include <m_skin.h>
-#include <m_cluiframes.h>
+#include <m_clist.h>
#include <m_clui.h>
+#include <m_cluiframes.h>
#include <m_clc.h>
#include <m_clistint.h>
#include <m_findadd.h>
diff --git a/plugins/TrafficCounter/src/commonheaders.h b/plugins/TrafficCounter/src/commonheaders.h
index cbdc585e94..4a2a56be57 100644
--- a/plugins/TrafficCounter/src/commonheaders.h
+++ b/plugins/TrafficCounter/src/commonheaders.h
@@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_langpack.h>
#include <m_clui.h>
#include <m_clc.h>
+#include <m_clist.h>
#include <m_options.h>
#include <m_protosvc.h>
#include <m_cluiframes.h>
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp
index cd38f94387..aebdd2bdd1 100644
--- a/plugins/UserInfoEx/src/mir_menuitems.cpp
+++ b/plugins/UserInfoEx/src/mir_menuitems.cpp
@@ -98,7 +98,6 @@ void RebuildContact()
case 5:
//cascade all
mi.position = 1000050000;
- mi.popupPosition = 1000050000;
mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.pszName = MODULELONGNAME;
mhRoot = Menu_AddContactMenuItem(&mi);
@@ -108,7 +107,6 @@ void RebuildContact()
case 9:
//cascade Ex/Import
mi.position = 1000050100;
- mi.popupPosition = 1000050100;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.pszName = LPGEN("Export/import contact");
mhExIm = Menu_AddContactMenuItem(&mi);
@@ -119,7 +117,6 @@ void RebuildContact()
//disable Menu
return;
}
- mi.popupPosition = NULL;
// ContactDetailsPS's menuitem
mi.hParentMenu = mhRoot;
@@ -191,7 +188,6 @@ void RebuildMain()
case 5:
//cascade all
mi.position = 500050000;
- mi.popupPosition = 500050000;
mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.pszName = MODULELONGNAME;
mhRoot = Menu_AddMainMenuItem(&mi);
@@ -201,7 +197,6 @@ void RebuildMain()
case 9:
//cascade Ex/Import
mi.position = 500050000;
- mi.popupPosition = 500050000;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.pszName = LPGEN("Export/import contact");
mhExIm = Menu_AddMainMenuItem(&mi);
@@ -212,7 +207,6 @@ void RebuildMain()
//disable Menue
return;
}
- mi.popupPosition = NULL;
// details dialog
{
@@ -336,7 +330,6 @@ void RebuildGroup()
case 5:
//cascade all
mi.position = 250000;
- mi.popupPosition = 250000;
mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.pszName = MODULELONGNAME;
mhRoot = Menu_AddGroupMenuItem(0, &mi);
@@ -346,7 +339,6 @@ void RebuildGroup()
case 9:
//cascade Ex/Import
mi.position = 250100;
- mi.popupPosition = 250100;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.pszName = LPGEN("Export/import contact");
mhExIm = Menu_AddGroupMenuItem(0, &mi);
@@ -357,7 +349,6 @@ void RebuildGroup()
//disable Menue
return;
}
- mi.popupPosition = NULL;
// VCard's Ex/Import menuitems
{ mi.hParentMenu = mhExIm;
@@ -433,7 +424,6 @@ void RebuildSubGroup()
case 5:
//cascade all
mi.position = 1050000;
- mi.popupPosition = 1050000;
mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.pszName = MODULELONGNAME;
mhRoot = Menu_AddSubGroupMenuItem(0, &mi);
@@ -443,7 +433,6 @@ void RebuildSubGroup()
case 9:
//cascade Ex/Import
mi.position = 1050100;
- mi.popupPosition = 1050100;
mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.pszName = LPGEN("Export/import group");
mhExIm = Menu_AddSubGroupMenuItem(0, &mi);
@@ -454,7 +443,6 @@ void RebuildSubGroup()
//disable Menue
return;
}
- mi.popupPosition = NULL;
// VCard's Ex/Import menuitems
{ mi.hParentMenu = mhExIm;
diff --git a/plugins/Utils/mir_buffer.h b/plugins/Utils/mir_buffer.h
index ac7c909860..c8388bd731 100644
--- a/plugins/Utils/mir_buffer.h
+++ b/plugins/Utils/mir_buffer.h
@@ -463,7 +463,7 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variab
size_t foundLen = i - j + 1;
if (foundLen == 9 && _tcsncmp(&buffer->str[j], _T("%contact%"), 9) == 0)
{
- buffer->replace(j, i + 1, (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
+ buffer->replace(j, i + 1, pcli->pfnGetContactDisplayName(hContact, 0));
}
else if (foundLen == 6 && _tcsncmp(&buffer->str[j], _T("%date%"), 6) == 0)
{
diff --git a/plugins/Watrack/i_gui.inc b/plugins/Watrack/i_gui.inc
index 7b1dd90843..81e4c35beb 100644
--- a/plugins/Watrack/i_gui.inc
+++ b/plugins/Watrack/i_gui.inc
@@ -36,10 +36,10 @@ begin
FillChar(mi, sizeof(mi), 0);
mi.szPopupName.a:=PluginShort;
- mi.hIcon :=IcoLib_GetIcon(IcoBtnEnable,0);
- mi.szName.a :='Disable WATrack';
- mi.pszService :=MS_WAT_PLUGINSTATUS;
- mi.popupPosition:=MenuDisablePos;
+ mi.hIcon :=IcoLib_GetIcon(IcoBtnEnable,0);
+ mi.szName.a :='Disable WATrack';
+ mi.pszService:=MS_WAT_PLUGINSTATUS;
+ mi.position :=MenuDisablePos;
hMenuDisable:=Menu_AddMainMenuItem(@mi);
end;
diff --git a/plugins/Watrack/lastfm/lastfm.pas b/plugins/Watrack/lastfm/lastfm.pas
index 12a144a8a7..ae56647617 100644
--- a/plugins/Watrack/lastfm/lastfm.pas
+++ b/plugins/Watrack/lastfm/lastfm.pas
@@ -183,10 +183,10 @@ begin
FillChar(mi, sizeof(mi), 0);
mi.szPopupName.a:=PluginShort;
- mi.hIcon :=IcoLib_GetIcon(IcoLastFM,0);
- mi.szName.a :='Disable scrobbling';
- mi.pszService :=MS_WAT_LASTFM;
- mi.popupPosition:=500050000;
+ mi.hIcon :=IcoLib_GetIcon(IcoLastFM,0);
+ mi.szName.a :='Disable scrobbling';
+ mi.pszService:=MS_WAT_LASTFM;
+ mi.position :=500050000; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
hMenuLast:=Menu_AddMainMenuItem(@mi);
end;
diff --git a/plugins/Watrack/myshows/myshows.pas b/plugins/Watrack/myshows/myshows.pas
index af79485133..e6c5c6cb21 100644
--- a/plugins/Watrack/myshows/myshows.pas
+++ b/plugins/Watrack/myshows/myshows.pas
@@ -214,10 +214,10 @@ begin
FillChar(mi, sizeof(mi), 0);
mi.szPopupName.a:=PluginShort;
- mi.hIcon :=IcoLib_GetIcon(IcoMyShows,0);
- mi.szName.a :='Disable scrobbling';
- mi.pszService :=MS_WAT_MYSHOWS;
- mi.popupPosition:=500050000;
+ mi.hIcon :=IcoLib_GetIcon(IcoMyShows,0);
+ mi.szName.a :='Disable scrobbling';
+ mi.pszService:=MS_WAT_MYSHOWS;
+ mi.position :=500050000;
hMenuMyShows:=Menu_AddMainMenuItem(@mi);
end;
diff --git a/plugins/Watrack/popup/popups.pas b/plugins/Watrack/popup/popups.pas
index d714facb52..cd548e9e88 100644
--- a/plugins/Watrack/popup/popups.pas
+++ b/plugins/Watrack/popup/popups.pas
@@ -474,11 +474,11 @@ begin
FillChar(mi,SizeOf(mi),0);
mi.szPopupName.a:=PluginShort;
- mi.hIcon :=IcoLib_GetIcon(IcoBtnInfo,0);
- mi.szName.a :='Music Info';
- mi.pszService :=MS_WAT_SHOWMUSICINFO;
- mi.popupPosition:=MenuInfoPos;
- hMenuInfo :=Menu_AddMainMenuItem(@mi);
+ mi.hIcon :=IcoLib_GetIcon(IcoBtnInfo,0);
+ mi.szName.a :='Music Info';
+ mi.pszService:=MS_WAT_SHOWMUSICINFO;
+ mi.position :=MenuInfoPos;
+ hMenuInfo:=Menu_AddMainMenuItem(@mi);
ActionList:=nil;
if ServiceExists(MS_POPUP_ADDPOPUPW)<>0 then
diff --git a/plugins/Watrack/stat/statlog.pas b/plugins/Watrack/stat/statlog.pas
index c1a9fe0a76..ea6b5baf54 100644
--- a/plugins/Watrack/stat/statlog.pas
+++ b/plugins/Watrack/stat/statlog.pas
@@ -583,11 +583,11 @@ begin
FillChar(mi, sizeof(mi), 0);
mi.szPopupName.a:=PluginShort;
- mi.hIcon :=IcoLib_GetIcon(IcoBtnReport,0);
- mi.szName.a :='Create WATrack report';
- mi.pszService :=MS_WAT_MAKEREPORT;
- mi.popupPosition:=MenuReportPos;
- hMenuReport :=Menu_AddMainMenuItem(@mi);
+ mi.hIcon :=IcoLib_GetIcon(IcoBtnReport,0);
+ mi.szName.a :='Create WATrack report';
+ mi.pszService:=MS_WAT_MAKEREPORT;
+ mi.position :=MenuReportPos; // !!!!!!!!!!!!!!!!!!!!!
+ hMenuReport:=Menu_AddMainMenuItem(@mi);
plStatusHook:=HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus);
end;
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp
index 278525c496..b4ea9a0f6c 100644
--- a/plugins/Weather/src/weather_svcs.cpp
+++ b/plugins/Weather/src/weather_svcs.cpp
@@ -323,7 +323,7 @@ void AddMenuItems(void)
// adding main menu items
mi.pszPopupName = LPGEN("Weather");
- mi.popupPosition = 500099000;
+ // mi.popupPosition = 500099000; !!!!!!!!!!!!!!!!!!!!!
CreateServiceFunction(MS_WEATHER_ENABLED, EnableDisableCmd);
mi.pszName = LPGEN("Enable/Disable Weather Update");
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
index 676bedd73c..3fa6e3d6dc 100644
--- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp
+++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
@@ -502,15 +502,13 @@ extern "C" __declspec(dllexport) int Load(void)
mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP));
}
mi.pszService = MS_WUMF_SWITCHPOPUP;
- mi.popupPosition = 1999990000;
+ // mi.popupPosition = 1999990000; !!!!!!!!!!!!!!!!!!!!!!!!!
mi.pszPopupName = LPGEN("Popups");
hMenuItem = Menu_AddMainMenuItem(&mi);
mi.pszName = LPGEN("WUMF: Show connections");
mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_DRIVE));
mi.pszService = MS_WUMF_CONNECTIONSSHOW;
- mi.popupPosition = 1999990000;
- mi.pszPopupName = NULL;
Menu_AddMainMenuItem(&mi);
HookEvent(ME_OPT_INITIALISE,OptionsInit);
diff --git a/plugins/mRadio/i_visual.inc b/plugins/mRadio/i_visual.inc
index fd70445bb5..6495962d9d 100644
--- a/plugins/mRadio/i_visual.inc
+++ b/plugins/mRadio/i_visual.inc
@@ -33,12 +33,10 @@ var
mi:TCListMenuItem;
begin
FillChar(mi, sizeof(mi), 0);
-// mi.popupPosition:=MenuUserInfoPos;
mi.pszService:=MS_RADIO_RECORD;
mi.szName.a :='Start/Stop Record';
hCMenuItemRec:=Menu_AddContactMenuItem(@mi);
-//!! mi.flags :=CMIF_NOTOFFLINE or CMIF_NOTOFFLIST;
mi.hIcon :=IcoLib_GetIcon(IcoBtnOn,0);
mi.pszService :=MS_RADIO_PLAYSTOP;
mi.szName.a :='Start/Stop broadcasting';
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index a0c1398634..3626175e4b 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -220,7 +220,6 @@ void CAimProto::InitMainMenus(void)
mi.icolibItem = GetIconHandle("aim");
mi.ptszName = m_tszUserName;
mi.hParentMenu = HGENMENU_ROOT;
- mi.popupPosition = 500090000;
mi.position = 500090000;
hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index 934dc808a9..bb5ab200d6 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -218,7 +218,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM)
HGENMENU hRoot = Menu_GetProtocolRoot(m_szModuleName);
if (hRoot == NULL) {
CLISTMENUITEM miRoot = { 0 };
- miRoot.popupPosition = 500085000;
+ miRoot.position = 500085000;
miRoot.hParentMenu = HGENMENU_ROOT;
miRoot.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | (this->isOnline() ? 0 : CMIF_GRAYED);
miRoot.icolibItem = GetIconHandle("facebook");
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index 9f00d7f631..52d92259e1 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -146,28 +146,28 @@ void InitContactMenus(void)
mi.pszName = LPGEN("Channel &settings");
mi.icolibItem = GetIconHandle(IDI_MANAGER);
mir_strcpy(d, IRC_UM_CHANSETTINGS);
- mi.popupPosition = 500090002;
+ mi.position = 500090002;
hUMenuChanSettings = Menu_AddContactMenuItem(&mi);
hMenuChanSettings = CreateServiceFunction(temp, IrcMenuChanSettings);
mi.pszName = LPGEN("&WhoIs info");
mi.icolibItem = GetIconHandle(IDI_WHOIS);
mir_strcpy(d, IRC_UM_WHOIS);
- mi.popupPosition = 500090001;
+ mi.position = 500090001;
hUMenuWhois = Menu_AddContactMenuItem(&mi);
hMenuWhois = CreateServiceFunction(temp, IrcMenuWhois);
mi.pszName = LPGEN("Di&sconnect");
mi.icolibItem = GetIconHandle(IDI_DELETE);
mir_strcpy(d, IRC_UM_DISCONNECT);
- mi.popupPosition = 500090001;
+ mi.position = 500090001;
hUMenuDisconnect = Menu_AddContactMenuItem(&mi);
hMenuDisconnect = CreateServiceFunction(temp, IrcMenuDisconnect);
mi.pszName = LPGEN("&Add to ignore list");
mi.icolibItem = GetIconHandle(IDI_BLOCK);
mir_strcpy(d, IRC_UM_IGNORE);
- mi.popupPosition = 500090002;
+ mi.position = 500090002;
hUMenuIgnore = Menu_AddContactMenuItem(&mi);
hMenuIgnore = CreateServiceFunction(temp, IrcMenuIgnore);
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 75b7dbcd1b..21c1a1374c 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -857,7 +857,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
CLISTMENUITEM mi = { 0 };
mi.pszPopupName = szItem;
- mi.popupPosition = 500084000;
+ // mi.popupPosition = 500084000; !!!!!!!!!!!!!!!!
mi.position = 2000040000;
for (int i = 0; i <= XSTATUS_COUNT; i++) {
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp
index fa103f86b7..fe73fa2ca1 100644
--- a/protocols/MRA/src/Mra_menus.cpp
+++ b/protocols/MRA/src/Mra_menus.cpp
@@ -286,7 +286,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM)
CLISTMENUITEM mi = { 0 };
mi.position = 2000060000;
- mi.popupPosition = 500085000;
+ // mi.popupPosition = 500085000;
mi.ptszPopupName = szItem;
mi.flags = CMIF_UNICODE;
mi.pszService = szServiceFunction;
@@ -360,7 +360,6 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI
mi.flags = CMIF_ROOTHANDLE;
mi.hParentMenu = hRootMenu;
- mi.popupPosition = lPopupPosition;
mi.pszService = szServiceFunction;
for (size_t i = 0; i < dwCount; i++) {
@@ -369,6 +368,7 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI
mi.icolibItem = pgdiItems[i].hIcolib;
mi.pszName = pgdiItems[i].szDescr;
hResult[i] = fnAddFunc(&mi);
+ Menu_ConfigureItem(hResult[i], MCI_OPT_EXECPARAM, lPopupPosition);
}
return hRootMenu;
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 33dd616058..89c0bdabe0 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -276,7 +276,7 @@ void CMsnProto::MsnInitMainMenu(void)
HGENMENU hRoot = Menu_GetProtocolRoot(m_szModuleName);
if (hRoot == NULL) {
- mi.popupPosition = 500085000;
+ mi.position = 500085000;
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.icolibItem = GetIconHandle(IDI_MSN);
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp
index cea3d51431..9994db0920 100644
--- a/protocols/Sametime/src/sametime_session.cpp
+++ b/protocols/Sametime/src/sametime_session.cpp
@@ -564,7 +564,6 @@ void CSametimeProto::InitSessionMenu()
CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_TCHAR;
- mi.popupPosition = 500085001;
mi.position = 2000060000;
mi.ptszName = LPGENT("Send announcement...");
mir_snprintf(service, _countof(service), "%s%s", m_szModuleName, MS_SAMETIME_MENUANNOUNCESESSION);
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index a6a38e0298..c8cda6ec35 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -266,10 +266,7 @@ void TlenProtocol::initMenuItems()
CLISTMENUITEM mi = { 0 };
mi.pszContactOwner = m_szModuleName;
- mi.popupPosition = 500090000;
- mir_strcpy(text, m_szModuleName);
- mi.pszService = text;
mi.ptszName = m_tszUserName;
mi.position = -1999901009;
mi.hParentMenu = HGENMENU_ROOT;
@@ -279,6 +276,7 @@ void TlenProtocol::initMenuItems()
mi.flags = CMIF_ROOTHANDLE;
mi.hParentMenu = (HGENMENU)hMenuRoot;
+ mi.pszService = text;
hMenuChats = NULL;
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index 040ec7d13c..5870a8f12f 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -273,7 +273,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM)
CreateProtoService("/Tweet", &TwitterProto::OnTweet);
mir_strcpy(tDest, "/Tweet");
mi.ptszName = LPGENT("Send Tweet...");
- mi.popupPosition = 200001;
+ mi.position = 200001;
mi.icolibItem = GetIconHandle("tweet");
Menu_AddStatusMenuItem(&mi);
return 0;
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp
index 2d75c8908d..68c1602f27 100644
--- a/protocols/WhatsApp/src/theme.cpp
+++ b/protocols/WhatsApp/src/theme.cpp
@@ -56,7 +56,7 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam)
HGENMENU hRoot = Menu_GetProtocolRoot(m_szModuleName);
if (hRoot == NULL) {
- mi.popupPosition = 500085000;
+ mi.position = 500085000;
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED | (isOnline() ? 0 : CMIF_GRAYED);
mi.icolibItem = GetIconHandle("whatsApp");
diff --git a/protocols/Xfire/src/Xfire_game.cpp b/protocols/Xfire/src/Xfire_game.cpp
index 7d10b769c3..8f7f7b6d7f 100644
--- a/protocols/Xfire/src/Xfire_game.cpp
+++ b/protocols/Xfire/src/Xfire_game.cpp
@@ -437,7 +437,7 @@ void Xfire_game::createMenuitem(unsigned int pos, int dbid)
dbid = pos;
CLISTMENUITEM mi = { 0 };
- mi.popupPosition = 500084000;
+ // mi.popupPosition = 500084000; !!!!!!!!!!!!!!!!!!!!!!!!
mi.pszPopupName = Translate("Start game");
mi.pszContactOwner = protocolname;
diff --git a/protocols/Xfire/src/Xfire_gamelist.cpp b/protocols/Xfire/src/Xfire_gamelist.cpp
index a60e870548..624e79a184 100644
--- a/protocols/Xfire/src/Xfire_gamelist.cpp
+++ b/protocols/Xfire/src/Xfire_gamelist.cpp
@@ -245,7 +245,7 @@ void Xfire_gamelist::createDummyMenuItem()
mi.position = 500090001;
mi.pszName = Translate("Please wait...");
mi.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ID_OP));
- mi.popupPosition = 500084000;
+ // mi.popupPosition = 500084000; !!!!!!!!!!!!!!!!!!!!!!!
mi.pszPopupName = Translate("Start game");
mi.pszContactOwner = protocolname;
dummymenuitem = Menu_AddMainMenuItem(&mi);
diff --git a/src/core/stdhelp/src/help.cpp b/src/core/stdhelp/src/help.cpp
index a8c70ad3aa..d71ff4c9b1 100644
--- a/src/core/stdhelp/src/help.cpp
+++ b/src/core/stdhelp/src/help.cpp
@@ -76,7 +76,7 @@ int LoadHelpModule(void)
CLISTMENUITEM mi = { 0 };
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.pszPopupName = LPGEN("&Help");
- mi.popupPosition = 2000090000;
+ // mi.popupPosition = 2000090000; !!!!!!!!!!!!!!!!!!!!
mi.position = 2000090000;
mi.pszName = LPGEN("&About...");
mi.pszService = "Help/AboutCommand";
diff --git a/src/mir_app/src/clistmenus.cpp b/src/mir_app/src/clistmenus.cpp
index d6ada2b63d..5103f02de3 100644
--- a/src/mir_app/src/clistmenus.cpp
+++ b/src/mir_app/src/clistmenus.cpp
@@ -92,23 +92,6 @@ tStatusMenuHandles, *lpStatusMenuHandles;
lpStatusMenuHandles hStatusMenuHandles;
int hStatusMenuHandlesCnt;
-//mainmenu exec param(ownerdata)
-struct MainMenuExecParam
-{
- char *szServiceName;
- TCHAR *szMenuName;
- int Param1;
-};
-
-//contactmenu exec param(ownerdata)
-//also used in checkservice
-struct ContactMenuExecParam
-{
- char *szServiceName;
- char *pszContactOwner;//for check proc
- int param;
-};
-
struct BuildContactParam
{
char *szProto;
@@ -176,6 +159,13 @@ int fnGetAverageMode(int *pNetProtoCount)
/////////////////////////////////////////////////////////////////////////////////////////
// MAIN MENU
+struct MainMenuExecParam
+{
+ char *szServiceName;
+ TCHAR *szMenuName;
+ TMO_IntMenuItem *pimi;
+};
+
static INT_PTR BuildMainMenu(WPARAM, LPARAM)
{
NotifyEventHooks(hPreBuildMainMenuEvent, 0, 0);
@@ -198,11 +188,11 @@ static INT_PTR AddMainMenuItem(WPARAM, LPARAM lParam)
//we need just one parametr.
mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = mi->popupPosition;
mmep->szMenuName = tmi.name.t;
tmi.ownerdata = mmep;
TMO_IntMenuItem *pimi = Menu_AddItem(hMainMenuObject, &tmi);
+ mmep->pimi = pimi;
char* name;
bool needFree = false;
@@ -226,18 +216,14 @@ int MainMenuCheckService(WPARAM, LPARAM)
return 0;
}
-//called with:
-//wparam - ownerdata
-//lparam - lparam from winproc
+// called with:
+// wparam - ownerdata
+// lparam - lparam from winproc
INT_PTR MainMenuExecService(WPARAM wParam, LPARAM lParam)
{
MainMenuExecParam *mmep = (MainMenuExecParam*)wParam;
if (mmep != NULL) {
- // bug in help.c, it used wparam as parent window handle without reason.
- if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand"))
- mmep->Param1 = 0;
-
- CallService(mmep->szServiceName, mmep->Param1, lParam);
+ CallService(mmep->szServiceName, mmep->pimi->execParam, lParam);
}
return 1;
}
@@ -255,6 +241,13 @@ INT_PTR FreeOwnerDataMainMenu(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// CONTACT MENU
+struct ContactMenuExecParam
+{
+ char *szServiceName;
+ char *pszContactOwner;//for check proc
+ TMO_IntMenuItem *pimi;
+};
+
static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
{
TMO_MenuItem tmi;
@@ -273,11 +266,12 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
cmep->szServiceName = mir_strdup(mi->pszService);
if (mi->pszContactOwner != NULL)
cmep->pszContactOwner = mir_strdup(mi->pszContactOwner);
- cmep->param = mi->popupPosition;
tmi.ownerdata = cmep;
//may be need to change how UniqueName is formed?
- TMO_IntMenuItem *menuHandle = Menu_AddItem(hContactMenuObject, &tmi);
+ TMO_IntMenuItem *pimi = Menu_AddItem(hContactMenuObject, &tmi);
+ cmep->pimi = pimi;
+
char buf[256];
if (mi->pszService)
mir_snprintf(buf, "%s/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", (mi->pszService) ? mi->pszService : "");
@@ -288,8 +282,8 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
mir_snprintf(buf, "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
}
else buf[0] = '\0';
- if (buf[0]) Menu_ConfigureItem(menuHandle, MCI_OPT_UNIQUENAME, buf);
- return (INT_PTR)menuHandle;
+ if (buf[0]) Menu_ConfigureItem(pimi, MCI_OPT_UNIQUENAME, buf);
+ return (INT_PTR)pimi;
}
static INT_PTR BuildContactMenu(WPARAM hContact, LPARAM)
@@ -316,7 +310,7 @@ INT_PTR ContactMenuExecService(WPARAM wParam, LPARAM lParam)
if (wParam != 0) {
ContactMenuExecParam *cmep = (ContactMenuExecParam*)wParam;
//call with wParam = (MCONTACT)hContact, lparam = popupposition
- CallService(cmep->szServiceName, lParam, cmep->param);
+ CallService(cmep->szServiceName, lParam, cmep->pimi->execParam);
}
return 0;
}
@@ -841,9 +835,9 @@ void RebuildMenuOrder(void)
}
else tmi.name.t = pa->tszAccountName;
- TMO_IntMenuItem *menuHandle = Menu_AddItem(hStatusMenuObject, &tmi);
- ((StatusMenuExecParam*)tmi.ownerdata)->protoindex = (int)menuHandle;
- Menu_ModifyItem(menuHandle, tmi.name.t, tmi.hIcon, tmi.flags);
+ TMO_IntMenuItem *pimi = Menu_AddItem(hStatusMenuObject, &tmi);
+ ((StatusMenuExecParam*)tmi.ownerdata)->protoindex = (int)pimi;
+ Menu_ModifyItem(pimi, tmi.name.t, tmi.hIcon, tmi.flags);
cli.menuProtos = (MenuProto*)mir_realloc(cli.menuProtos, sizeof(MenuProto)*(cli.menuProtoCount + 1));
memset(&(cli.menuProtos[cli.menuProtoCount]), 0, sizeof(MenuProto));
@@ -854,7 +848,7 @@ void RebuildMenuOrder(void)
char buf[256];
mir_snprintf(buf, "RootProtocolIcon_%s", pa->szModuleName);
- Menu_ConfigureItem(menuHandle, MCI_OPT_UNIQUENAME, buf);
+ Menu_ConfigureItem(pimi, MCI_OPT_UNIQUENAME, buf);
DestroyIcon(ic);
pos += 500000;
@@ -1128,17 +1122,17 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam)
tmi.ownerdata = smep;
}
- TMO_IntMenuItem *menuHandle = Menu_AddItem(hStatusMenuObject, &tmi);
+ TMO_IntMenuItem *pimi = Menu_AddItem(hStatusMenuObject, &tmi);
if (smep)
- smep->hMenuItem = menuHandle;
+ smep->hMenuItem = pimi;
char buf[MAX_PATH + 64];
char *p = (pRoot) ? mir_t2a(pRoot->mi.name.t) : NULL;
mir_snprintf(buf, "%s/%s", (p) ? p : "", mi->pszService ? mi->pszService : "");
mir_free(p);
- Menu_ConfigureItem(menuHandle, MCI_OPT_UNIQUENAME, buf);
- return (INT_PTR)menuHandle;
+ Menu_ConfigureItem(pimi, MCI_OPT_UNIQUENAME, buf);
+ return (INT_PTR)pimi;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp
index e1b20354f8..9d54905a72 100644
--- a/src/mir_app/src/clistmod.cpp
+++ b/src/mir_app/src/clistmod.cpp
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "clc.h"
INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam);
+int InitFramesMenus(void);
int InitCListEvents(void);
void UninitCListEvents(void);
int ContactSettingChanged(WPARAM wParam, LPARAM lParam);
@@ -504,6 +505,7 @@ int LoadContactListModule2(void)
InitCListEvents();
InitGroupServices();
+ InitFramesMenus();
cli.pfnInitTray();
hCListImages = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 13, 0);
diff --git a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp b/src/mir_app/src/framesmenu.cpp
index fc512f7ea9..ce17f358ff 100644
--- a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
+++ b/src/mir_app/src/framesmenu.cpp
@@ -1,5 +1,6 @@
-#include "../hdr/modern_commonheaders.h"
-#include "../hdr/modern_commonprototypes.h"
+#include "stdafx.h"
+
+#include <m_cluiframes.h>
//========================== Frames
HANDLE hFrameMenuObject;
@@ -28,7 +29,7 @@ static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam)
CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
- if (!pcli->pfnConvertMenu(mi, &tmi))
+ if (!cli.pfnConvertMenu(mi, &tmi))
return NULL;
tmi.root = (mi->flags & CMIF_ROOTHANDLE) ? mi->hParentMenu : NULL;
@@ -38,7 +39,7 @@ static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam)
return 0;
fmep->szServiceName = mir_strdup(mi->pszService);
- fmep->Frameid = mi->popupPosition;
+ fmep->Frameid = 0; // mi->popupPosition; !!!!!!!!!!!!!!!!!!!!!!!!!!
fmep->param1 = (INT_PTR)mi->pszContactOwner;
tmi.ownerdata = fmep;
return (INT_PTR)Menu_AddItem(hFrameMenuObject, &tmi);
@@ -84,8 +85,9 @@ static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam)
static INT_PTR BuildContextFrameMenu(WPARAM wParam, LPARAM lParam)
{
- HMENU hMenu = CreatePopupMenu();
ContextFrameMenuNotify(wParam, -1);
+
+ HMENU hMenu = CreatePopupMenu();
Menu_Build(hMenu, hFrameMenuObject, wParam, lParam);
return (INT_PTR)hMenu;
}
diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp
index 05babf2759..7eac996704 100644
--- a/src/mir_app/src/genmenu.cpp
+++ b/src/mir_app/src/genmenu.cpp
@@ -445,8 +445,7 @@ MIR_APP_DLL(BOOL) Menu_ProcessCommand(HGENMENU hMenuItem, LPARAM lParam)
}
LPCSTR srvname = pimi->parent->ExecService;
- void *ownerdata = pimi->mi.ownerdata;
- CallService(srvname, (WPARAM)ownerdata, lParam);
+ CallService(srvname, (WPARAM)pimi->mi.ownerdata, lParam);
return true;
}
@@ -470,6 +469,10 @@ MIR_APP_DLL(int) Menu_ConfigureItem(HGENMENU hItem, int iOption, INT_PTR value)
case MCI_OPT_HOTKEY:
pimi->hotKey = (DWORD)value;
return 0;
+
+ case MCI_OPT_EXECPARAM:
+ pimi->execParam = value;
+ return 0;
}
return 1;
diff --git a/src/mir_app/src/genmenu.h b/src/mir_app/src/genmenu.h
index 17c6102763..93909aab18 100644
--- a/src/mir_app/src/genmenu.h
+++ b/src/mir_app/src/genmenu.h
@@ -54,6 +54,7 @@ struct TMO_IntMenuItem
HBITMAP hBmp;
int originalPosition;
DWORD hotKey;
+ WPARAM execParam;
int hLangpack;
TMO_IntMenuItem *next; // next item in list
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp
index ba995132c8..311c72a629 100644
--- a/src/mir_app/src/movetogroup.cpp
+++ b/src/mir_app/src/movetogroup.cpp
@@ -69,17 +69,17 @@ static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, boo
{
CLISTMENUITEM mi = { 0 };
mi.hParentMenu = hRoot;
- mi.popupPosition = param; // param to pszService - only with CMIF_ROOTHANDLE !!!!!!
mi.position = pos;
mi.ptszName = PrepareGroupName(name);
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
mi.pszService = MTG_MOVE;
- HANDLE result = Menu_AddContactMenuItem(&mi);
- mir_free(mi.ptszName);
+ HGENMENU result = Menu_AddContactMenuItem(&mi);
+ Menu_ConfigureItem(result, MCI_OPT_EXECPARAM, param);
lphGroupsItems.insert((HANDLE*)result);
+ mir_free(mi.ptszName);
}
static int OnContactMenuBuild(WPARAM wParam, LPARAM)