Ignore:
Timestamp:
Oct 17, 1999, 2:17:46 PM (26 years ago)
Author:
cbratschi
Message:

added WINE scrollbars to frame, fixed pmframe, WM_ENTERIDLE

File:
1 edited

Legend:

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

    r1322 r1333  
    1 /* $Id: win32wbase.cpp,v 1.47 1999-10-16 14:51:42 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.48 1999-10-17 12:17:45 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    4040#include "pmframe.h"
    4141#include "win32wdesktop.h"
     42#include "pmwindow.h"
    4243#include <wprocess.h>
    4344
     
    8586//******************************************************************************
    8687//******************************************************************************
     88Win32BaseWindow::Win32BaseWindow(HWND os2Handle,VOID* win32WndProc) : GenericObject(&windows,OBJTYPE_WINDOW)
     89{
     90  Init();
     91  OS2Hwnd = OS2HwndFrame = os2Handle;
     92  dwStyle = WS_VISIBLE;
     93  setWindowProc((WNDPROC)win32WndProc);
     94  fIsSubclassedOS2Wnd = TRUE;
     95  fFirstShow = FALSE;
     96
     97  //CB: replace by a secure method
     98
     99  if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) {
     100        dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd));
     101        SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error
     102        return;
     103  }
     104  if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) {
     105        dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd));
     106        SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error
     107        return;
     108  }
     109
     110  OSLibWinQueryWindowRect(OS2Hwnd,&rectWindow);
     111  rectClient = rectWindow;
     112  rectClient.bottom -= rectClient.top;
     113  rectClient.top = 0;
     114  rectClient.right -= rectClient.left;
     115  rectClient.left = 0;
     116
     117  setOldWndProc(SubclassWithDefHandler(OS2Hwnd));
     118}
     119//******************************************************************************
     120//******************************************************************************
    87121Win32BaseWindow::Win32BaseWindow(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode)
    88122                        : GenericObject(&windows, OBJTYPE_WINDOW), ChildWindow()
     
    97131{
    98132  isUnicode        = FALSE;
     133  fIsSubclassedOS2Wnd = FALSE;
    99134  fFirstShow       = TRUE;
    100135  fIsDialog        = FALSE;
     
    200235        horzScrollInfo = NULL;
    201236    }
    202   //TODO: Destroy windows if they're not associated with our window anymore (showwindow false)?
    203 //  hwndHorzScroll
    204 //  hwndVertScroll
    205 
    206237}
    207238//******************************************************************************
     
    584615  }
    585616
     617  //CB: switch off -> OS/2 scrollbars
     618  subclassScrollBars(dwStyle & WS_HSCROLL,dwStyle & WS_VSCROLL);
     619
    586620  fakeWinBase.hwndThis     = OS2Hwnd;
    587621  fakeWinBase.pWindowClass = windowClass;
     
    690724 Win32BaseWindow *child;
    691725
     726    if (isSubclassedOS2Wnd) OSLibWinSubclassWindow(OS2Hwnd,pOldWndProc);
     727
    692728    //According to the SDK, WM_PARENTNOTIFY messages are sent to the parent (this window)
    693729    //before any window destruction has begun
     
    699735    }
    700736    SendInternalMessageA(WM_DESTROY, 0, 0);
     737
     738    if (hwndHorzScroll && OSLibWinQueryWindow(hwndHorzScroll,QWOS_PARENT) == OSLIB_HWND_OBJECT) OSLibWinDestroyWindow(hwndHorzScroll);
     739    if (hwndVertScroll && OSLibWinQueryWindow(hwndVertScroll,QWOS_PARENT) == OSLIB_HWND_OBJECT) OSLibWinDestroyWindow(hwndVertScroll);
    701740
    702741    fIsDestroyed = TRUE;
     
    10071046                break;
    10081047        case BUTTON_LEFTDBLCLICK:
    1009                 if (windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)
     1048                if (windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)
    10101049                {
    10111050                  win32msg = WM_LBUTTONDBLCLK;
     
    10261065                break;
    10271066        case BUTTON_RIGHTDBLCLICK:
    1028                 if (windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)
     1067                if (windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)
    10291068                {
    10301069                  win32msg = WM_RBUTTONDBLCLK;
     
    10451084                break;
    10461085        case BUTTON_MIDDLEDBLCLICK:
    1047                 if (windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)
     1086                if (windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)
    10481087                {
    10491088                  win32msg = WM_MBUTTONDBLCLK;
     
    11861225    case SB_HORZ:
    11871226        if(horzScrollInfo) {
    1188             horzScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndHorzScroll);
     1227            //CB:horzScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndHorzScroll);
    11891228            return horzScrollInfo;
    11901229        }
     
    11921231    case SB_VERT:
    11931232        if(vertScrollInfo) {
    1194             vertScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndVertScroll);
     1233            //CB:vertScrollInfo->CurVal = OSLibWinGetScrollPos(OS2HwndFrame, hwndVertScroll);
    11951234            return vertScrollInfo;
    11961235        }
     
    12081247  ULONG           scrollType;
    12091248  int             new_flags;
     1249
     1250//CB: handled internally
     1251return 0;
    12101252
    12111253    switch(nBar) {
     
    13271369    return infoPtr->CurVal;
    13281370}
     1371/***********************************************************************/
     1372/***********************************************************************/
     1373VOID Win32BaseWindow::subclassScrollBars(BOOL subHorz,BOOL subVert)
     1374{
     1375  SCROLL_SubclassScrollBars(subHorz ? hwndHorzScroll:0,subVert ? hwndVertScroll:0);
     1376}
    13291377/***********************************************************************
    13301378 *           NC_HandleSysCommand
     
    15671615      int rc;
    15681616
    1569         if (!windowClass->getBackgroundBrush()) return 0;
     1617        if (!windowClass || !windowClass->getBackgroundBrush()) return 0;
    15701618
    15711619        rc = GetClipBox( (HDC)wParam, &rect );
     
    16251673    {
    16261674            LRESULT result = 0;
     1675            if (!windowClass) return result;
    16271676            int index = GCL_HICON;
    16281677
Note: See TracChangeset for help on using the changeset viewer.