summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-26 19:18:09 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-26 19:18:09 +0000
commitc89c550677f40d8b2010de442053cba81ba06d96 (patch)
tree7a8e85a24385125bc9045b164b5e921fb4e80a45 /src
parentb52ba14782bc2e5fc3eb7452dcebe67bfed095f1 (diff)
Menu_CreateRoot - new helper for creating submenus
git-svn-id: http://svn.miranda-ng.org/main/trunk@14403 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/genmenu.cpp24
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
3 files changed, 23 insertions, 3 deletions
diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp
index 7eac996704..ae4b414d15 100644
--- a/src/mir_app/src/genmenu.cpp
+++ b/src/mir_app/src/genmenu.cpp
@@ -651,9 +651,27 @@ static int GetNextObjectMenuItemId()
}
/////////////////////////////////////////////////////////////////////////////////////////
-// wparam = MenuObjectHandle
-// lparam = PMO_MenuItem
-// return MenuItemHandle
+// Adds new submenu
+// Returns a handle to the newly created root item or NULL
+
+MIR_APP_DLL(HGENMENU) Menu_CreateRoot(HGENMENU hRoot, LPCTSTR ptszName, int position, HANDLE hIcoLib, int hLang)
+{
+ if (hRoot == NULL)
+ return NULL;
+
+ TMO_MenuItem tmi = { 0 };
+ tmi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
+ tmi.hIcolibItem = hIcoLib;
+ tmi.root = hRoot;
+ tmi.hLangpack = hLang;
+ tmi.name.t = (TCHAR*)ptszName;
+ tmi.position = position;
+ return Menu_AddItem(hRoot->owner, &tmi);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Adds new menu item
+// Returns a handle to the newly created item or NULL
MIR_APP_DLL(HGENMENU) Menu_AddItem(HANDLE hMenuObject, TMO_MenuItem *pmi)
{
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 4b2e9ec4fe..dd9455a4bc 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -220,3 +220,4 @@ Menu_DrawItem @217
Menu_MeasureItem @218
Menu_EnableItem @219
Menu_SetChecked @220
+Menu_CreateRoot @221
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index bb17f0e413..6f0ce211bd 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -220,3 +220,4 @@ Menu_DrawItem @217
Menu_MeasureItem @218
Menu_EnableItem @219
Menu_SetChecked @220
+Menu_CreateRoot @221