Ignore:
Timestamp:
Oct 19, 1999, 2:52:31 PM (26 years ago)
Author:
sandervl
Message:

MDI fix + desktop as parent for main windows

File:
1 edited

Legend:

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

    r1351 r1357  
    1 /* $Id: win32wbase.cpp,v 1.54 1999-10-18 11:59:58 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.55 1999-10-19 12:52:30 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    394394  else
    395395  {
    396         if (!cs->hwndParent) {
     396        SetParent(windowDesktop->getWindowHandle());
     397        if (!cs->hwndParent || cs->hwndParent == windowDesktop->getWindowHandle()) {
    397398            owner = NULL;
    398399        }
    399400        else
    400401        {
    401             owner = GetWindowFromHandle(cs->hwndParent);
     402            owner = GetWindowFromHandle(cs->hwndParent)->GetTopParent();
    402403            if(owner == NULL)
    403404            {
     
    20932094   else oldhwnd = 0;
    20942095
    2095    if(hwndNewParent == 0) {//desktop window = parent
    2096         setParent(NULL);
    2097         OSLibWinSetParent(getOS2WindowHandle(), OSLIB_HWND_DESKTOP);
    2098         return oldhwnd;
    2099    }
    21002096   newparent = GetWindowFromHandle(hwndNewParent);
    21012097   if(newparent)
     
    21142110{
    21152111    if(getParent()) {
    2116         return getParent()->getWindowHandle() == hwndParent;
     2112          return getParent()->getWindowHandle() == hwndParent;
    21172113    }
    21182114    else  return 0;
     
    21792175 Win32BaseWindow *prevchild = 0, *child = 0;
    21802176
    2181         dprintf(("EnumChildWindows of %x parameter %x %x (%x)", getWindowHandle(), lpfn, lParam, getFirstChild()));
     2177    dprintf(("EnumChildWindows of %x parameter %x %x (%x)", getWindowHandle(), lpfn, lParam, getFirstChild()));
    21822178    for (child = (Win32BaseWindow *)getFirstChild(); child; child = (Win32BaseWindow *)child->getNextChild())
    21832179    {
     
    26272623WORD Win32BaseWindow::GetWindowWord(int index)
    26282624{
    2629    if(index >= 0 && index/4 < nrUserWindowLong)
    2630    {
     2625    if(index >= 0 && index/4 < nrUserWindowLong)
     2626    {
    26312627        return ((WORD *)userWindowLong)[index/2];
    2632    }
    2633    SetLastError(ERROR_INVALID_PARAMETER);
    2634    return 0;
     2628    }
     2629    SetLastError(ERROR_INVALID_PARAMETER);
     2630    return 0;
    26352631}
    26362632//******************************************************************************
     
    26382634void Win32BaseWindow::setWindowId(DWORD id)
    26392635{
    2640    windowId = id;
    2641    OSLibSetWindowID(OS2HwndFrame, id);
     2636    windowId = id;
     2637    OSLibSetWindowID(OS2HwndFrame, id);
    26422638}
    26432639//******************************************************************************
     
    26472643 Win32BaseWindow *window;
    26482644
    2649    if(hwnd == NULL && windowDesktop)
    2650     return windowDesktop;
    2651 
    2652    if(HwGetWindowHandleData(hwnd, (DWORD *)&window) == TRUE) {
    2653         return window;
    2654    }
    2655    else return NULL;
     2645    if(hwnd == NULL && windowDesktop)
     2646         return windowDesktop;
     2647
     2648    if(HwGetWindowHandleData(hwnd, (DWORD *)&window) == TRUE) {
     2649         return window;
     2650    }
     2651    else return NULL;
    26562652}
    26572653//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.