MCPcopy Create free account
hub / github.com/SOUI2/soui / OnMouseEvent

Method OnMouseEvent

SOUI/src/control/SMCListView.cpp:788–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

786}
787
788LRESULT SMCListView::OnMouseEvent(UINT uMsg,WPARAM wParam,LPARAM lParam)
789{
790 SetMsgHandled(FALSE);
791
792 if(!m_adapter)
793 {
794 return 0;
795 }
796
797 LRESULT lRet=0;
798 CPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
799
800 if(m_itemCapture)
801 {
802 CRect rcItem=m_itemCapture->GetItemRect();
803 pt.Offset(-rcItem.TopLeft());
804 lRet = m_itemCapture->DoFrameEvent(uMsg,wParam,MAKELPARAM(pt.x,pt.y));
805 }
806 else
807 {
808 if(uMsg==WM_LBUTTONDOWN || uMsg== WM_RBUTTONDOWN || uMsg==WM_MBUTTONDOWN)
809 {//交给panel处理
810 __super::ProcessSwndMessage(uMsg,wParam,lParam,lRet);
811 }
812
813 SItemPanel * pHover=HitTest(pt);
814 if(pHover!=m_pHoverItem)
815 {
816 SItemPanel * nOldHover=m_pHoverItem;
817 m_pHoverItem=pHover;
818 if(nOldHover)
819 {
820 nOldHover->DoFrameEvent(WM_MOUSELEAVE,0,0);
821 RedrawItem(nOldHover);
822 }
823 if(m_pHoverItem)
824 {
825 m_pHoverItem->DoFrameEvent(WM_MOUSEHOVER,wParam,MAKELPARAM(pt.x,pt.y));
826 RedrawItem(m_pHoverItem);
827 }
828 }
829 if(m_pHoverItem)
830 {
831 m_pHoverItem->DoFrameEvent(uMsg,wParam,MAKELPARAM(pt.x,pt.y));
832 }
833 else if (uMsg == WM_LBUTTONDOWN || uMsg == WM_RBUTTONDOWN || uMsg == WM_MBUTTONDOWN)
834 {
835 // 点击空白区域取消选中
836 SetSel(-1, TRUE);
837 }
838
839 }
840
841 if(uMsg==WM_LBUTTONUP || uMsg== WM_RBUTTONUP || uMsg==WM_MBUTTONUP)
842 {//交给panel处理
843 __super::ProcessSwndMessage(uMsg,wParam,lParam,lRet);
844 }
845 SetMsgHandled(TRUE);

Callers

nothing calls this directly

Calls 5

HitTestFunction · 0.85
SetMsgHandledFunction · 0.50
GetItemRectMethod · 0.45
OffsetMethod · 0.45
DoFrameEventMethod · 0.45

Tested by

no test coverage detected