[SOLVED] Hscroll and hslider

plazagudo

11-03-2009 13:46:53

hi, I trying to use the a hscroll with skin hslider, but i don't know move it.
I have the track i the initial position and y don't know how put it in the middle with my mouse.

MyGUI::HScrollPtr sliderMov=mGUI->findWidget<MyGUI::HScroll>("variacionMovimiento");
sliderMov->setTrackSize(16);
sliderMov->eventMouseButtonPressed=MyGUI::newDelegate(this, &MovimientosManual::cambiaPosicion);


void cambiaPosicion(MyGUI::WidgetPtr _emisor, int left, int top, MyGUI::MouseButton id)
{
MyGUI::HScrollPtr sliderMov=MyGUI::castWidget<MyGUI::HScroll>(_emisor);
sliderMov->setScrollPosition(200);
}

thanks.

Altren

11-03-2009 14:15:31

sliderMov->setScrollPosition(8); - scroll position in value from 0 to range - 1

plazagudo

11-03-2009 14:20:23

but i put this and the track come back to the initial position, i want to keep it in the new position.

Thanks.

plazagudo

11-03-2009 14:29:16

thanks, i understand it at last.