From aceb68f48b2bb74ca86acc732af5dcf5497d9858 Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 29 Sep 2014 04:03:29 +0000 Subject: [PATCH] Improve slider implementation in wxQT, thanks @seandpagnier git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/qt/slider.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qt/slider.cpp b/src/qt/slider.cpp index 2f944c9b83..7b4ec7b95c 100644 --- a/src/qt/slider.cpp +++ b/src/qt/slider.cpp @@ -33,6 +33,11 @@ void wxQtSlider::valueChanged(int position) wxSlider *handler = GetHandler(); if ( handler ) { + wxScrollEvent e(wxEVT_SCROLL_CHANGED, handler->GetId(), position, + wxQtConvertOrientation( orientation( ) )); + EmitEvent( e ); + + // and also generate a command event for compatibility wxCommandEvent event( wxEVT_SLIDER, handler->GetId() ); event.SetInt( position ); EmitEvent( event ); @@ -72,6 +77,7 @@ bool wxSlider::Create(wxWindow *parent, SetRange( minValue, maxValue ); m_qtSlider->blockSignals(false); +#if 0 // there are not normally ticks for a wxSlider // draw ticks marks (default bellow if horizontal, right if vertical): if ( style & wxSL_VERTICAL ) { @@ -83,6 +89,7 @@ bool wxSlider::Create(wxWindow *parent, m_qtSlider->setTickPosition( style & wxSL_TOP ? QSlider::TicksAbove : QSlider::TicksBelow ); } +#endif return QtCreateControl( parent, id, pos, size, style, validator, name ); }