MCPcopy Create free account
hub / github.com/cinience/RedisStudio / DoEvent

Method DoEvent

DuiLib/Control/UIScrollBar.cpp:524–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522 }
523
524 void CScrollBarUI::DoEvent(TEventUI& event)
525 {
526 if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
527 if( m_pOwner != NULL ) m_pOwner->DoEvent(event);
528 else CControlUI::DoEvent(event);
529 return;
530 }
531
532 if( event.Type == UIEVENT_SETFOCUS )
533 {
534 return;
535 }
536 if( event.Type == UIEVENT_KILLFOCUS )
537 {
538 return;
539 }
540 if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK )
541 {
542 if( !IsEnabled() ) return;
543
544 m_nLastScrollOffset = 0;
545 m_nScrollRepeatDelay = 0;
546 m_pManager->SetTimer(this, DEFAULT_TIMERID, 50U);
547
548 if( ::PtInRect(&m_rcButton1, event.ptMouse) ) {
549 m_uButton1State |= UISTATE_PUSHED;
550 if( !m_bHorizontal ) {
551 if( m_pOwner != NULL ) m_pOwner->LineUp();
552 else SetScrollPos(m_nScrollPos - m_nLineSize);
553 }
554 else {
555 if( m_pOwner != NULL ) m_pOwner->LineLeft();
556 else SetScrollPos(m_nScrollPos - m_nLineSize);
557 }
558 }
559 else if( ::PtInRect(&m_rcButton2, event.ptMouse) ) {
560 m_uButton2State |= UISTATE_PUSHED;
561 if( !m_bHorizontal ) {
562 if( m_pOwner != NULL ) m_pOwner->LineDown();
563 else SetScrollPos(m_nScrollPos + m_nLineSize);
564 }
565 else {
566 if( m_pOwner != NULL ) m_pOwner->LineRight();
567 else SetScrollPos(m_nScrollPos + m_nLineSize);
568 }
569 }
570 else if( ::PtInRect(&m_rcThumb, event.ptMouse) ) {
571 m_uThumbState |= UISTATE_CAPTURED | UISTATE_PUSHED;
572 ptLastMouse = event.ptMouse;
573 m_nLastScrollPos = m_nScrollPos;
574 }
575 else {
576 if( !m_bHorizontal ) {
577 if( event.ptMouse.y < m_rcThumb.top ) {
578 if( m_pOwner != NULL ) m_pOwner->PageUp();
579 else SetScrollPos(m_nScrollPos + m_rcItem.top - m_rcItem.bottom);
580 }
581 else if ( event.ptMouse.y > m_rcThumb.bottom ){

Callers

nothing calls this directly

Calls 14

SetTimerMethod · 0.80
SendNotifyMethod · 0.80
KillTimerMethod · 0.80
GetPaintWindowMethod · 0.80
LineUpMethod · 0.45
LineLeftMethod · 0.45
LineDownMethod · 0.45
LineRightMethod · 0.45
PageUpMethod · 0.45
PageDownMethod · 0.45
PageLeftMethod · 0.45
PageRightMethod · 0.45

Tested by

no test coverage detected