Disabling GUI when LCD back light is OFF

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

  • Disabling GUI when LCD back light is OFF

    I am trying to disable the buttons and widgets on my GUI while the LCD backlight is OFF. I tried using the WM_Deactivate() function but after it executes the buttons are still press-able. Am I correct in thinking that that the WM_Deactivate is the correct command to use?

    Thanks,
    Tim
  • I'm not sure what is the exact goal of WM_Deactivate(), but I think it's better to call WM_DisableWindow() in order to disable input device messages.

    However, WM_DisableWindow() changes the graphical appeareance of the widgets and, in your case with backlight off, this isn't important.

    Maybe a better solution could be to disable the device input driver at all when you switch off backlight. You haven't specified if your input device is a mouse or a touch panel. In my application, I use a touch panel managed by a touch panel controller TS2046. I call GUI_TOUCH_StoreState() to update the actual touch panel state in the emWin library. When the backlight is off, it is sufficient to avoid calling GUI_TOUCH_StoreState() until the backlight is on again.
  • Hello Tim,

    The function WM_Deactivate() prevents the Window Manager from executing paint events and therefor avoids the usage of its clipping mechanism.

    In order to avoid touch messages I would recommend you to stick to giusloq's recommendation. Just avoid storing further touch states in the emWin PID buffer.

    Best regards,
    Adrian