55 views
in GUI Development by
Hi, In my Embedded Wizard project I have a zone number selection system with a vertical list that does not behave correctly when used on devices with different screen resolutions (<800,480> and <480,272>). Specifically, the ScrollOffset calculation to correctly center the selected item does not work as expected at the lowest resolution, causing an unexpected shift when navigating back and forth in the interface.

updateScrollSlot:

sender; /* the method is called from the sender object */

NoZoneValue = NoZone^;

VerticalList.ScrollOffset = - (( VerticalList.ItemHeight * (NoZoneValue-1)) ) ;

no I know what calculation I have to do to adjust the item in the center with the lowest resolution

1 Answer

0 votes
by

Hello Manuel,

possibly your calculation is ignoring the size of the Vertical List. Depending on the size of the Vertical List more or less items are visible. To scroll the list so that item Foo is in its center following could be done:

VerticalList.ScrollOffset = ( VerticalList.Bounds.h / 2 ) -
                            ( Foo * VerticalList.ItemHeight ) - 
                            ( VerticalList.ItemHeight / 2 );

Best regards

Paul Banach

by

Hi paul what u mean with Foo? i don t understand very well, 

anyway i can show you what i do, i can show you if i have to change something in my slot method :


 

 

 

 

 

by

Hello Manuel,

what u mean with Foo? i don t understand very well, 

it is the number of the item to center inside the list.

Best regards

Paul Banach

 

by
Hi Paul, I'm afraid it doesn't work correctly, I tried with your method but the item at the time of scroll always returns to 1 and does not dwell on the number I want
by
Hello Manuel,

difficult to deduce what is the problem based on the available information. I would:

1. Add trace statement to the implementation to track what values have variables and expressions affecting the position.

2. Reduce the application to a very simple example and try to narrow down the behaviour with it.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...