Bottom portion of one text line filled up with Background color. 800 x 480 LCD

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

  • Bottom portion of one text line filled up with Background color. 800 x 480 LCD

    Hello,

    I am working on a simple application having a Single Window with
    LCD size of 800 x 480 on a LPC1788 board.

    The application requires updating of window contents (only text with various Fonts and Sizes)
    based on an external event.

    During start-up I create the Main Application window with MainWndProc() as it's CallBack.

    In processing of External Event, I fire a Invalidate window message thro'
    a call to WM_InvalidateWindow(hMainWndProc).

    I am ending up with bottom portion of one text line filled up with Background color.

    I investigated it by tracking WM_PAINT messages that my MainWndProc() was receiving.

    I found that I was in fact receiving 2 WM_PAINT messages, 1st with (0, 0, 799, 294) as
    Invalid Rectangle and the 2nd with (0, 295, 799, 479) as Invalid rectangle. i.e. WM was
    painting the whole window with the help of 2 WM_PAINT messages.

    Since the program Paints ONLY in the Invalid rectangle, I reasoned that the call to
    GUI_Clear() in 2nd WM_PAINT message processing is giving me this effect since the text line
    in question crosses onto lower ( y > 294) rectangle.

    case WM_PAINT:
    GUI_ClearRect(Invalid Rectangle);
    .
    .
    (Update the Window text)
    .
    .
    break;

    My question is,

    1. Is this a normal behavior, i.e. one may receive Multiple WM_PAINT messages for WM_InvalidateWindow() call.

    2. Is there a way so that I get only 1 WM_PAINT message for updating of whole window.

    3. Will use of other Invalidate function be a right proposition.

    Thanks

    Vijay Vaidya
  • Hi,

    The chapter 'The Window Manager (WM)/Callback mechanism, invalidation, rendering and keyboard input/Tiling mechanism' explains the reason for multiple WM_PAINT messages. The description of the function WM_CreateWindow() explains how to achieve only a single WM_PAINT message in the 'Style' table under WM_CF_LATE_CLIP.

    Regards, Jörg
    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.