cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to pass more than one value through an action to a custom container?

scottSD
Senior III

I must say that the recently updated TouchGFX documentation is excellent. Great job!

I apologize if I am missing the obvious, but is there a way to pass more than one value by way of an "action" to a Custom Container?

I am referencing the following tutorial:

https://support.touchgfx.com/docs/tutorials/tutorial-05/

I am working on a Custom Container with a Scrollwheel in it and I would like to add a custom action to be able to change the text of a specified element (a second parameter) programmatically. I tried the "custom" and when trying to add the action, I was not able to get it to accept a multiple parameter virtual function or when selecting "Execute C++ code".

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Martin Stig STISSING
ST Employee

@scottSD​ Your input is really appreciated. We would like to make this more obvious.

What you can do for now:

Instead of having an action/method with two parameters, you could create an action/method that expects one struct parameter.

In Designer an example definition would be:

0693W000001cKfEQAU.png

And an example usage would be:

0693W000001cKfYQAU.png

Hope this helps.

View solution in original post

4 REPLIES 4
scottSD
Senior III

I found out that when adding the "type", you can enter what types you want, separated by a comma. I had previously attempted to copy/paste a type with a variable from some code I was using:

Unicode::UnicodeChar* uCharText, uint8_t index

All that is necessary are the types:

Unicode::UnicodeChar* , uint8_t

Which creates a virtual function prototype in the base of the Custom Container:

virtual void SetElementText(Unicode::UnicodeChar* , uint8_t value);

And things work fine when calling this function.

Like I said, I was probably missing the obvious....

Anyway, my initial compliment of the new documentation stands. It is done very well.

Martin KJELDSEN
Chief III

Thanks, Scott! We put a lot of effort into it - Feel free to give us some input if you feel something is not clear enough =)

Re: your question, good job on finding out on your own. My response would have been that there's no obvious way to do what you wanted =) There'll be better support from the designer on this particular "issue" in the future.

/Martin

Martin Stig STISSING
ST Employee

@scottSD​ Your input is really appreciated. We would like to make this more obvious.

What you can do for now:

Instead of having an action/method with two parameters, you could create an action/method that expects one struct parameter.

In Designer an example definition would be:

0693W000001cKfEQAU.png

And an example usage would be:

0693W000001cKfYQAU.png

Hope this helps.

That is helpful! I will get the hang of it one of these days ;) .

Overall, I think the new documentation is awesome.

I do appreciate that one can use the Designer to create virtual functions that can be used in user code.