Ignore:
Timestamp:
Oct 8, 1999, 6:13:09 PM (26 years ago)
Author:
cbratschi
Message:

subclassed frame, WM_STYLECHANGING fix

File:
1 edited

Legend:

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

    r1186 r1189  
    1 /* $Id: win32wbase.cpp,v 1.29 1999-10-08 14:57:18 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.30 1999-10-08 16:13:08 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    3838#include "heapshared.h"
    3939#include "dc.h"
     40#include "pmframe.h"
    4041
    4142#define HAS_DLGFRAME(style,exStyle) \
     
    109110  windowId         = 0xFFFFFFFF;        //default = -1
    110111  userData         = 0;
     112
     113  pOldFrameProc = NULL;
     114  borderWidth   = 0;
     115  borderHeight  = 0;
    111116
    112117  hwndLinkAfter    = HWND_BOTTOM;
     
    424429  DWORD dwOSWinStyle, dwOSFrameStyle;
    425430
    426   OSLibWinConvertStyle(cs->style, cs->dwExStyle, &dwOSWinStyle, &dwOSFrameStyle);
     431  OSLibWinConvertStyle(cs->style, cs->dwExStyle, &dwOSWinStyle, &dwOSFrameStyle, &borderWidth, &borderHeight);
    427432
    428433//CB: dwOSFrameStyle handled by OSLibWinConvertStyle
    429 //    todo: subclass frame WM_PAINT -> call DrawEdge() if HAS_3DFRAME (code below)
    430 //          OSLibWinCreateWindow: perhaps problems
     434//    OSLibWinCreateWindow: perhaps problems
    431435//    shouldn't we always use a frame? -> no problems with scrollbars
    432436
     
    527531  }
    528532  //Subclass frame
    529   if (dwStyle & WS_CHILD && HAS_3DFRAME(dwExStyle))
     533
     534  if (isFrameWindow())
    530535  {
    531     //CB: use a win32 window procedure and call DrawEdge() or
    532     //    emulate DrawEdge() in a OS/2 procedure
     536    pOldFrameProc = FrameSubclassFrameWindow(this);
     537    if (dwStyle & WS_CHILD && HAS_3DFRAME(dwExStyle)) FrameSetBorderSize(this);
    533538  }
    534539
     
    23972402                ss.styleNew = value;
    23982403                SendMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss);
    2399                 oldval = dwExStyle;
    2400                 setExStyle(value);
     2404                setExStyle(ss.styleNew);
    24012405                SendMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);
    2402                 return oldval;
     2406                return ss.styleOld;
    24032407        }
    24042408        case GWL_STYLE:
     
    24092413                ss.styleNew = value;
    24102414                SendMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);
    2411                 oldval = dwStyle;
    2412                 setStyle(value);
     2415                setStyle(ss.styleNew);
    24132416                OSLibSetWindowStyle(OS2HwndFrame, dwStyle);
    24142417                SendMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
    2415                 return oldval;
     2418                return ss.styleOld;
    24162419        }
    24172420        case GWL_WNDPROC:
     
    25362539//******************************************************************************
    25372540//******************************************************************************
     2541Win32BaseWindow *Win32BaseWindow::GetWindowFromFrameHandle(HWND hwnd)
     2542{
     2543 Win32BaseWindow *win32wnd;
     2544 DWORD        magic;
     2545
     2546  return GetWindowFromOS2Handle(OSLibWinWindowFromID(hwnd,OSLIB_FID_CLIENT));
     2547
     2548  //CB: doesn't work with frame window words
     2549/*
     2550  win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32WNDPTR);
     2551  magic    = OSLibWinGetWindowULong(hwnd, OFFSET_WIN32PM_MAGIC);
     2552
     2553  if(win32wnd && CheckMagicDword(magic)) {
     2554        return win32wnd;
     2555  }
     2556  return 0;
     2557*/
     2558}
     2559//******************************************************************************
     2560//******************************************************************************
    25382561HWND Win32BaseWindow::Win32ToOS2Handle(HWND hwnd)
    25392562{
Note: See TracChangeset for help on using the changeset viewer.