Skip to main content
June 10, 2021
Question

scrolwheel. How to animate before screen enter?

  • June 10, 2021
  • 2 replies
  • 1240 views

Hello!

Look at the code

void CONTROL_SCREENView::setupScreen()
{
 	 CONTROL_SCREENViewBase::setupScreen();
	 MovingSpeed_ScrollWheel.setAnimateToCallback(MovingSpeed_ScrollWheelAnimateToCallback); 
 MovingStep_ScrollWheel.setAnimateToCallback(MovingStep_ScrollWheelAnimateToCallback); 	
 
	MovingStep_ScrollWheel.animateToItem(SETTINGS_IN_RAM.CONTROL_MOVE_DISTANCE);
	 MovingSpeed_ScrollWheel.animateToItem(SETTINGS_IN_RAM.CONTROL_MOVE_SPEED);
	 
	
}

I enter to screen, and I can see how scrollwheel scrolls to position.

I want at first - scrolling to initial position, and than - screen show.

How to do it?

This topic has been closed for replies.

2 replies

Romain DIELEMAN
ST Employee
June 11, 2021

Hi,

In TouchGFX 4.16 you have in the "Interactions" settings a trigger called "Screen transition begins". This trigger will call whatever action you set before the screen you are going to is displayed.

Otherwise what you could do is set the scrollWheel to invisible when entering the screen, do the position change and then set it to visible (use the MovingSpeed_ScrollWheel.setVisible( true or false) function )

/Romain

June 11, 2021

not works..... I got the same result....

Romain DIELEMAN
ST Employee
June 11, 2021

Just realized you actually have the function implemented in the widget already, Look at the "Initial Selected Item" in the ScrollWheel widget settings.

/Romain