2019-03-12 05:11 AM
Hello,
I am using slideMenu widget and it works fine. Now I am trying to open this widget by a gesture. Normally I would override gestureEventCallback in my View- and actually I did it but it does not work well. I have two slide menus on top and on the left and if I slide from the left to right at 30o angle I get 2 gestures- HORIZONTAL and VERTICAL, always in the same order therefore it is impossible for me to detect if I should open top or left menu.
I came to idea that I can first check the click event for pressed, save the coordinates, wait for gesture event and then wait for released click event- in that combination I am able to get all data to find out if I should open top or left menu. But If I override click event in my view I can not trigger buttons which are present in the view.
So my question is- is it possible to, after I trigger view's clickEventHandler pass the event further to trigger next widget in the area where the click occured? Is TouchGFX capable of doing that?
Solved! Go to Solution.
2019-03-13 12:57 AM
You can also just forward it application-wide by calling Application::handleClickEvent(evt);
/Martin
2019-03-12 07:01 AM
Hi @maciek,
Simply forward the event to any widget using widget.handleClickEvent(evt); //evt gotten from your views handleClickEvent();
/Martin
2019-03-12 09:02 AM
Yea but let's assume I don't know what widgets are on the position where the event occured. Solution with calling handleClickEvent assumes I know what widget I should trigger. I would like to pass it further without concerning about x/y.
I did it manually- I know that there can be only 1 container that's children can be triggered:
Drawable* widget = containerMain.getFirstChild();
while (widget != 0)
{
Rect rect;
rect = widget->getAbsoluteRect();
if (evt.getX() > rect.x && evt.getX() < rect.x + rect.width
&& evt.getY() > rect.y && evt.getY() < rect.y+ rect.height
&& widget->isTouchable())
{
widget->handleClickEvent(evt);
}
widget = widget->getNextSibling();
}
2019-03-13 12:57 AM
You can also just forward it application-wide by calling Application::handleClickEvent(evt);
/Martin
2021-03-02 08:13 PM
Im not sure if the source code has just changed since this post was initially made, but the only way I could call the handleClickEvent(evt) on the application was like this:
Application::getInstance()->handleClickEvent(evt);
2021-03-16 07:58 PM
Hi @JHarding ,
I wonder how to define evt in my class.