From fe1d2e6fd5d77885e3efe0339e03b2fec7002b0b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 18 Dec 2016 13:30:36 +0300 Subject: fix for strange post-effects of dnd in CCtrlTreeView --- include/m_gui.h | 1 + src/mir_app/src/srmm_toolbar.cpp | 4 ++-- src/mir_core/src/ui_utils.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/m_gui.h b/include/m_gui.h index f38764d05c..b9f0fdc84e 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -1154,6 +1154,7 @@ public: CCallback OnEndLabelEdit; CCallback OnGetDispInfo; CCallback OnGetInfoTip; + CCallback OnItemChanged; CCallback OnItemExpanded; CCallback OnItemExpanding; CCallback OnKeyDown; diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp index aeff306fdf..9fcdfaecfc 100644 --- a/src/mir_app/src/srmm_toolbar.cpp +++ b/src/mir_app/src/srmm_toolbar.cpp @@ -579,7 +579,7 @@ public: m_toolBar.SetFlags(MTREE_DND); // enable drag-n-drop m_toolBar.OnSelChanged = Callback(this, &CSrmmToolbarOptions::OnTreeSelChanged); m_toolBar.OnSelChanging = Callback(this, &CSrmmToolbarOptions::OnTreeSelChanging); - m_toolBar.OnChange = Callback(this, &CSrmmToolbarOptions::OnTreeChanged); + m_toolBar.OnItemChanged = Callback(this, &CSrmmToolbarOptions::OnTreeItemChanged); m_btnReset.OnClick = Callback(this, &CSrmmToolbarOptions::btnResetClicked); m_btnSeparator.OnClick = Callback(this, &CSrmmToolbarOptions::btnSeparatorClicked); @@ -734,7 +734,7 @@ public: m_btnHidden.Enable(); m_btnHidden.SetState(cbd->m_bCanBeHidden); } - void OnTreeChanged(void*) + void OnTreeItemChanged(void*) { int iNewState = !m_toolBar.GetCheckState(m_toolBar.GetSelection()); m_btnIM.Enable(iNewState); diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index 1ca3ee069a..1e4cec81b9 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -1754,7 +1754,7 @@ BOOL CCtrlTreeView::OnNotify(int, NMHDR *pnmh) if (evt.nmtvkey->wVKey == VK_SPACE) { if (m_bCheckBox) InvertCheck(GetSelection()); - OnChange(this); + OnItemChanged(&evt); NotifyChange(); } @@ -1773,7 +1773,7 @@ BOOL CCtrlTreeView::OnNotify(int, NMHDR *pnmh) InvertCheck(hti.hItem); else SelectItem(hti.hItem); - OnChange(this); + OnItemChanged(&evt); NotifyChange(); } } -- cgit v1.2.3