MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / OnLButtonDown

Function OnLButtonDown

Libraries/PropertyGrid/PropertyList.h:728–762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726 }
727
728 LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
729 {
730 if( ::GetFocus() != m_hWnd ) SetFocus();
731
732 LRESULT lRes = DefWindowProc(uMsg, wParam, lParam);
733
734 // Should we do some column resize?
735 // NOTE: Apparently the ListBox control will internally do SetCapture() to
736 // capture all mouse-movements.
737 m_iPrevious = 0;
738 int iIndent = (m_dwExtStyle & PLS_EX_CATEGORIZED) != 0 ? CATEGORY_INDENT : 0;
739 if( (m_dwExtStyle & PLS_EX_NOCOLUMNRESIZE) == 0 &&
740 GET_X_LPARAM(lParam) == m_iMiddle + iIndent )
741 {
742 m_iPrevious = GET_X_LPARAM(lParam);
743 }
744
745 int idx = GetCurSel();
746 if( idx != -1 ) {
747 IProperty* prop = reinterpret_cast<IProperty*>(TBase::GetItemData(idx));
748 ATLASSERT(prop);
749 // Ask owner first
750 NMPROPERTYITEM nmh = { m_hWnd, GetDlgCtrlID(), PIN_CLICK, prop };
751 if( ::SendMessage(GetParent(), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh) == 0 ) {
752 // Translate into action
753 if( (m_dwExtStyle & PLS_EX_CATEGORIZED) != 0 && GET_X_LPARAM(lParam) < CATEGORY_INDENT ) {
754 prop->Activate(PACT_EXPAND, 0);
755 }
756 else {
757 if( prop->IsEnabled() ) prop->Activate(PACT_CLICK, lParam);
758 }
759 }
760 }
761 return lRes;
762 }
763
764 LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
765 {

Callers

nothing calls this directly

Calls 4

GetCurSelFunction · 0.85
IsEnabledMethod · 0.80
GetItemDataFunction · 0.70
ActivateMethod · 0.45

Tested by

no test coverage detected