void CXTPReportGroupRow::OnClick(CPoint ptClicked) { // expand/collapse on single click at the collapse bitmap if (m_rcCollapse.PtInRect(ptClicked) && m_rcCollapse.PtInRect(m_pControl->m_ptMouseDown)) { BOOL bExp = IsExpanded(); SetSelectedMostDeepChilds(); SetExpanded(!bExp); UpdateSelectedMostDeepChilds(); BOOL bControlKey = (GetKeyState(VK_CONTROL) < 0) || m_pControl->m_bControlKeyAlwaysOn; BOOL bShiftKey = (GetKeyState(VK_SHIFT) < 0); if ((bControlKey || bShiftKey) && bExp && m_pControl->m_bSelectionExcludeGroupRows) m_pControl->UnselectGroupRows(); } }
void CXTPReportGroupRow::OnClick(CPoint ptClicked) { // expand/collapse on single click at the collapse bitmap if ( m_rcCollapse.PtInRect(m_pControl->m_mouseDownState.ptMouse) && m_rcCollapse.PtInRect(ptClicked) && !IsLockExpand()) { BOOL bExpanded = IsExpanded(); SetSelectedMostDeepChilds(); SetExpanded(!bExpanded); UpdateSelectedMostDeepChilds(); const BOOL bKeyControl = (::GetKeyState(VK_CONTROL) < 0) || m_pControl->m_bMultiSelectionMode; const BOOL bKeyShift = (::GetKeyState(VK_SHIFT) < 0); if ((bKeyControl || bKeyShift) && bExpanded && m_pControl->m_bSelectionExcludeGroupRows) { m_pControl->UnselectGroupRows(); } } }