cancel
Showing results for 
Search instead for 
Did you mean: 

Widgets take events not for them

FTkal.1
Associate II

I'm having problems with widgets taking events that weren't supposed to go to them.

For example, if I have a SwipeContainer with a Button. If I tap the button, I get a ClickEvent - that's good. But, if swipe, and just happen to start on the button, the button receives the ClickEvent, and the SwipeContainer doesn't receive a swipe event, even though I swiped, and didn't click.

Is there anyway around this? The call stack seems to originate events in Gestures.cpp, but this file doesn't appear to be provided, so it is hard to see what is happening. Is Gestures.cpp available?

Thanks,

Frank

4 REPLIES 4
Martin KJELDSEN
Chief III

This is expected behavior, because everything starts with a click/press. What you need to do in this case is to "steal" the handleClick/Drag events and figure out if you're dragging, then forward the event to the swipe container, otherwise the click goes to the button. You may want to ask yourself if you really want a button in a swipe container; If that's the right design.

Let me know.

/Martin

Martin KJELDSEN
Chief III

I just remember that i made a small sample projec that has the exact behavior i just described (a while back) -. I'll see if i can find it.

FTkal.1
Associate II

I'll give that a go. I can see similar behaviour in the scrollable container.

Hi,Martin

Im still studying English,please dont mind my mistake of expression..

I want to make a user class inherited from class Container , to get all touch event and then send it to include widget.

But I found that, I can not get touch event if there is a button on the container.

I had see scrollable container,but still don't understand why it can get touch event.

Different between my Container and scrollable container is the scrollbars. Is that add box in container can make container catch the touch event?

Best regards