2020-05-14 01:19 PM
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.
Solved! Go to Solution.
2020-05-15 04:02 AM
@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:
And an example usage would be:
Hope this helps.
2020-05-14 02:31 PM
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.
2020-05-15 02:05 AM
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
2020-05-15 04:02 AM
@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:
And an example usage would be:
Hope this helps.
2020-05-18 07:33 AM
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.