focus in widow

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

  • focus in widow

    Hello. I have a question. It may be a stupid question, but please answer. please.

    I made a child window like the code below.


    WM_HWIN CreateWindow(void) {
    WM_SetCreateFlags(WM_CF_MEMDEV);

    WM_MOTION_Enable(1);
    hgpWin = WM_CreateWindowAsChild(57 + 100, 80 + 50, 800, 350, WM_HBKWIN, WM_CF_SHOW, 0, 0);
    WM_CreateWindowAsChild(0, 0, xsize, 350, hgpWin, WM_CF_SHOW | WM_CF_MOTION_X, _cbgraph1Dialog, 0);


    return hWin;
    }
    As you can see, you can scroll with the touch.
    Can I automatically scroll to the desired position with the button without using scrolling? In the same words, I want to focus on where I want to be. There is no widget there. Only shapes.
    I wonder if I can focus on another window in the same window. What function should I use? Please let me know.

    I can not see the user manual. I would appreciate your reply.

    Thank you in advance.
  • Hi,

    Not sure what are your exact goals here but you can set a window position to a position with WM_MoveTo().
    You can also use the WM_MOTION API to move window smoothly to a position.

    Another way might be to use the animation module.

    In the example attached you see how to use WM_MoveTo().

    Regards,
    Sven
    Files
    • MoveWin.zip

      (984 Byte, downloaded 282 times, last: )
    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.
  • Hmm .. I think the answer is right, but it's hard to apply.
    I have three windows. Their sizes are 1200 * 600, 1000 * 520 and 1000 * 800. Speak easily with A, B, and C. A is the parent window of B. B is the parent window of C. I can scroll C in B along the y axis. I can scroll the position of C as you say. I succeeded in using WM_MOVETO to make the y coordinate of C negative and scroll down. However, if I use WM_MOVETO here, C will go out of B and show up in A. What should I do? Please.

    I'm really sorry. I did not pass the question well.

    But thanks for the answer. I think about how to apply it.