Windows manager problem

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

  • Windows manager problem

    Hi,
    I have some problem with Windows Manager:
    in my callback "case WM_SET_FOCUS:" is never called.
    Same story with "case WM_NOTIFY_VIS_CHANGED:" (even when WM_SUPPORT_NOTIFY_VIS_CHANGED is set to 1)
    I create stack of windows, each on top of another (siblings, all children of WM_HBKWIN) and want to track events when window appear and disappear on LCD

    I use following code in callback:
    case WM_SET_FOCUS: counter++; break;
    case WM_PAINT: GUI_Clear(); GUI_DispDecAt(....); break;

    value of counter displayed, but never changed when I jump between windows. Same is with WM_NOTIFY_VIS_CHANGED.
    Where to dig deeper? (I use STemWin package for STM32F40x)
    Thanks

    The post was edited 1 time, last by Serge ().

  • Hello,

    Windows do not receive the focus per default. This has to be implemented in a custom callback function as shown below:

    C Source Code

    1. #include "GUI.h"
    2. #include "WM.h"
    3. /*********************************************************************
    4. *
    5. * Static code
    6. *
    7. **********************************************************************
    8. */
    9. /*********************************************************************
    10. *
    11. * _cbWin
    12. */
    13. static void _cbWin(WM_MESSAGE * pMsg) {
    14. const WM_PID_STATE_CHANGED_INFO * pInfo;
    15. switch (pMsg->MsgId) {
    16. case WM_PAINT:
    17. GUI_SetBkColor(GUI_GRAY);
    18. GUI_Clear();
    19. break;
    20. case WM_PID_STATE_CHANGED:
    21. pInfo = (const WM_PID_STATE_CHANGED_INFO *)pMsg->Data.p;
    22. if (pInfo->State) {
    23. WM_SetFocus(pMsg->hWin);
    24. }
    25. break;
    26. case WM_GET_ACCEPT_FOCUS:
    27. pMsg->Data.v = 1;
    28. break;
    29. default:
    30. WM_DefaultProc(pMsg);
    31. }
    32. }
    33. /*********************************************************************
    34. *
    35. * Public code
    36. *
    37. **********************************************************************
    38. */
    39. /*********************************************************************
    40. *
    41. * MainTask
    42. */
    43. void MainTask(void) {
    44. GUI_Init();
    45. WM_CreateWindow(10, 10, 50, 50, WM_CF_SHOW, _cbWin, 0);
    46. while(1) {
    47. GUI_Delay(100);
    48. }
    49. }
    50. /*************************** End of file ****************************/
    Display All

    Best regards,
    Adrian