CtrlCore: WM_PAINT now deos BeginPaint even if !IsVisible

git-svn-id: svn://ultimatepp.org/upp/trunk@2849 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-11-17 18:37:46 +00:00
parent 5dcdb036b0
commit 92578926b0
3 changed files with 1478 additions and 1475 deletions

View file

@ -619,9 +619,13 @@ void Ctrl::DrawCtrl(Draw& w, int x, int y)
{
GuiLock __;
w.Offset(x, y);
SystemDraw *ws = dynamic_cast<SystemDraw *>(&w);
if(ws)
UpdateArea(*ws, GetRect().GetSize());
// CtrlPaint(w, GetSize()); _DBG_
w.End();
}

View file

@ -102,31 +102,30 @@ LRESULT Ctrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
#endif
case WM_PAINT:
ASSERT(hwnd);
if(IsVisible() && hwnd) {
if(hwnd) {
PAINTSTRUCT ps;
SyncScroll();
if(IsVisible())
SyncScroll();
HDC dc = BeginPaint(hwnd, &ps);
fullrefresh = false;
SystemDraw draw(dc);
#ifndef PLATFORM_WINCE
HPALETTE hOldPal;
if(draw.PaletteMode() && SystemDraw::AutoPalette()) {
hOldPal = SelectPalette(dc, GetQlibPalette(), TRUE);
int n = RealizePalette(dc);
LLOG("In paint realized " << n << " colors");
if(IsVisible()) {
SystemDraw draw(dc);
#ifndef PLATFORM_WINCE
HPALETTE hOldPal;
if(draw.PaletteMode() && SystemDraw::AutoPalette()) {
hOldPal = SelectPalette(dc, GetQlibPalette(), TRUE);
int n = RealizePalette(dc);
LLOG("In paint realized " << n << " colors");
}
#endif
painting = true;
UpdateArea(draw, Rect(ps.rcPaint));
painting = false;
#ifndef PLATFORM_WINCE
if(draw.PaletteMode() && SystemDraw::AutoPalette())
SelectPalette(dc, hOldPal, TRUE);
#endif
}
#endif
#ifdef _DEBUG
painting = true;
#endif
UpdateArea(draw, Rect(ps.rcPaint));
#ifdef _DEBUG
painting = false;
#endif
#ifndef PLATFORM_WINCE
if(draw.PaletteMode() && SystemDraw::AutoPalette())
SelectPalette(dc, hOldPal, TRUE);
#endif
EndPaint(hwnd, &ps);
}
return 0L;

File diff suppressed because it is too large Load diff