【问题标题】:gain control by wxSlidergain control by wxSlider
【发布时间】:2022-12-27 19:54:51
【问题描述】:

I am using wxSlider to adjust gain in my Windows C++ application. Bind() function code:

sliderAmp->Bind(wxEVT_COMMAND_SLIDER_UPDATED, wxScrollEventHandler(App::OnSliderAmpChanged), this);

With such an implementation, the effect of "bounce" of values appears, i.e. multiple identical values may appear.

How to change the code so that the gain control is more reasonable?

【问题讨论】:

    标签: c++ slider wxwidgets


    【解决方案1】:

    Notice that wxEVT_COMMAND_SLIDER_UPDATED is an alias of wxEVT_SLIDER, and in the latest versions only the latter remained documented.

    I think you need to handle only wxEVT_SCROLL_CHANGED. Unfortunately that is documented to beMSW only.

    For non-MSW, you might get away with handling wxEVT_SCROLL_THUMBRELEASE. In case you want keyboard support you might need to add handling of other events. See wxSlider Class Reference too.

    【讨论】:

      猜你喜欢
      • 2014-07-20
      • 2023-04-03
      • 2021-10-12
      • 1970-01-01
      • 2015-06-27
      • 1970-01-01
      • 2013-12-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多