本文整理汇总了C++中wxScrollEvent::GetEventType方法的典型用法代码示例。如果您正苦于以下问题:C++ wxScrollEvent::GetEventType方法的具体用法?C++ wxScrollEvent::GetEventType怎么用?C++ wxScrollEvent::GetEventType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxScrollEvent
的用法示例。
在下文中一共展示了wxScrollEvent::GetEventType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnOffsetScroll
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();
}
示例2: QtOnScrollBarEvent
// 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 );
}
}
示例3: onVolChange
void TrackStatusHandler::onVolChange(wxScrollEvent& event) {
if (event.GetEventType() == wxEVT_SCROLL_CHANGED) {
if (m_pipeline != NULL) {
m_pipeline->setVolume(event.GetPosition());
}
}
}
示例4: onPosChange
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;
}
}
}
示例5: OnScroll
//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
}
示例6: if
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();
}
示例7:
bool
AnimationFrame::OnSlider_isNextBeatEvent(wxScrollEvent& event) {
wxEventType pEventType = event.GetEventType();
return (pEventType == wxEVT_SCROLL_LINEDOWN || pEventType == wxEVT_SCROLL_PAGEDOWN);
}