MCPcopy Create free account
hub / github.com/TankOs/SFGUI / HandleMouseButtonEvent

Method HandleMouseButtonEvent

src/SFGUI/Notebook.cpp:460–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460void Notebook::HandleMouseButtonEvent( sf::Mouse::Button button, bool press, int /*x*/, int /*y*/ ) {
461 if( ( button != sf::Mouse::Button::Left ) ) {
462 return;
463 }
464
465 float scroll_speed( Context::Get().GetEngine().GetProperty<float>( "ScrollSpeed", shared_from_this() ) );
466
467 m_scrolling_forward = false;
468 m_scrolling_backward = false;
469
470 Invalidate();
471
472 if( m_forward_scroll_prelight && press ) {
473 m_scrolling_forward = true;
474 m_elapsed_time = ( 1.f / scroll_speed );
475 return;
476 }
477 else if( m_backward_scroll_prelight && press ) {
478 m_scrolling_backward = true;
479 m_elapsed_time = ( 1.f / scroll_speed );
480 return;
481 }
482
483 if( !press ) {
484 return;
485 }
486
487 if( m_prelight_tab < 0 ) {
488 return;
489 }
490
491 SetCurrentPage( m_prelight_tab );
492}
493
494bool Notebook::HandleAdd( Widget::Ptr child ) {
495 auto allowed = false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected