2019-10-04 04:32 AM
Hello,
Why can't CustomContainers be created as 'ClickListener' objects?
It's quite annoying as I'd like to create a ListLayout with clickable elements mainly through the studio and it seems the only way I can do it is through code as CustomContainers can't be made clickable…
Is it an oversight when you designed the functionality or was it made on purpose? If the latter, why so?
How can I circumvent this limitation to avoid having to do everything through lines of code?
Thanks in advance.
2019-10-04 07:12 AM
Hi,
If you'll notice what happens when you add the clicklistener property from the designer:
/*
* Member Declarations
*/
touchgfx::ClickListener< touchgfx::Box > box1;
You can add the ClickListener "Mix-in" to any class that (Like a Drawable) implements at least
void setTouchable(bool);
virtual void handleClickEvent(const ClickEvent& event)
/Martin
2019-10-06 11:21 PM
Hej,
I'm afraid I didn't make myself clear. I was asking specifically about making the Customcontainers clickable through the studio. But I realised I've to add for a scrollList. Indeed, if a CustomContainer is just dragged and dropped on a view, it can be made clickable through the studio. However, if I create statically a ScrollList and want to add the CustomContainer as a clickable object, there is no way to do that through the designer, what would force me to do it programatically. I found it more convenient to do it directly from the studio and thought it would be an interesting feature to add ;)
2019-10-07 04:15 AM
Hi,
Indeed it would be more comfortable. The upcoming release 4.12.3 (Released with CubeMX 5.4) will see some improvements in creating custom actions and triggers :)
/Martin