Changeset 2663 for trunk/src


Ignore:
Timestamp:
Feb 5, 2000, 5:25:00 PM (26 years ago)
Author:
sandervl
Message:

WM_ERASEBKGND changes

Location:
trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/dc.cpp

    r2582 r2663  
    1 /* $Id: dc.cpp,v 1.41 2000-01-31 22:30:51 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.42 2000-02-05 16:24:57 sandervl Exp $ */
    22
    33/*
     
    2929#include <limits.h>
    3030#include "oslibwin.h"
    31 #include "dcdata.h"
     31#include <dcdata.h>
    3232
    3333#define INCLUDED_BY_DC
     
    7070
    7171HWND WIN32API GetDesktopWindow(void);
     72INT  WIN32API GetUpdateRgn(HWND, HRGN, BOOL);
    7273
    7374//******************************************************************************
     
    463464        }
    464465   }
     466
     467   //SvL: Get update region for WM_ERASEBACKGROUND handling in the def wndproc
     468   GetUpdateRgn(hWnd, wnd->GetUpdateRegion(), FALSE);
    465469
    466470   HWND hwndClient = wnd->getOS2WindowHandle();
     
    884888{
    885889   Win32BaseWindow *wnd;
     890
     891   if(pRect) {
     892          dprintf(("RedrawWindow %x (%d,%d)(%d,%d) %x %x", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom, hrgn, redraw));
     893   }
     894   else   dprintf(("RedrawWindow %x %x %x %x", hwnd, pRect, hrgn, redraw));
    886895
    887896   if (redraw & (RDW_FRAME_W | RDW_NOFRAME_W))
  • trunk/src/user32/win32dlg.cpp

    r2469 r2663  
    1 /* $Id: win32dlg.cpp,v 1.41 2000-01-18 20:10:52 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.42 2000-02-05 16:24:58 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    2323#include "win32wdesktop.h"
    2424#include "controls.h"
     25#include "syscolor.h"
    2526
    2627#define DEFAULT_DLGFONT "9.WarpSans"
     
    696697      RECT rect;
    697698      int rc;
    698         /*  Since WM_ERASEBKGND may receive either a window dc or a    */
    699         /*  client dc, the area to be erased has to be retrieved from  */
    700         /*  the device context.                    */
    701         rc = GetClipBox( (HDC)wParam, &rect );
     699
     700        if (!windowClass || !windowClass->getBackgroundBrush()) return 0;
     701
     702//        rc = GetClipBox( (HDC)wParam, &rect );
     703        rc = GetRgnBox(hUpdateRegion, &rect);
    702704        if ((rc == SIMPLEREGION) || (rc == COMPLEXREGION))
    703             FillRect( (HDC)wParam, &rect, windowClass->getBackgroundBrush());
     705        {
     706            HBRUSH hBrush = windowClass->getBackgroundBrush();
     707
     708            if (hBrush <= (HBRUSH)(SYSCOLOR_GetLastColor()+1))
     709                hBrush = GetSysColorBrush(hBrush-1);
     710
     711//          FillRect( (HDC)wParam, &rect, hBrush);
     712                FillRgn((HDC)wParam, hUpdateRegion, hBrush);
     713        }
     714
    704715        return 1;
    705716    }
     717
    706718    case WM_NCDESTROY:
    707719          /* Free dialog heap (if created) */
  • trunk/src/user32/win32wbase.cpp

    r2657 r2663  
    1 /* $Id: win32wbase.cpp,v 1.152 2000-02-05 14:08:53 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.153 2000-02-05 16:24:59 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    145145  ownDC              = 0;
    146146  hWindowRegion      = 0;
     147  hUpdateRegion      = CreateRectRgn(0, 0, 0, 0);
    147148
    148149  if(currentProcessId == -1)
     
    178179    }
    179180
    180     if (isOwnDC())
    181         releaseOwnDC (ownDC);
     181    if(hUpdateRegion) {
     182        DeleteObject(hUpdateRegion);
     183        hUpdateRegion = 0;
     184    }
     185
     186    if(isOwnDC())
     187        releaseOwnDC(ownDC);
    182188
    183189    if(Win32Hwnd)
     
    186192    if(userWindowLong)
    187193        free(userWindowLong);
     194
    188195    if(windowNameA) {
    189196        free(windowNameA);
     
    14331440        if (!windowClass || !windowClass->getBackgroundBrush()) return 0;
    14341441
    1435         rc = GetClipBox( (HDC)wParam, &rect );
     1442//        rc = GetClipBox( (HDC)wParam, &rect );
     1443        rc = GetRgnBox(hUpdateRegion, &rect);
    14361444        if ((rc == SIMPLEREGION) || (rc == COMPLEXREGION))
    14371445        {
    1438           HBRUSH hBrush = windowClass->getBackgroundBrush();
    1439 
    1440           if (hBrush <= (HBRUSH)(SYSCOLOR_GetLastColor()+1)) hBrush = GetSysColorBrush(hBrush-1);
    1441 
    1442           FillRect( (HDC)wParam, &rect, hBrush);
     1446            HBRUSH hBrush = windowClass->getBackgroundBrush();
     1447
     1448            if (hBrush <= (HBRUSH)(SYSCOLOR_GetLastColor()+1))
     1449                hBrush = GetSysColorBrush(hBrush-1);
     1450
     1451//          FillRect( (HDC)wParam, &rect, hBrush);
     1452                FillRgn((HDC)wParam, hUpdateRegion, hBrush);
    14431453        }
    14441454
     
    27242734                    return value;
    27252735
    2726                         value &= ~(WS_VISIBLE | WS_CHILD);      /* Some bits can't be changed this way (WINE) */
     2736                value &= ~(WS_VISIBLE | WS_CHILD);      /* Some bits can't be changed this way (WINE) */
    27272737                ss.styleOld = getStyle();
    2728                         ss.styleNew = value | (ss.styleOld & (WS_VISIBLE | WS_CHILD));
     2738                ss.styleNew = value | (ss.styleOld & (WS_VISIBLE | WS_CHILD));
    27292739                dprintf(("SetWindowLong GWL_STYLE %x old %x new style %x", getWindowHandle(), ss.styleOld, ss.styleNew));
    27302740                SendInternalMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);
    27312741                setStyle(ss.styleNew);
    27322742                SendInternalMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
    2733                 OSLibSetWindowStyle(getOS2FrameWindowHandle(), getStyle(), getExStyle(),
    2734                                     windowClass->getStyle() & CS_SAVEBITS);
     2743////                OSLibSetWindowStyle(getOS2FrameWindowHandle(), getStyle(), getExStyle(),
     2744////                                    windowClass->getStyle() & CS_SAVEBITS);
    27352745#ifdef DEBUG
    27362746                PrintWindowStyle(ss.styleNew, 0);
  • trunk/src/user32/win32wbase.h

    r2657 r2663  
    1 /* $Id: win32wbase.h,v 1.79 2000-02-05 14:08:54 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.80 2000-02-05 16:25:00 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    198198         void   SetWindowRegion(HRGN hRegion)       { hWindowRegion = hRegion; };
    199199         HRGN   GetWindowRegion()                   { return hWindowRegion; };
     200         HRGN   GetUpdateRegion()                   { return hUpdateRegion; };
    200201
    201202         BOOL   ShowWindow(ULONG nCmdShow);
     
    341342
    342343        HRGN    hWindowRegion;
     344        HRGN    hUpdateRegion;
    343345
    344346        DWORD   dwThreadId;             //id of thread that created this window
Note: See TracChangeset for help on using the changeset viewer.