545 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 - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...