159 views
in GUI Development by

Hi EW Team,
I want to implement a vertical list where it always display 3 values. I want to link the middle one to a property to store it, but I don't want to have to click on the value to select it: is it possible?
I tried to look at the documentation of the vertical list for my version but couldn't find something relevant for my case.
I would just have to slide touch on the vertical list until I have my value displayed in the middle and it would be it, plus if possible having a lighter shade of background to show it's the current one.

Thank you in advance, Best regards.

1 Answer

+1 vote
by
 
Best answer

Hello,

please have a look into the example "BezierClock" and navigate to the class TimePicker. It shows exactly your use case:

Within the different OnLoadItem() slot methods you will find the key to get the centered item:

// Get the number of the item in the center of the list
var int32 itemCenter = ListHour.GetItemAtPosition( ListHour.Bounds.center );

This number can be used to assign it to your property.

Does this help?

Best regards,

Manfred.

by
Thank you, this helped a lot!

I have a question following this: I have a property that stores the current value, but when I leave and I reenter I want the value to start at a value x (example, for a list between -50 and 100, i would like to start at 7).

How could I do that?
by
I found how to do this by overriding the method UpdateViewState in the owner class of the component, modifying the value there

thank you :)

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

...