2019-08-05 02:10 AM
Hello,
Do you know if there is a simple way to make touchGFX draw a circle during a few ms on each touch screen press ?
best regards
2019-08-06 02:23 AM
My reply was on how to avoid having circles in the view itself, but inside a custom widget (since you're showing the circle at the exact spot you're clicking which is the widget that is already handling click events. But if you want to do the view approach - You do not need handleClickEvent() at all actually - You just need the callback handler to show one of the circles at the coordinates that were clicked - you can send these back in your callback.
/Martin
2019-08-06 02:29 AM
Thank for your reply
what do you meen by "You just need the callback handler to show one of the circles at the coordinates that were clicked - you can send these back in your callback"
I want to show a circle where there is a press (it can be on a clickable box or image or on nothing...) I have only one circle that set invisible in tick handler after having been seted in click handler.
So i think i need the handleClickEvent() function ?
2019-08-06 06:04 AM
Hello
can you confirm that the add function for the circle must be done only once in the base class and not in the setupView function (otherwise if the view is called several time the circle doesn't appear any more)
Best regards
2019-08-08 06:55 AM
Hi,
If you want to handle showing your circles from your view, and not from the widets, yes you need to define a handleClickEvent() method in your view. If you're displaying a circle and someone requests for that view to be displayed again (you can always guard this - dont switch to a view that's already active) yes, the circle may go a way prematurely - But this is an extreme edge case. If you want this functionality on several views you have to define it in a base class.
/Martin
2019-08-08 11:31 PM
Hello
thank you for your support
It seems to work now, with declaration of circle in the base View class, and handle click callback in the view call that then dispatches the event to all widgets by View::handleClickEvent(evt)
And i will do so for all the view...
Best regards
2019-08-09 12:48 AM
That's great! :)
/Martin