76 views
in GUI Development by

Hi,

i have experienced strange behaviour with a touchhandler getting focus out of a modal view

im currently using embedded wizzard 9.00

In a menu, there are two buttons (open and close) that have set the RetargetCondition to "Core::RetargetReason[]", so an empty value. Reason for this configuration: These Buttons are there to control a motor that moves the device where the touchscreen is attached. Since the Button is so small, it is easy to move the finger out of the perimeters of the Button and thus stop the motion. Making the button bigger isn't discussable from design perspectives. When ignoring the "OnLeave" singal, the drive does not stop to run, but when swiping around and hitting the area of another touch-handler, the functionality of this handler gets additionally fired. So I disabled the Retarget-functionality, sothat swiping away from the button does not trigger any other touchhandler. When lifting the finger anywhere on the display, the touchhandler gets notified and stops the drive correctly. 

My Problem: A modal view is opened on top of the menu-view. When swiping the knob of a horizontal slider, the drive-button grabs the touch-action away from the touchhandler in the modal view and fires its signals when the finger is in the buttons area. thus the drive starts to move... simply tapping the area without sliding into the area does not fire anything...

I thought, that when making a view modal, all the other views are not able to catch any touch-event.

the menu-view is NOT modal. when touching an item out of the menubar, a "panel" is opened modal with the configuration-details of the item.

the menu view:

the modal "panel":

now, when sliding the right horizontal slider to increase brightness, once coming in the vicinity of the underlying "close"-button, the button gets fired. Sliding with the finger away from the position doesn't change the behaviour.

The action, opening the panel looks like so:


// create a new instance of the view/core::group
var Slider::PanelColorSlider panel = new Slider::PanelColorSlider;

// do some configuration
panel.property = value;

// get root obj
var Core::Root root = GetRoot();

// add the view to the application
root.Add(panel, 0);

// make it modal
root.BeginModal(panel);

How can i prevent the drive-buttons to fire? I think it has to do with the retarget settings of the other touch-handlers. But all in all, i think this is unexpected behaviour...

For a better understanding, another image with the movement of the finger depicted:

greetings Daniel

1 Answer

0 votes
by
 
Best answer

Hello Daniel,

thank you very much for the detailed problem description. I have understood that in your application there is modal panel overlapping some menu in the background and even if the panel is modal, the buttons in the underlying menu do react to touch events. If this is the case, the issue has been already detected and fixed in version 10.00:

You have the possibility to update your version to 10.00 or 11.00. Alternative you can patch the file Core.ewu from the directory Mosaic just below the installation folder. Following is the modification we made to fix the issue:

Does it help you further?

Best regards

Paul Banach

by

Hello Paul,

thank you for your quick reply.

I added the few lines to the embedded wizzard installation. now the console is full of the following errors when sliding the slider:

Obviously, other things have changed before ths patch, that the patch relies on.

I do not want to backport further fixes, since this seems tedious.

How can I upgrade to v10 or v11?

greetings Daniel

by

Hello Daniel,

it was probably my mistake. The code snippet is using language features not available in version 9.0. Try following code:

// If modal group exists, restrict the operation to this group only.
if (( aNewTarget == null ) && ( modalGroups != null ))
  aNewTarget = modalGroups.group;

I hope it solves the issue now.

Best regards

Paul Banach

by
Hello Paul,

sorry for replying so late. The second code snipped worked. Thank you!

greetings Daniel

Embedded Wizard Website | Privacy Policy | Imprint

...