summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-18 20:32:26 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-18 20:32:26 +0300
commit06181106249ab68459bb609254b799adaddd6583 (patch)
tree01971242b28a84a1876f904f8f74fc9c3958024a
parentfbc1add780b58370aeb87abfd1915a8fd7ef1710 (diff)
fix for CCtrlTreeView::OnItemChanged prototype
-rw-r--r--include/m_gui.h17
-rw-r--r--src/mir_app/src/srmm_toolbar.cpp4
-rw-r--r--src/mir_core/src/CCtrlTreeView.cpp5
3 files changed, 15 insertions, 11 deletions
diff --git a/include/m_gui.h b/include/m_gui.h
index 746cb66ff7..14b302fac6 100644
--- a/include/m_gui.h
+++ b/include/m_gui.h
@@ -1077,14 +1077,14 @@ public:
struct TEventInfo {
CCtrlListView *treeviewctrl;
union {
- NMHDR *nmhdr;
- NMLISTVIEW *nmlv;
- NMLVDISPINFO *nmlvdi;
- NMLVSCROLL *nmlvscr;
- NMLVGETINFOTIP *nmlvit;
- NMLVFINDITEM *nmlvfi;
- NMITEMACTIVATE *nmlvia;
- NMLVKEYDOWN *nmlvkey;
+ NMHDR *nmhdr;
+ NMLISTVIEW *nmlv;
+ NMLVDISPINFO *nmlvdi;
+ NMLVSCROLL *nmlvscr;
+ NMLVGETINFOTIP *nmlvit;
+ NMLVFINDITEM *nmlvfi;
+ NMITEMACTIVATE *nmlvia;
+ NMLVKEYDOWN *nmlvkey;
};
};
@@ -1227,6 +1227,7 @@ public:
NMTVKEYDOWN *nmtvkey;
NMTVDISPINFO *nmtvdi;
NMTVGETINFOTIP *nmtvit;
+ HTREEITEM hItem; // for OnItemChanged
};
};
diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp
index 44bad562cc..4efa509b64 100644
--- a/src/mir_app/src/srmm_toolbar.cpp
+++ b/src/mir_app/src/srmm_toolbar.cpp
@@ -776,9 +776,9 @@ public:
m_btnHidden.Enable(); m_btnHidden.SetState(cbd->m_bCanBeHidden);
}
- void OnTreeItemChanged(void*)
+ void OnTreeItemChanged(CCtrlTreeView::TEventInfo *evt)
{
- bool iNewState = !m_toolBar.GetCheckState(m_toolBar.GetSelection());
+ bool iNewState = !m_toolBar.GetCheckState(evt->hItem);
m_btnIM.Enable(iNewState);
m_btnChat.Enable(iNewState);
m_btnHidden.Enable(iNewState);
diff --git a/src/mir_core/src/CCtrlTreeView.cpp b/src/mir_core/src/CCtrlTreeView.cpp
index 52c7df846b..1852517a9d 100644
--- a/src/mir_core/src/CCtrlTreeView.cpp
+++ b/src/mir_core/src/CCtrlTreeView.cpp
@@ -280,8 +280,9 @@ BOOL CCtrlTreeView::OnNotify(int, NMHDR *pnmh)
case TVN_KEYDOWN:
if (evt.nmtvkey->wVKey == VK_SPACE) {
+ evt.hItem = GetSelection();
if (m_bCheckBox)
- InvertCheck(GetSelection());
+ InvertCheck(evt.hItem);
OnItemChanged(&evt);
NotifyChange();
}
@@ -301,6 +302,8 @@ BOOL CCtrlTreeView::OnNotify(int, NMHDR *pnmh)
InvertCheck(hti.hItem);
else
SelectItem(hti.hItem);
+
+ evt.hItem = hti.hItem;
OnItemChanged(&evt);
NotifyChange();
}