void wxHugeScrollBar::OnOffsetScroll( wxScrollEvent& event ){ if( m_range <= 2147483647){ m_thumb = event.GetPosition(); } else{ //64bit mode int64_t here =event.GetPosition(); if(here == 2147483646) //if maximum set m_thumb = m_range-1; //than give maximum m_thumb which is -1 from range else m_thumb = static_cast<int64_t>(here*(m_range/2147483647.0)); } wxYieldIfNeeded(); #ifdef _DEBUG_SCROLL_ if(event.GetEventType() == wxEVT_SCROLL_CHANGED) std::cout << "wxEVT_SCROLL_CHANGED" << std::endl; if(event.GetEventType() == wxEVT_SCROLL_THUMBTRACK) std::cout << "wxEVT_SCROLL_THUMBTRACK" << std::endl; if(event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE) std::cout << "wxEVT_SCROLL_THUMBRELEASE" << std::endl; if( event.GetEventType() == wxEVT_SCROLL_LINEDOWN ) std::cout << "wxEVT_SCROLL_LINEDOWN" << std::endl; if( event.GetEventType() == wxEVT_SCROLL_LINEUP ) std::cout << "wxEVT_SCROLL_LINEUP" << std::endl; if( event.GetEventType() == wxEVT_SCROLL_PAGEUP ) std::cout << "wxEVT_SCROLL_PAGEUP" << std::endl; if( event.GetEventType() == wxEVT_SCROLL_PAGEDOWN ) std::cout << "wxEVT_SCROLL_PAGEDOWN" << std::endl; if( event.GetEventType() == wxEVT_SCROLLWIN_LINEUP ) std::cout << "wxEVT_SCROLLWIN_LINEUP" << std::endl; if( event.GetEventType() == wxEVT_SCROLLWIN_LINEDOWN ) std::cout << "wxEVT_SCROLLWIN_LINEDOWN" << std::endl; #endif event.Skip(); }
void tpanelscrollbar::OnScrollHandler(wxScrollEvent &event) { wxEventType type = event.GetEventType(); bool upok = (type == wxEVT_SCROLL_TOP || type == wxEVT_SCROLL_LINEUP || type == wxEVT_SCROLL_PAGEUP || type == wxEVT_SCROLL_THUMBRELEASE || type == wxEVT_SCROLL_CHANGED); bool downok = (type == wxEVT_SCROLL_BOTTOM || type == wxEVT_SCROLL_LINEDOWN || type == wxEVT_SCROLL_PAGEDOWN || type == wxEVT_SCROLL_THUMBRELEASE || type == wxEVT_SCROLL_CHANGED); int y; if (type == wxEVT_SCROLL_LINEUP || type == wxEVT_SCROLL_LINEDOWN) { y = GetThumbPosition(); if (type == wxEVT_SCROLL_LINEUP) { y -= gc.linescrollspeed; } else { y += gc.linescrollspeed; } SetThumbPosition(std::max(0, y)); ScrollItems(); } else { if (type == wxEVT_SCROLLWIN_THUMBRELEASE || type == wxEVT_SCROLL_CHANGED) { y = event.GetPosition(); SetThumbPosition(y); } else { y = GetThumbPosition(); } ScrollItemsForPosition(y); event.Skip(); } OnScrollHandlerCommon(upok, downok, 0, y); }
// Handle event from scrollbars void wxWindowQt::QtOnScrollBarEvent( wxScrollEvent& event ) { wxEventType windowEventType = 0; // Map the scroll bar event to the corresponding scroll window event: wxEventType scrollBarEventType = event.GetEventType(); if ( scrollBarEventType == wxEVT_SCROLL_TOP ) windowEventType = wxEVT_SCROLLWIN_TOP; else if ( scrollBarEventType == wxEVT_SCROLL_BOTTOM ) windowEventType = wxEVT_SCROLLWIN_BOTTOM; else if ( scrollBarEventType == wxEVT_SCROLL_PAGEUP ) windowEventType = wxEVT_SCROLLWIN_PAGEUP; else if ( scrollBarEventType == wxEVT_SCROLL_PAGEDOWN ) windowEventType = wxEVT_SCROLLWIN_PAGEDOWN; else if ( scrollBarEventType == wxEVT_SCROLL_LINEUP ) windowEventType = wxEVT_SCROLLWIN_LINEUP; else if ( scrollBarEventType == wxEVT_SCROLL_LINEDOWN ) windowEventType = wxEVT_SCROLLWIN_LINEDOWN; else if ( scrollBarEventType == wxEVT_SCROLL_THUMBTRACK ) windowEventType = wxEVT_SCROLLWIN_THUMBTRACK; else if ( scrollBarEventType == wxEVT_SCROLL_THUMBRELEASE ) windowEventType = wxEVT_SCROLLWIN_THUMBRELEASE; if ( windowEventType != 0 ) { wxScrollWinEvent e( windowEventType, event.GetPosition(), event.GetOrientation() ); ProcessWindowEvent( e ); } }
void TrackStatusHandler::onVolChange(wxScrollEvent& event) { if (event.GetEventType() == wxEVT_SCROLL_CHANGED) { if (m_pipeline != NULL) { m_pipeline->setVolume(event.GetPosition()); } } }
void TrackStatusHandler::onPosChange(wxScrollEvent& event) { // only allow scrolling if not a stream. if (m_pipelineType == PIPELINE_STREAM) { return; } // else, allow position seeking. m_scrolling = true; if (event.GetEventType() == wxEVT_SCROLL_CHANGED) { if (m_pipeline != NULL) { m_pipeline->seekSeconds(event.GetPosition()); m_scrolling = false; } } }
//Scrolling. Calculate positions void wxFixWidthImportCtrl::OnScroll(wxScrollEvent &sevent) { m_NowType = sevent.GetEventType(); //Uncomment next iy you want to avoid some flicker. //But dragging-scroll will be not so good /* //When this event arrives here. //Event::GetTimestamp() is when it was fired. m_timeNow = wxGetLocalTimeMillis(); //We want to avoid flicker when many EVT_SCROLL_THUMBTRACK are fired if ( m_timeNow - m_timeInit < 200 && m_lastType == m_NowType ) return; */ //Avoid also consecutive THUMBRELEASE ENDSCROLL, they are so similar ... if ( m_lastType == wxEVT_SCROLL_THUMBRELEASE && m_NowType == wxEVT_SCROLL_CHANGED ) { SetFocus(); //Avoid blinking bar return; } m_lastType = m_NowType; bool refresNow = false; size_t pos = (size_t) sevent.GetPosition(); if ( sevent.GetId() == FW_SCROH && m_curposX != pos ) { m_curposX = pos; refresNow = true; } if ( sevent.GetId() == FW_SCROV && m_curposL != pos ) { m_curposL = pos; refresNow = true; } if ( refresNow ) { m_timeInit = m_timeNow; //Reinit time Refresh(); } SetFocus(); //Avoid blinking bar }
void Panels::SpeedHacksPanel::Slider_Click(wxScrollEvent &event) { wxSlider* slider = (wxSlider*) event.GetEventObject(); int value = slider->GetValue(); int eventType = event.GetEventType(); if (eventType == wxEVT_SCROLL_PAGEUP || eventType == wxEVT_SCROLL_LINEUP) { if (value > slider->GetMin()) { slider->SetValue(value-1); } } else if (eventType == wxEVT_SCROLL_TOP) { slider->SetValue(slider->GetMin()); } else if (eventType == wxEVT_SCROLL_PAGEDOWN || eventType == wxEVT_SCROLL_LINEDOWN) { if (value < slider->GetMax()) { slider->SetValue(value+1); } } else if (eventType == wxEVT_SCROLL_BOTTOM) { slider->SetValue(slider->GetMax()); } event.Skip(); }
bool AnimationFrame::OnSlider_isNextBeatEvent(wxScrollEvent& event) { wxEventType pEventType = event.GetEventType(); return (pEventType == wxEVT_SCROLL_LINEDOWN || pEventType == wxEVT_SCROLL_PAGEDOWN); }
bool AnimationFrame::OnSlider_isPreviousBeatEvent(wxScrollEvent& event) { wxEventType pEventType = event.GetEventType(); return (pEventType == wxEVT_SCROLL_LINEUP || pEventType == wxEVT_SCROLL_PAGEUP); }