WM_GF_PAN handling.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • WM_GF_PAN handling.

    Hello!

    Quick question hopefully! I've implemented basic swipe behaviour in that I can react to WM_GF_PAN messages on a window, when the gesture ends I can display a new window. This is great. However I'm wondering how to handle the case were they are lots of widgets present on the foreground of a window, in my example I have a window with lots of EDIT widgets - of course now my window no longer receives the gesture notifications.

    Is there a well known strategy to handle this? I'm thinking of just having ALL widgets handle WM_GF_PAN and WM_GF_END so that the new window can be swiped to (I'm swiping left and right here), this however seems like a lot of work and may be error prone. Maybe I'm missing something?

    Any ideas or pointers would be greatly appreciated.

    Thanks,
    Peter.
  • Hi,

    I gave it a try and created a simple application where the user can switch between two dialog using gestures.

    On my end it doesn't matter if the gesture occurs on the parent (the main window of the dialog) or on its child window (here the edit widgets).

    Please give it a try and check if it does work on your end.

    Regards,
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks Sven,

    I actually had my WM_GF_PAN handling code in the callback for the first window in the dialog. I've tried to adopt your example code into mine and I'm not seeing it work here unfortuntely, my dialog callback is not getting the WM_GF_PAN notification. One thing to note is I've got a custom edit callback which is reacting to WM_TOUCH (handling touch release), I don't think this should be interfering with the PAN handling but maybe it is. I'll do some more experiementations and will report back.

    Peter.
  • Hi,

    Please note that for gestures it is mandatory to have multitouch properly working.

    But you can also use the motion module of emWin it offers a simple interface for creating a swipeable interface.

    Attached are two examples which show how it could be done.

    One moves only the content of a window (drawing all shapes but with an offset) and the other one moves the window itself (I guess this is more related to your case).

    Regards,
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Sven,

    I managed to resolve this, basically I think the issue boiled down to calling WM_SetCreateFlags(WM_CF_GESTURE); When I set this flag only on the windows which I want to swipe then it worked before.

    Thanks for your help.

    Peter.