summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-14 16:34:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-14 16:34:28 +0000
commitc7577005f0d52def37928a96b66b72755e559a97 (patch)
tree45b894a05feff99b518acacbf1ebea380a7d08d7 /src
parentf90f9a3734f3807ff0c6fb0c1c8e29dea04cba73 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/ui_utils.cpp21
-rw-r--r--src/modules/extraicons/options_ei.cpp2
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()