summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/res/resource.rc1
-rw-r--r--src/mir_app/src/menu_options.cpp45
-rw-r--r--src/mir_app/src/resource.h3
3 files changed, 41 insertions, 8 deletions
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc
index e1a70975c5..2f52fdf45d 100644
--- a/src/mir_app/res/resource.rc
+++ b/src/mir_app/res/resource.rc
@@ -492,6 +492,7 @@ BEGIN
CONTROL "Move to the main menu",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,11,111,128,8
CONTROL "Move to the status bar",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,11,123,130,8
LTEXT "Warning!\r\nThis menu object not support user defined options.",IDC_NOTSUPPORTWARNING,10,140,136,32,NOT WS_VISIBLE
+ PUSHBUTTON "Insert submenu",IDC_INSERTSUBMENU,39,163,97,14,WS_DISABLED
PUSHBUTTON "Insert separator",IDC_INSERTSEPARATOR,39,180,97,14,WS_DISABLED
LTEXT "Service:",IDC_STATIC,4,201,29,8
EDITTEXT IDC_GENMENU_SERVICE,36,199,108,14,ES_AUTOHSCROLL | ES_READONLY
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp
index 7304f2d854..4621f5c9df 100644
--- a/src/mir_app/src/menu_options.cpp
+++ b/src/mir_app/src/menu_options.cpp
@@ -257,7 +257,8 @@ class CGenMenuOptionsPage : public CDlgBase
ShowWindow(m_warning.GetHwnd(), (pmo->m_bUseUserDefinedItems) ? SW_HIDE : SW_SHOW);
m_menuItems.Enable(pmo->m_bUseUserDefinedItems);
- m_btnInsert.Enable(pmo->m_bUseUserDefinedItems);
+ m_btnInsSeparator.Enable(pmo->m_bUseUserDefinedItems);
+ m_btnInsMenu.Enable(pmo->m_bUseUserDefinedItems);
return 1;
}
@@ -275,7 +276,7 @@ class CGenMenuOptionsPage : public CDlgBase
CCtrlTreeView m_menuItems;
CCtrlCheck m_radio1, m_radio2, m_enableIcons;
CCtrlEdit m_customName, m_service;
- CCtrlButton m_btnInsert, m_btnReset, m_btnSet, m_btnDefault;
+ CCtrlButton m_btnInsSeparator, m_btnInsMenu, m_btnReset, m_btnSet, m_btnDefault;
CCtrlBase m_warning;
public:
@@ -286,7 +287,8 @@ public:
m_radio1(this, IDC_RADIO1),
m_radio2(this, IDC_RADIO2),
m_enableIcons(this, IDC_DISABLEMENUICONS),
- m_btnInsert(this, IDC_INSERTSEPARATOR),
+ m_btnInsSeparator(this, IDC_INSERTSEPARATOR),
+ m_btnInsMenu(this, IDC_INSERTSUBMENU),
m_btnReset(this, IDC_RESETMENU),
m_btnSet(this, IDC_GENMENU_SET),
m_btnDefault(this, IDC_GENMENU_DEFAULT),
@@ -297,14 +299,15 @@ public:
{
m_btnSet.OnClick = Callback(this, &CGenMenuOptionsPage::btnSet_Clicked);
m_btnReset.OnClick = Callback(this, &CGenMenuOptionsPage::btnReset_Clicked);
- m_btnInsert.OnClick = Callback(this, &CGenMenuOptionsPage::btnInsert_Clicked);
+ m_btnInsSeparator.OnClick = Callback(this, &CGenMenuOptionsPage::btnInsSep_Clicked);
+ m_btnInsMenu.OnClick = Callback(this, &CGenMenuOptionsPage::btnInsMenu_Clicked);
m_btnDefault.OnClick = Callback(this, &CGenMenuOptionsPage::btnDefault_Clicked);
m_menuObjects.OnSelChange = Callback(this, &CGenMenuOptionsPage::onMenuObjectChanged);
m_menuItems.SetFlags(MTREE_CHECKBOX | MTREE_DND | MTREE_MULTISELECT);
m_menuItems.OnSelChanged = Callback(this, &CGenMenuOptionsPage::onMenuItemChanged);
- m_menuItems.OnBeginDrag = Callback(this, &CGenMenuOptionsPage::onMenuItemDrag);
+ m_menuItems.OnBeginDrag = Callback(this, &CGenMenuOptionsPage::onMenuItemBeginDrag);
m_customName.SetSilent();
m_service.SetSilent();
@@ -360,7 +363,7 @@ public:
FreeTreeData();
}
- void btnInsert_Clicked(CCtrlButton*)
+ void btnInsSep_Clicked(CCtrlButton*)
{
HTREEITEM hti = m_menuItems.GetSelection();
if (hti == NULL)
@@ -388,6 +391,34 @@ public:
NotifyChange();
}
+ void btnInsMenu_Clicked(CCtrlButton*)
+ {
+ HTREEITEM hti = m_menuItems.GetSelection();
+ if (hti == NULL)
+ return;
+
+ TVITEMEX tvi = { 0 };
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM | TVIF_TEXT;
+ tvi.hItem = hti;
+ if (!m_menuItems.GetItem(&tvi))
+ return;
+
+ MenuItemOptData *PD = new MenuItemOptData();
+ PD->id = -1;
+ PD->name = TranslateT("New submenu");
+ PD->pos = ((MenuItemOptData *)tvi.lParam)->pos - 1;
+
+ TVINSERTSTRUCT tvis = { 0 };
+ tvis.item.lParam = (LPARAM)PD;
+ tvis.item.pszText = PD->name;
+ tvis.item.iImage = tvis.item.iSelectedImage = 1;
+ tvis.hInsertAfter = hti;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ m_menuItems.InsertItem(&tvis);
+
+ NotifyChange();
+ }
+
void btnReset_Clicked(CCtrlButton*)
{
int MenuObjectID;
@@ -485,7 +516,7 @@ public:
m_customName.Enable(true);
}
- void onMenuItemDrag(CCtrlTreeView::TEventInfo *evt)
+ void onMenuItemBeginDrag(CCtrlTreeView::TEventInfo *evt)
{
MenuItemOptData *p = (MenuItemOptData*)evt->nmtv->itemNew.lParam;
if (p->pimi == NULL)
diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h
index d94ff10d99..e126bcb0fb 100644
--- a/src/mir_app/src/resource.h
+++ b/src/mir_app/src/resource.h
@@ -334,7 +334,8 @@
#define IDC_DOBDAY 1226
#define IDC_DOBMONTH 1227
#define IDC_WEBPAGE 1228
-#define IDC_DOBYEAR 1228
+#define IDC_DOBYEAR 1229
+#define IDC_INSERTSUBMENU 1230
#define IDC_UPDATING 1231
#define IDC_NAMEORDER 1234
#define IDC_RECONNECTREQD 1239