From c7577005f0d52def37928a96b66b72755e559a97 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 May 2015 16:34:28 +0000 Subject: fix for correct behaviour of checkboxes in EI options git-svn-id: http://svn.miranda-ng.org/main/trunk@13591 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/src/ui_utils.cpp | 21 +++++++++++++-------- src/modules/extraicons/options_ei.cpp | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index d045182de1..24f2cc5d6d 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -1561,21 +1561,28 @@ BOOL CCtrlTreeView::OnNotify(int, NMHDR *pnmh) return TRUE; case TVN_KEYDOWN: - if (m_bCheckBox && evt.nmtvkey->wVKey == VK_SPACE) - InvertCheck(GetSelection()); + if (evt.nmtvkey->wVKey == VK_SPACE) { + if (m_bCheckBox) + InvertCheck(GetSelection()); + NotifyChange(); + } OnKeyDown(&evt); return TRUE; } - if (m_bCheckBox && pnmh->code == NM_CLICK) { + if (pnmh->code == NM_CLICK) { TVHITTESTINFO hti; hti.pt.x = (short)LOWORD(GetMessagePos()); hti.pt.y = (short)HIWORD(GetMessagePos()); ScreenToClient(pnmh->hwndFrom, &hti.pt); - if (HitTest(&hti)) - if (hti.flags & TVHT_ONITEMICON) - InvertCheck(hti.hItem); + if (HitTest(&hti)) { + if (m_bCheckBox && (hti.flags & TVHT_ONITEMICON) || !m_bCheckBox && (hti.flags & TVHT_ONITEMSTATEICON)) { + if (m_bCheckBox) + InvertCheck(hti.hItem); + NotifyChange(); + } + } } return FALSE; @@ -1591,8 +1598,6 @@ void CCtrlTreeView::InvertCheck(HTREEITEM hItem) tvi.iImage = tvi.iSelectedImage = !tvi.iImage; SetItem(&tvi); - - NotifyChange(); } void CCtrlTreeView::TranslateItem(HTREEITEM hItem) diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp index 9f7fe81ef4..2b51b9e718 100644 --- a/src/modules/extraicons/options_ei.cpp +++ b/src/modules/extraicons/options_ei.cpp @@ -246,7 +246,7 @@ public: CDlgBase(hInst, IDD_EI_OPTIONS), m_tree(this, IDC_EXTRAORDER) { - m_tree.SetFlags(MTREE_CHECKBOX | MTREE_DND | MTREE_MULTISELECT); + m_tree.SetFlags(MTREE_DND | MTREE_MULTISELECT); } virtual void OnInitDialog() -- cgit v1.2.3