328 views
in GUI Development by
Hello,

at the moment I try to create a scrollable menu. So I used a vertical list for that and 2 touch handler.

The first is a SimpleTouchHandler, which helps me to recognize which menu item is slected. On release a slot method opens a new window.

The second is a SlideTouchHandler, which makes the menu scrollable. In the first Handler I set the RetargedCondition to whipe up & down.

I thought, if the SimpleTouchHandler recognized a whipe, the event will be continued by the SlideTouchHandler without starting the slot method to open a new window. But everey time it starts the onRelease event first and switches than to the slide handler. Is there a easy way to solve this problem. That it only starts the onRelease event if a have a simpleTouch and the slide Handler if I whipe through the menu?

Greetings

Alex

1 Answer

0 votes
by
 
Best answer

Hi Alex,

the behavior is correct. Just in the moment when the first handler recognizes the gesture, the user interaction is handed over to the another touch handler willing to continue with it. From the first handler's point of view, the actual interaction is finished - thus this handler's OnRelease slot method is signaled. Since the second handler has taken over the interaction this handler's OnPress slot method is signaled. 

Generally, the underlying framework guarantees for every OnPress signal that there is a corresponding OnRelease signal. This is very useful. For example, activating the first handler could result in the affected menu item being highlighted. When the user performs the up/down wipe gesture the interaction is handed over to another handler - the menu item should be de-highlighted now. The first handler expects thus a notification (OnRelease) in order to correctly de-highlight the menu item.

What you have to do is to evaluate in your OnRelease slot method the variable AutoDeflected of the first handler. If the variable is true, the signal has been generated because of the interaction being handed over to another handler. If the variable is false, the user has finished the interaction. Accordingly in the first case (true) you exit the slot method. In the second case (false) you perform the slot method as usual.

Please see also: Combine several Touch Handlers together.

Best regards

Paul Banach

by
Hi Paul,

thank you for your quick reply. To check the variable AutoDeflected in my OnRelease SlotMethod solved my problem.

Thank you very much.

Best regards

Alex

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...