990 views
in GUI Development by
I have to activate/deactivate some of my touch handlers.

Deactivation does only work, if I set the property OnXYZ to null. Setting the property Enabled to false is not sufficient.

1 Answer

0 votes
by

Hello,

setting the propertty Enabled to false is sufficient. We use this approach very often and it works as expected. 

However, if the affected touch handler is actually involved in a user interaction (the user is touching the handler's area), the handler will continue receiving the events until the user finalizes the interaction - even if you disable the handler after the user has touched it. Please see the explanation in the section Disable a Simple Touch Handler.

If this is the problem in your application, I would suggest to add following code at the begin of the affected OnXYZ slot methods:

if ( !Touch_Handler.Enabled )
  return;

Best regards

Paul Banach

by
Hello,

now I have a similiar probelm when activating an SimpleTouchHandler. There are 4 Touch Handler on the same page, which are treated identical. 3 of these 4 handlers work as expected. The fourth handler works only, if I close the page and open it again.

The effect can only be seen on the real hardware, in the prototyper is is not.

I added the Enabled=true and the Setting of the OnSet handler at several places, but never the touch works on the first opening of the page.
by
Ok, this was my error:

I have several pages, which I used to show making them visible, setting the attribute Visible true/false.

Obviously this is not sufficient. It seems, that there are some invisible objects in the forground, which block the touch handler of a visible made page. Though, it's not really clear, why this behaviour is different, when I make the page visible for the second time.

If I call RestackTop() after making the page visible, all touch handlers work as expected, also for the first call of the page.
by

Hello,

maybe this section Simple Touch Handler and invisible components answers your question.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...