summaryrefslogtreecommitdiff
path: root/include/delphi
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-27 11:09:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-27 11:09:19 +0000
commitab4abbb7a60f941acab8f0566c6b619f68f1b489 (patch)
treea67f4d3bde6bb59d3c49195a8c6e9085e01124eb /include/delphi
parent9d65ee38c92c7a0656ddc6c4c26017b7226fc44b (diff)
- CLISTMENUITEM::pszContactOwner removed, because it's supported only by contact's menu;
- Menu_AddContactMenuItem now receives parameter szProto; - Menu_Add* helpers are converted into real functions; git-svn-id: http://svn.miranda-ng.org/main/trunk@14409 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/delphi')
-rw-r--r--include/delphi/m_clist.inc72
-rw-r--r--include/delphi/m_helpers.inc12
2 files changed, 26 insertions, 58 deletions
diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc
index 04af0877d9..0183450f3d 100644
--- a/include/delphi/m_clist.inc
+++ b/include/delphi/m_clist.inc
@@ -46,6 +46,19 @@ const
}
MS_CLIST_GETSTATUSMODEDESCRIPTION:PAnsiChar = 'CList/GetStatusModeDescription';
+const
+ CMIF_GRAYED = 1;
+ CMIF_CHECKED = 2;
+ CMIF_HIDDEN = 4; // only works on contact menus
+ CMIF_NOTOFFLINE = 8; // item won't appear for contacts that are offline
+ CMIF_NOTONLINE = 16; // " online
+ CMIF_NOTONLIST = 32; // item won't appear on standard contacts
+ CMIF_NOTOFFLIST = 64; // item won't appear on contacts that have the 'NotOnList' setting
+ CMIF_UNICODE = 512; // will return TCHAR* instead of AnsiChar*
+ CMIF_KEEPUNTRANSLATED = 1024; // don't translate a menu item
+
+ CMIF_DEFAULT = 4096; // this menu item is the default one
+
type
// WARNING: do not use Translate(TS) for p(t)szName or p(t)szPopupName as they
// are translated by the core, which may lead to double translation.
@@ -53,67 +66,26 @@ type
PCLISTMENUITEM = ^TCLISTMENUITEM;
TCLISTMENUITEM = record
szName : TChar; // [TRANSLATED-BY-CORE] text of the menu item
- flags : dword;
+ flags : dword; // combination of CMIF_*
position : int; // approx position on the menu, lower numbers go nearer the top
hIcon : THANDLE; // icon to put by the item, if this was *not* loaded from
// a resource, you can delete it straight after the call
pszService : PAnsiChar; // name of the service to call when the service is clicked
hParentMenu : THANDLE; // parent menu hamdle
-
- 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.
- // if it applies to multiple but not all protocols
- // add multiple menu items or use ME_CLIST_PREBUILDCONTACTMENU
hLangpack : int; // plugin's hLangpack (added automatically)
end;
-const
- CMIF_GRAYED = 1;
- CMIF_CHECKED = 2;
- CMIF_HIDDEN = 4; // only works on contact menus
- CMIF_NOTOFFLINE = 8; // item won't appear for contacts that are offline
- CMIF_NOTONLINE = 16; // " online
- CMIF_NOTONLIST = 32; // item won't appear on standard contacts
- CMIF_NOTOFFLIST = 64; // item won't appear on contacts that have the 'NotOnList' setting
- CMIF_ROOTHANDLE = 384; // means that hParentMenu member is set (since 0.8#26)
- CMIF_UNICODE = 512; // will return TCHAR* instead of AnsiChar*
- CMIF_KEEPUNTRANSLATED = 1024; // don't translate a menu item
-
- CMIF_DEFAULT = 4096; // this menu item is the default one
+function _AddMainMenuItem(mi:PCLISTMENUITEM; hlang:integer) : HGENMENU; stdcall;
+ external AppDll name 'Menu_AddMainMenuItem';
-// for compatibility. since 0.8.0 they both mean nothing
- CMIF_ROOTPOPUP = 128; // root item for new popup (save return id for childs)
- CMIF_CHILDPOPUP = 256; // child for rootpopup menu
+function _AddContactMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall;
+ external AppDll name 'Menu_AddContactMenuItem';
- {
- wParam : 0
- lParam : Pointer to a initalised TCLISTMENUITEM structure
- Affect : Add a new menu item to the main menu, see notes
- Returns: A handle to the new MENU item or NULL(0) on failure
- Notes : The given TCLISTMENUITEM.pszService in is called when the item
- get clicked with :
- -
- wParam = 0, lParam = hwndContactList
- }
- MS_CLIST_ADDMAINMENUITEM:PAnsiChar = 'CList/AddMainMenuItem';
+function _AddProtoMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall;
+ external AppDll name 'Menu_AddProtoMenuItem';
- {
- wParam : 0
- lParam : Pointer to a initalised TCLISTMENUITEM structure
- Affect : Add a new item to the user contact menus, see notes
- Notes : exactly the same as MS_CLIST_ADDMAINMENUITEM except when an item
- is selected, the service gets called with wParam=hContact,
- pszContactOwner is obeyed.
- -
- Popup menus are not supported, pszPopupName and popupPosition
- are ignored. If CTRL is held down when right clicking the menu
- position numbers will be displayed in brackets after the menu item
- text, this only works in debug builds!
- }
- MS_CLIST_ADDCONTACTMENUITEM:PAnsiChar = 'CList/AddContactMenuItem';
- MS_CLIST_ADDSTATUSMENUITEM :PAnsiChar = 'CList/AddStatusMenuItem';
- MS_CLIST_ADDPROTOMENUITEM :PAnsiChar = 'CList/AddProtoMenuItem';
+function _AddStatusMenuItem(mi:PCLISTMENUITEM; pszProto:PAnsiChar; hlang:integer) : HGENMENU; stdcall;
+ external AppDll name 'Menu_AddStatusMenuItem';
{
Affect : Modify an existing menu item, see notes
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc
index 1cf14f32b0..72a0b66103 100644
--- a/include/delphi/m_helpers.inc
+++ b/include/delphi/m_helpers.inc
@@ -392,26 +392,22 @@ end;
function Menu_AddMainMenuItem(mi:PCLISTMENUITEM):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
- result:=CallService(MS_CLIST_ADDMAINMENUITEM, 0,LPARAM(mi));
+ result:=_AddMainMenuItem(mi, hLangpack);
end;
function Menu_AddContactMenuItem(mi:PCLISTMENUITEM):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
- result:=CallService(MS_CLIST_ADDCONTACTMENUITEM, 0,LPARAM(mi));
+ result:=_AddContactMenuItem(mi, nil, hLangpack);
end;
function Menu_AddStatusMenuItem(mi:PCLISTMENUITEM):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
- result:=CallService(MS_CLIST_ADDSTATUSMENUITEM, 0,LPARAM(mi));
+ result:=_AddStatusMenuItem(mi, nil, hLangpack);
end;
function Menu_AddProtoMenuItem(mi:PCLISTMENUITEM):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
- result:=CallService(MS_CLIST_ADDPROTOMENUITEM, 0,LPARAM(mi));
+ result:=_AddProtoMenuItem(mi, nil, hLangpack);
end;
function Menu_AddTrayMenuItem(mi:PCLISTMENUITEM):HGENMENU;