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

Method OnMouseEvent

SOUI/src/control/SListView.cpp:505–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503 }
504
505 LRESULT SListView::OnMouseEvent(UINT uMsg,WPARAM wParam,LPARAM lParam)
506 {
507 SetMsgHandled(FALSE);
508 if(!m_adapter)
509 {
510 return 0;
511 }
512
513 LRESULT lRet=0;
514 CPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
515
516
517 if(m_itemCapture)
518 {
519 CRect rcItem=m_itemCapture->GetItemRect();
520 pt.Offset(-rcItem.TopLeft());
521 lRet = m_itemCapture->DoFrameEvent(uMsg,wParam,MAKELPARAM(pt.x,pt.y));
522 }
523 else
524 {
525 if(uMsg==WM_LBUTTONDOWN || uMsg== WM_RBUTTONDOWN || uMsg==WM_MBUTTONDOWN)
526 {//交给panel处理
527 __super::ProcessSwndMessage(uMsg,wParam,lParam,lRet);
528 }
529
530 SItemPanel * pHover=HitTest(pt);
531 if(pHover!=m_pHoverItem)
532 {
533 SItemPanel * nOldHover=m_pHoverItem;
534 m_pHoverItem=pHover;
535 if(nOldHover)
536 {
537 nOldHover->DoFrameEvent(WM_MOUSELEAVE,0,0);
538 RedrawItem(nOldHover);
539 }
540 if(m_pHoverItem)
541 {
542 m_pHoverItem->DoFrameEvent(WM_MOUSEHOVER,wParam,MAKELPARAM(pt.x,pt.y));
543 RedrawItem(m_pHoverItem);
544 }
545 }
546 if(m_pHoverItem)
547 {
548 m_pHoverItem->DoFrameEvent(uMsg,wParam,MAKELPARAM(pt.x,pt.y));
549 }
550 }
551
552 if(uMsg==WM_LBUTTONUP || uMsg== WM_RBUTTONUP || uMsg==WM_MBUTTONUP)
553 {//交给panel处理
554 __super::ProcessSwndMessage(uMsg,wParam,lParam,lRet);
555 }
556 SetMsgHandled(TRUE);
557 return 0;
558 }
559
560 LRESULT SListView::OnKeyEvent(UINT uMsg,WPARAM wParam,LPARAM lParam)
561 {

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