cancel
Showing results for 
Search instead for 
Did you mean: 

How do I determine which container is being pressed

lxw
Senior

To implement something like iconview in emwin,I created a​ Custom container,consist of a image and textarea. name as a icon.Then,create 2 screen .The screen1 use SwipeContainer ,whitch add 12 icon.

Q1:How do I determine which icon is pressed?

Q2:How do I switch to screen2 by clicking the icon?

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Are you looking to make it touchable? You can add a simple ClickListener to any widget. Or, you can override handleClickEvent() in your View and simply check of the touch-coordinates are within the boundaries of a widget.

Check out the "Transition" example through the designer to see how to change between screens.

Hope that helps!

/Martin

View solution in original post

4 REPLIES 4
Martin KJELDSEN
Chief III

Are you looking to make it touchable? You can add a simple ClickListener to any widget. Or, you can override handleClickEvent() in your View and simply check of the touch-coordinates are within the boundaries of a widget.

Check out the "Transition" example through the designer to see how to change between screens.

Hope that helps!

/Martin

lxw
Senior

thank you!

Q1: Yes,I know how to add a simple ClickListener to a widget in screen.But now,the widget is in a​ Custom container.Customcontainer is in SwipeContainer .SwipeContainer is in a screen.So,I dont know how to do this.

check of the touch-coordinates ,this is a bad complexity way.

Q2:In "Transition",the botton can be choose to clicked source.But in my application,the clicked source is a image that in Customcontainer that in SwipeContainer.But it can not be choose.

😅

Martin KJELDSEN
Chief III

Q1: Search this subforum for examples of this - I created a working example of clicklisteners from custom containers for someone else, now that you mention it.

Q2: I just talked to the designer team and in the future, all click listeners will also be selectable as source for an interaction.

Q1:success�?�?�?Thank you very much�?:kissing_face_with_closed_eyes: :kissing_face_with_closed_eyes: :kissing_face_with_closed_eyes:

Q2:How do I now manually switch screen in the container's callback function in 4.10.0?

Q3:If I create screenA in 1.Tougfx and screenB in 2.Tougfx.

How to copy screenA and screenB from 1. Tougfx and 2. Tougfx and paste them directly into 3. Tougfx.

Instead of completely redesigning it manually​。