/// 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();
// Any top level sub-widget must have the panel returned by panel
// for parent
- std::cout<<"Creando SLIDER -- 2 "<<std::endl;
+ std::cout<<"Creando SLIDER -- 2 "<<std::endl;
mwtSlider = new Wt::WSlider(wtorientation);
mwtSlider->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
//---------------------------------------------------------------------
// 2) Insertion of the components in the window
std::cout<<"Creando SLIDER -- 4 "<<std::endl;
+ layout->addWidget(new Wt::WText(title),Wt::WBorderLayout::North);
layout->addWidget(mwtSlider,Wt::WBorderLayout::Center);
std::cout<<"Creando SLIDER -- 5 "<<std::endl;
// Insert the sizer in the main panel and refresh the layout
mBox->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"));
+
+ }
//-------------------------------------------------------------------------
bbtkDebugMessage("process",3,
"Slider "<<bbGetName()<<" input="
<<bbGetInputIn()<<std::endl);
+
// desperate try // JPR
if ( bbGetInputMin() != ((SliderWidget*)bbGetOutputWidget())->GetMin() || bbGetInputMax() != ((SliderWidget*)bbGetOutputWidget())->GetMax() )