diff options
author | George Hazan <george.hazan@gmail.com> | 2016-01-21 11:19:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-01-21 11:19:18 +0000 |
commit | 385e9fc6fffe35fff080fdcb564b835a334c8feb (patch) | |
tree | 0f58ead5811a6570e53347c1a5405e098c345eb2 | |
parent | e0a53609f587b1fd1b1daff2ae96feb8f39b62e1 (diff) |
fix for moving menu item to the first position in a submenu
git-svn-id: http://svn.miranda-ng.org/main/trunk@16132 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | bin10/lib/mir_core.lib | bin | 301148 -> 301152 bytes | |||
-rw-r--r-- | bin10/lib/mir_core64.lib | bin | 302184 -> 302190 bytes | |||
-rw-r--r-- | bin12/lib/mir_core.lib | bin | 301148 -> 301152 bytes | |||
-rw-r--r-- | bin12/lib/mir_core64.lib | bin | 302184 -> 302190 bytes | |||
-rw-r--r-- | bin14/lib/mir_core.lib | bin | 301148 -> 301152 bytes | |||
-rw-r--r-- | bin14/lib/mir_core64.lib | bin | 302184 -> 302190 bytes | |||
-rw-r--r-- | include/m_gui.h | 2 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/ui_utils.cpp | 17 |
10 files changed, 14 insertions, 9 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib Binary files differindex 36f443165c..8e8b44cd43 100644 --- a/bin10/lib/mir_core.lib +++ b/bin10/lib/mir_core.lib diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib Binary files differindex 89832ebfab..654763f59c 100644 --- a/bin10/lib/mir_core64.lib +++ b/bin10/lib/mir_core64.lib diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib Binary files differindex 36f443165c..8e8b44cd43 100644 --- a/bin12/lib/mir_core.lib +++ b/bin12/lib/mir_core.lib diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib Binary files differindex 89832ebfab..654763f59c 100644 --- a/bin12/lib/mir_core64.lib +++ b/bin12/lib/mir_core64.lib diff --git a/bin14/lib/mir_core.lib b/bin14/lib/mir_core.lib Binary files differindex 36f443165c..8e8b44cd43 100644 --- a/bin14/lib/mir_core.lib +++ b/bin14/lib/mir_core.lib diff --git a/bin14/lib/mir_core64.lib b/bin14/lib/mir_core64.lib Binary files differindex 89832ebfab..654763f59c 100644 --- a/bin14/lib/mir_core64.lib +++ b/bin14/lib/mir_core64.lib diff --git a/include/m_gui.h b/include/m_gui.h index 1a1317d6ab..b919207189 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -851,7 +851,7 @@ class MIR_CORE_EXPORT CCtrlTreeView : public CCtrlBase {
typedef CCtrlBase CSuper;
- HTREEITEM MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter);
+ HTREEITEM MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter, HTREEITEM hParent);
public:
CCtrlTreeView(CDlgBase *dlg, int ctrlId);
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index c5ff0c1fbc..3263fd854b 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -933,7 +933,7 @@ mir_wstrcmpi @280 ?SelectRange@CCtrlTreeView@@QAEXPAU_TREEITEM@@0@Z @1091 NONAME
?Unselect@CCtrlTreeView@@QAEXPAU_TREEITEM@@@Z @1092 NONAME
?UnselectAll@CCtrlTreeView@@QAEXXZ @1093 NONAME
-?MoveItemAbove@CCtrlTreeView@@AAEPAU_TREEITEM@@PAU2@0@Z @1094 NONAME
+?MoveItemAbove@CCtrlTreeView@@AAEPAU_TREEITEM@@PAU2@00@Z @1094 NONAME
?GetCurrPage@CCtrlPages@@AAEPAUTPageInfo@1@XZ @1095 NONAME
?Fail@CDlgBase@@QAEXXZ @1096 NONAME
?OnApply@CCtrlPages@@MAEXXZ @1097 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 3d660b330c..5fa704f8d9 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -933,7 +933,7 @@ mir_wstrcmpi @280 ?SelectRange@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@0@Z @1091 NONAME
?Unselect@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@@Z @1092 NONAME
?UnselectAll@CCtrlTreeView@@QEAAXXZ @1093 NONAME
-?MoveItemAbove@CCtrlTreeView@@AEAAPEAU_TREEITEM@@PEAU2@0@Z @1094 NONAME
+?MoveItemAbove@CCtrlTreeView@@AEAAPEAU_TREEITEM@@PEAU2@00@Z @1094 NONAME
?GetCurrPage@CCtrlPages@@AEAAPEAUTPageInfo@1@XZ @1095 NONAME
?Fail@CDlgBase@@QEAAXXZ @1096 NONAME
?OnApply@CCtrlPages@@MEAAXXZ @1097 NONAME
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index 9559a7fabd..de9d41bb11 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -1383,7 +1383,7 @@ void CCtrlTreeView::OnInit() Subclass();
}
-HTREEITEM CCtrlTreeView::MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter)
+HTREEITEM CCtrlTreeView::MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter, HTREEITEM hParent)
{
if (hItem == NULL || hInsertAfter == NULL)
return NULL;
@@ -1411,7 +1411,7 @@ HTREEITEM CCtrlTreeView::MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter) tvis.itemex.stateMask = tvis.itemex.state;
tvis.itemex.lParam = saveOldData;
- tvis.hParent = (hInsertAfter == TVI_FIRST) ? NULL : GetParent(hInsertAfter);
+ tvis.hParent = hParent;
tvis.hInsertAfter = hInsertAfter;
return InsertItem(&tvis);
}
@@ -1460,26 +1460,31 @@ LRESULT CCtrlTreeView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) else if (hti.flags & TVHT_BELOW)
hti.hItem = TVI_LAST;
+ HTREEITEM insertAfter = hti.hItem;
+ HTREEITEM hParent = (insertAfter == TVI_FIRST) ? NULL : GetParent(insertAfter);
+ if (GetChild(insertAfter) != NULL) {
+ hParent = insertAfter;
+ insertAfter = TVI_FIRST;
+ }
+
HTREEITEM FirstItem = NULL;
if (m_bMultiSelect) {
LIST<_TREEITEM> arItems(10);
GetSelected(arItems);
// Proceed moving
- HTREEITEM insertAfter = hti.hItem;
- HTREEITEM hParent = GetParent(hti.hItem);
for (int i = 0; i < arItems.getCount(); i++) {
if (!insertAfter)
break;
if (GetParent(arItems[i]) != hParent) // prevent subitems from being inserted at the same level
continue;
- insertAfter = MoveItemAbove(arItems[i], insertAfter);
+ insertAfter = MoveItemAbove(arItems[i], insertAfter, hParent);
if (!i)
FirstItem = insertAfter;
}
}
- else FirstItem = MoveItemAbove(m_hDragItem, hti.hItem);
+ else FirstItem = MoveItemAbove(m_hDragItem, insertAfter, hParent);
if (FirstItem)
SelectItem(FirstItem);
|