cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Example for a Pick List

MThom.2
Associate II

Does anyone have a simple example for a picklist? I tried making a custom contrainer for a "pick list item" then I used a scrollwheel container to make a list. But how do I edit the code to change the names of the items?

I tried following the example from "Tutorial 4: Creating a Scroll Wheel with Custom Behavior" but I can't get it to compile. It gives me the following error:

gui/include/gui/containers/NumberList.hpp:16:21: error: 'textBuffer' was not declared in this scope
           Unicode::itoa(no, textBuffer, TEXT_SIZE, 10);

But I dont understand how I am supposed to declare a textBuffer and have it linked to my WildCard text that I created in my customcontainer. Any help is appreciated. I'm using STM32H747I-DISCO v(1.0.0).

3 REPLIES 3
Alexandre RENOUX
Principal

Hello,

I think for your idea, you should probably better look towards a ListLayout inside a Scrollable Container.

Please have a look at the ListLayout Example available in the Designer. I think this will help you.

/Alexandre

Hi Alexandre, thanks for the response. Isn't the whole point of the scroll wheel supposed to make it easy for pick lists? I mean it does make it easy, I just want to be able to edit the wildcard text for each item. Using a ListLayout inside a Scrollable Container doesnt really work because the whole point of a pick list is you can only pick 1 item from the list. With your example, I can slide it in between two values (then how am I supposed to know which one was chosen). Also, where is the example you are talking about? Are you talking about the Demo it comes with?

Hello,

I think I understand better now.

You can use the Scroll Wheel for your pick list then. To change the content of the wildcard for each item, please refer to the "Scroll List and Wheel Example" available on TouchGFX Designer.

When you open TouchGFX Designer, you have to select an Application Template on the left and a UI Template on the right. When you choose a UI Template, you have different Examples. I'm talking about those examples.

/Alexandre