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
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