/*---------------------------------------------------------------------- * Class: AmayaScrollBar * Method: OnScroll * Description: -----------------------------------------------------------------------*/ void AmayaScrollBar::OnScroll( wxScrollEvent& event ) { /* this flag is necessary because 2 events occure when up/down button is pressed (it's an optimisation) this hack works because OnLineDown is called before OnScroll, but becareful the events orders could change in future wxWidgets releases or can be platform specific */ if (m_IgnoreNextScrollEvent) { m_IgnoreNextScrollEvent = FALSE; event.Skip(); return; } if (event.GetOrientation() == wxHORIZONTAL) { TTALOGDEBUG_3( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnScroll [wxHORIZONTAL][frameid=%d][pos=%d][pagesize=%d]"), m_ParentFrameID, event.GetPosition(), GetPageSize() ); FrameHScrolledCallback( m_ParentFrameID, event.GetPosition(), GetPageSize() ); } else if (event.GetOrientation() == wxVERTICAL) { TTALOGDEBUG_3( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnScroll [wxVERTICAL][frameid=%d][pos=%d][pagesize=%d]"), m_ParentFrameID, event.GetPosition(), GetPageSize() ); FrameVScrolledCallback( m_ParentFrameID, event.GetPosition() ); } }
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 bmImage::OnScrollChanged(wxScrollEvent& event) { bmImageFrame* p = ((bmImageFrame*)GetParent()); if (event.GetOrientation() == wxHORIZONTAL) { p->setScroll(cv::Vec2f(event.GetPosition(), p->getScroll()[1])); } else if (event.GetOrientation() == wxVERTICAL) { p->setScroll(cv::Vec2f(p->getScroll()[1], event.GetPosition())); } }
void BrushThicknessPanel::OnScroll(wxScrollEvent& event) { static const int lookup_table[10] = {1,2,3,5,8,13,23,35,50,80}; use_button->SetValue(true); ASSERT(event.GetPosition() >= 1); ASSERT(event.GetPosition() <= 10); //printf("SELECT[%d] = %d\n", event.GetPosition()-1, lookup_table[event.GetPosition()-1]); gui.ActivatePalette(GetParentPalette()); gui.SetBrushThickness(true, lookup_table[event.GetPosition()-1], 100); }
void ExtraPanel::OnChangeEqualizer( wxScrollEvent &event ) { aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE); char psz_values[102]; memset( psz_values, 0, 102 ); /* Smoothing */ int i_diff = event.GetPosition() - i_values[ event.GetId() - Band0_Event ]; i_values[ event.GetId() - Band0_Event] = event.GetPosition(); for( int i = event.GetId() + 1 ; i <= Band9_Event ; i++ ) { int i_new = band_sliders[ i-Band0_Event ]->GetValue() + (int)( i_diff * pow( (float)i_smooth / 100 , i- event.GetId() ) ) ; if( i_new < 0 ) i_new = 0; if( i_new > 400 ) i_new = 400; band_sliders[ i-Band0_Event ]->SetValue( i_new ); } for( int i = Band0_Event ; i < event.GetId() ; i++ ) { int i_new = band_sliders[ i-Band0_Event ]->GetValue() + (int)( i_diff * pow( (float)i_smooth / 100 , event.GetId() - i ) ); if( i_new < 0 ) i_new = 0; if( i_new > 400 ) i_new = 400; band_sliders[ i-Band0_Event ]->SetValue( i_new ); } /* Write the new bands values */ for( int i = 0 ; i < 10 ; i++ ) { char psz_val[5]; float f_val = (float)( 400 - band_sliders[i]->GetValue() ) / 10- 20 ; sprintf( psz_values, "%s %f", psz_values, f_val ); sprintf( psz_val, "%.1f", f_val ); band_texts[i]->SetLabel( band_frequencies[i] + wxT("\n") + wxU( psz_val ) + wxT("dB" ) ); } if( p_aout == NULL ) { config_PutPsz( p_intf, "equalizer-bands", psz_values ); } else { var_SetString( p_aout, "equalizer-bands", psz_values ); config_PutPsz( p_intf, "equalizer-bands", psz_values ); b_my_update = VLC_TRUE; vlc_object_release( p_aout ); } }
// Explicitly call default scroll behaviour void wxMDIClientWindow::OnScroll(wxScrollEvent& event) { // Note: for client windows, the scroll position is not set in // WM_HSCROLL, WM_VSCROLL, so we can't easily determine what // scroll position we're at. // This makes it hard to paint patterns or bitmaps in the background, // and have the client area scrollable as well. if ( event.GetOrientation() == wxHORIZONTAL ) m_scrollX = event.GetPosition(); // Always returns zero! else m_scrollY = event.GetPosition(); // Always returns zero! event.Skip(); }
void ExtraPanel::OnNormvolSlider( wxScrollEvent &event ) { aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE); if( p_aout != NULL ) { var_SetFloat( p_aout, "norm-max-level", (float)event.GetPosition()/10 ); vlc_object_release( p_aout ); } else { config_PutFloat( p_intf, "norm-max-level", (float)event.GetPosition()/10 ); } }
///////////// // On scroll void BaseGrid::OnScroll(wxScrollEvent &event) { int newPos = event.GetPosition(); if (yPos != newPos) { yPos = newPos; Refresh(false); } }
//2d influence void BrushToolDlg::OnBrush2dinflChange(wxScrollEvent &event) { int ival = event.GetPosition(); double val = double(ival)/100.0; wxString str = wxString::Format("%.2f", val); m_brush_2dinfl_text->SetValue(str); }
void TrackStatusHandler::onVolChange(wxScrollEvent& event) { if (event.GetEventType() == wxEVT_SCROLL_CHANGED) { if (m_pipeline != NULL) { m_pipeline->setVolume(event.GetPosition()); } } }
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); }
//selection adjustment //scalar translate void BrushToolDlg::OnBrushSclTranslateChange(wxScrollEvent &event) { int ival = event.GetPosition(); double val = double(ival)/10.0; wxString str = wxString::Format("%.1f", val); m_brush_scl_translate_text->SetValue(str); }
// 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 CGradientCtrl::OnSliderScroll(wxScrollEvent& event) { BEATS_ASSERT(m_pSelectedCursor != nullptr); BEATS_ASSERT(m_pSelectedCursor->GetType() == eCT_Alpha); int value = event.GetPosition(); m_pSelectedCursor->SetColor(wxColor(value, value, value)); Refresh(true); }
void MyFrame::OnSlider6(wxScrollEvent& event){ double c[3]; pConeActor->GetProperty()->GetColor(c); c[2] = event.GetPosition() / 255.0; pConeActor->GetProperty()->SetColor(c); m_pVTKWindow->Render(); SetStatusText(_T("Updated blue color.")); }
void ColocalizationDlg::OnMaxSizeChange(wxScrollEvent &event) { int ival = event.GetPosition(); wxString str = wxString::Format("%d", ival*100); if (ival == 101) str = "Ignored"; m_max_size_text->SetValue(str); }
void wxHexView::OnVScroll(wxScrollEvent &evt) { unsigned int pos = evt.GetPosition(); if (pos == m_curLine) return; GotoLine(pos); }
void SeriesTool::m_slider_line_weightOnScroll(wxScrollEvent & event) { if (m_series == nullptr) return; m_series->GetRenderer()->GetLine()->SetThickness(event.GetPosition()); m_series->Validate(); }
void AnimationFrame::OnSlider_anim_gotosheet(wxScrollEvent& event) { if (mAnimationView) { mAnimationView->GotoSheet(event.GetPosition()-1); } }
// -------------------------------------------------------------------------------- // void guEq10Band::OnBandChanged( wxScrollEvent &event ) { wxSlider * Band = ( wxSlider * ) event.GetEventObject(); if( Band ) { long BandIndex; Band->GetLabel().ToLong( &BandIndex ); //guLogMessage( wxT( "Band%u = %i (%i)" ), BandIndex, event.GetPosition(), m_PresetComboBox->GetSelection() ); m_MediaCtrl->SetEqualizerBand( BandIndex, event.GetPosition() ); if( m_PresetComboBox->GetSelection() != wxNOT_FOUND ) m_BandChanged = true; OnPresetText( event ); m_Values[ BandIndex ]->SetLabel( wxString::Format( wxT( "%.1f" ), double( event.GetPosition() ) / 10.0 ) ); m_Values[ BandIndex ]->GetContainingSizer()->Layout(); } }
void SpinSlider::OnScroll(wxScrollEvent& event) { int pos = event.GetPosition(); m_bSettingProcess = true; m_spinctrl->SetValue(pos); // m_spinctrl->SetValue("43,4"); m_bSettingProcess = false; SendEvent(); }
void MainFrame::OnSliderScroll( wxScrollEvent& event ) { Control::getInstance()->setThreshold(event.GetPosition()); // process the image Control::getInstance()->process(); //show the result image; this->processed_image->SetBitmap(Control::getInstance()->getResult()); }
void tpanelscrollbar::OnScrollTrack(wxScrollEvent &event) { #if TPANEL_SCROLLING_COPIOUS_LOGGING LogMsgFormat(LOGT::TPANELTRACE, "TSCL: tpanelscrollbar::OnScrollTrack %s, %d", cstr(GetThisName()), event.GetPosition()); #endif int y = event.GetPosition(); ScrollItemsForPosition(y); SetThumbPosition(y); event.Skip(); }
void PanelSurface::OnSliderOpacity( wxScrollEvent& event ) { if ( m_listBoxLayers->GetSelection() != wxNOT_FOUND ) { LayerSurface* layer = ( LayerSurface* )( void* )m_listBoxLayers->GetClientData( m_listBoxLayers->GetSelection() ); if ( layer ) layer->GetProperties()->SetOpacity( event.GetPosition() / 100.0 ); } }
void SeriesTool::m_slider_marks_sizeOnScroll(wxScrollEvent & event) { if (m_series == nullptr) return; m_series->GetRenderer()->GetMarker()->SetSize(event.GetPosition()); m_series->Validate(); m_combo_marks_style->CopyMarkerAttribs((plot::wxMarker*)m_series->GetRenderer()->GetMarker()); }
void AudioBox::OnVerticalZoom(wxScrollEvent &event) { int pos = mid(1, event.GetPosition(), 100); OPT_SET("Audio/Zoom/Vertical")->SetInt(pos); double value = pow(pos / 50.0, 3); audioDisplay->SetAmplitudeScale(value); if (!VolumeBar->IsEnabled()) { VolumeBar->SetValue(pos); controller->SetVolume(value); } }
// -------------------------------------------------------------------------------- // void guEq10Band::OnUpdateLabel( wxScrollEvent &event ) { wxSlider * Band = ( wxSlider * ) event.GetEventObject(); if( Band ) { long BandIndex; Band->GetLabel().ToLong( &BandIndex ); m_Values[ BandIndex ]->SetLabel( wxString::Format( wxT( "%.1f" ), double( event.GetPosition() ) / 10.0 ) ); m_Values[ BandIndex ]->GetContainingSizer()->Layout(); } }
void LifeFrame::OnSlider(wxScrollEvent& event) { m_interval = event.GetPosition() * 100; if (m_running) { OnStop(); OnStart(); } UpdateInfoText(); }
void ClimatologyDialog::OnTimeline( wxScrollEvent& event ) { wxDateTime &timeline = g_pOverlayFactory->m_CurrentTimeline; wxDateTime old = timeline; timeline.SetToYearDay((event.GetPosition() - 1) % 365 + 1); m_cMonth->SetSelection(timeline.GetMonth()); m_sDay->SetRange(1, wxDateTime::GetNumberOfDays(timeline.GetMonth(), 1999)); // not a leap year m_sDay->SetValue(timeline.GetDay()); if (old.IsSameDate(timeline)) return; UpdateTrackingControls(); wxDateTime now = timeline; now.SetYear(wxDateTime::Now().GetYear()+ ( event.GetPosition() > 365?1:0)); pPlugIn->SendTimelineMessage(now); // pPlugIn->GetOverlayFactory()->m_bUpdateCyclones = true; RefreshRedraw(); }
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; } } }