X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=wt%2Fbbtk_wt_PKG%2Fsrc%2FbbwtSlider.cxx;fp=wt%2Fbbtk_wt_PKG%2Fsrc%2FbbwtSlider.cxx;h=dfc7747d5a820fbe0153eab131f35ace4352ada9;hb=aec464d8738507b9d26fc6915c7c063cab636dde;hp=ec59dc405da04832fee0358378a496851e2e042f;hpb=26116b2d4181a4ed3fffa07fbb75ef527d32d740;p=creaWT.git diff --git a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx index ec59dc4..dfc7747 100644 --- a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx @@ -24,6 +24,7 @@ namespace bbwt /// Events callbacks /// Called when the slider is moved void OnSliderTrack(); + void OnSliderMove(); /// Called when the little slider which controls the resolution /// of the main slider is moved (if activated) void OnResolutionOfSlider(); @@ -101,16 +102,16 @@ namespace bbwt // Any top level sub-widget must have the panel returned by panel // for parent - std::cout<<"Creando SLIDER -- 2 "<resize(sizeX,sizeY); mwtSlider->setMinimum(min); mwtSlider->setMaximum(max); mwtSlider->setValue(value); mwtSlider->setTickPosition(Wt::WSlider::TicksBothSides); - mwtSlider->setValueText(title); + //mwtSlider->setValueText(title); mwtSlider->valueChanged().connect(this,&SliderWidget::OnSliderTrack); - mwtSlider->sliderMoved().connect(this,&SliderWidget::OnSliderTrack); + mwtSlider->sliderMoved().connect(this,&SliderWidget::OnSliderMove); // If asked : creation of the other little slider which allows to change @@ -145,6 +146,7 @@ namespace bbwt //--------------------------------------------------------------------- // 2) Insertion of the components in the window std::cout<<"Creando SLIDER -- 4 "<addWidget(new Wt::WText(title),Wt::WBorderLayout::North); layout->addWidget(mwtSlider,Wt::WBorderLayout::Center); std::cout<<"Creando SLIDER -- 5 "<bbSignalOutputModification(std::string("Out")); } + + + //------------------------------------------------------------------------- + void SliderWidget::OnSliderMove() + { + + // When user releases the slider + // we update the output of the box + if(!reactiveOnTrack) + { + mBox->bbSetOutputOut( mwtSlider->value() ); + mBox->bbSetInputIn( mwtSlider->value() ); + } + // and signal that the output has changed + mBox->bbSignalOutputModification(std::string("Out")); + + } //------------------------------------------------------------------------- @@ -235,6 +254,7 @@ namespace bbwt bbtkDebugMessage("process",3, "Slider "<