cancel
Showing results for 
Search instead for 
Did you mean: 

How to add click/drag/gesture event in custom container?

V.H
Senior

Hello all,

I create a custom container and need to used click/drag/gesture event,

but the handleClickEvent/handleDragEvent/handleGestureEvent cannot trigger in it.

How can get these event in custom container?

6 REPLIES 6
ktrofimo
Senior III

I tried to drag custom widget just by adding ​<Draggable> to it. And it works. I feel it should work for containers too. See https://support.touchgfx.com/4.20/docs/development/ui-development/touchgfx-engine-features/mixins#draggable

I want to used gesture to control a value, and your share is to drag the specified object.

Osman SOYKURT
ST Employee

Hi V.H,

Do you mean you want to handle click/drags with your entire container (and not just elements inside it ?)

If yes, you just need to click on your container inside your screen and check the boxes "Draggable", "ClickListener", and "Move Animator" under Mixins in the right panel (Properties).

0693W00000StjcMQAR.png 

Then you implements the functions you need when triggered. You can be helped by our article here.

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

I was thinking the same and even sent a link to the same article, but this is not what author wants. Our idea is to drag the whole object on the screen while he needs gestures to change value inside control, but not the position of this control. Like a spin buttons besides numeric field in MFC. When you click this button and move mouse up or down this changes value in a numeric field.

0693W00000StndxQAB.png 

Create a modal window and add a circle progress in it;

1, The widget can be drag when active "Draggable".

2, Generate callback function when click on the widget when active "ClickListener".

But it doesn't meet my needs. I want to used click event to active and up-down gesture event to change value for the circle progress. (The gesture range is greater than the widget range.)

So, I want to used handleClickEvent/handleDragEvent/handleGestureEvent to do it.

Hello @V.H​ , I'm trying to do the same thing on a container but handleDragEvent trigger on all the screen.

Did you succeed for that ?