Changeset 1322


Ignore:
Timestamp:
Oct 16, 1999, 4:51:43 PM (26 years ago)
Author:
sandervl
Message:

isFrameWindow bugfix + MDI creation & WM_NCCALCSIZE bugfix

Location:
trunk/src/user32
Files:
5 edited

Legend:

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

    r1314 r1322  
    1 /* $Id: win32wbase.cpp,v 1.46 1999-10-16 10:28:31 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.47 1999-10-16 14:51:42 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    11631163//******************************************************************************
    11641164//******************************************************************************
     1165BOOL Win32BaseWindow::isMDIChild()
     1166{
     1167    return FALSE;
     1168}
     1169//******************************************************************************
     1170//TODO: Not complete
     1171//******************************************************************************
    11651172BOOL Win32BaseWindow::isFrameWindow()
    11661173{
    1167     if((getParent() == NULL || getParent() == windowDesktop) && ((dwStyle & WS_CAPTION) == WS_CAPTION))
     1174//    if(isMDIChild() || IsDialog() || (getParent() == NULL || getParent() == windowDesktop) && ((dwStyle & WS_CAPTION) == WS_CAPTION))
     1175    if((dwStyle & WS_CAPTION) == WS_CAPTION || dwStyle & (WS_VSCROLL|WS_HSCROLL))
    11681176        return TRUE;
    11691177
  • TabularUnified trunk/src/user32/win32wbase.h

    r1314 r1322  
    1 /* $Id: win32wbase.h,v 1.24 1999-10-16 10:28:31 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.25 1999-10-16 14:51:43 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    108108         BOOL   isFrameWindow();
    109109virtual  BOOL   isMDIClient();
     110virtual  BOOL   isMDIChild();
    110111
    111112Win32BaseWindow *getParent()                    { return (Win32BaseWindow *)ChildWindow::GetParent(); };
  • TabularUnified trunk/src/user32/win32wbasepos.cpp

    r1265 r1322  
    1 /* $Id: win32wbasepos.cpp,v 1.1 1999-10-13 14:24:49 sandervl Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.2 1999-10-16 14:51:43 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    277277        if (getStyle() & CS_HREDRAW) result |= WVR_HREDRAW;
    278278
    279         if(!isFrameWindow())  return result;
    280 
    281279//TODO: Wine calculates new size of client area even when window is iconic (client edges)
    282280        if(!(getStyle() & (WS_MINIMIZE | WS_ICONIC)))
     
    295293        }
    296294#if 0
    297 //TODO: Docs say app should return 0 when fCalcValidRects == 0, Wine doesn't do this
     295//TODO: Docs say app should return 0 when fCalcValidRects == 0; Wine doesn't do this
    298296        if(wParam == 0) //fCalcValidRects
    299297            return 0;
  • TabularUnified trunk/src/user32/win32wmdichild.cpp

    r1256 r1322  
    1 /* $Id: win32wmdichild.cpp,v 1.4 1999-10-12 14:47:24 sandervl Exp $ */
     1/* $Id: win32wmdichild.cpp,v 1.5 1999-10-16 14:51:43 sandervl Exp $ */
    22/*
    33 * Win32 MDI Child Window Class for OS/2
     
    4545//******************************************************************************
    4646Win32MDIChildWindow::Win32MDIChildWindow(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode)
    47                 : Win32BaseWindow(lpCreateStructA, classAtom, isUnicode)
     47                    : Win32BaseWindow(lpCreateStructA, classAtom, isUnicode)
    4848{
    4949}
     
    8080    }
    8181    else return 1;
     82}
     83//******************************************************************************
     84//******************************************************************************
     85BOOL Win32MDIChildWindow::isMDIChild()
     86{
     87    return TRUE;
    8288}
    8389//******************************************************************************
     
    277283HWND Win32MDIChildWindow::createChild(Win32MDIClientWindow *client, LPMDICREATESTRUCTA cs )
    278284{
    279     POINT        pos[2];
    280     DWORD        style = cs->style | (WS_CHILD | WS_CLIPSIBLINGS);
    281     HWND         hwnd;
    282     WORD         wIDmenu = client->getFirstChildId() + client->getNrOfChildren();
    283     char         lpstrDef[]="junk!";
    284     Win32MDIChildWindow *maximizedChild, *newchild;
     285  POINT        pos[2];
     286  DWORD        style = cs->style | (WS_CHILD | WS_CLIPSIBLINGS);
     287  WORD         wIDmenu = client->getFirstChildId() + client->getNrOfChildren();
     288  char         lpstrDef[]="junk!";
     289  Win32MDIChildWindow *maximizedChild, *newchild;
     290  CREATESTRUCTA createstruct;
     291  ATOM         classAtom;
     292  char         tmpClassA[20] = "";
     293  WCHAR        tmpClassW[20];
     294  LPSTR        className;
    285295
    286296    dprintf(("Win32MDIChildWindow::createChild %i,%i - dim %i,%i, style %08x\n",
     
    326336    }
    327337
    328     if(!client->IsUnicode())
    329         hwnd = ::CreateWindowA(cs->szClass, cs->szTitle, style,
    330                                cs->x, cs->y, cs->cx, cs->cy, client->getWindowHandle(),
    331                                (HMENU)wIDmenu, cs->hOwner, cs );
    332     else
    333         hwnd = ::CreateWindowW((LPWSTR)cs->szClass, (LPWSTR)cs->szTitle, style,
    334                                cs->x, cs->y, cs->cx, cs->cy, client->getWindowHandle(),
    335                                (HMENU)wIDmenu, cs->hOwner, cs );
    336 
    337     /* MDI windows are WS_CHILD so they won't be activated by CreateWindow */
    338     newchild = (Win32MDIChildWindow *)GetWindowFromHandle(hwnd);
    339     if (hwnd && newchild)
     338    createstruct.lpszName  = cs->szTitle;
     339    createstruct.style     = style;
     340    createstruct.dwExStyle = 0;
     341    createstruct.x         = cs->x;
     342    createstruct.y         = cs->y;
     343    createstruct.cx        = cs->cx;
     344    createstruct.cy        = cs->cy;
     345    createstruct.hInstance = cs->hOwner;
     346    createstruct.hMenu     = wIDmenu;
     347    createstruct.hwndParent= client->getWindowHandle();
     348    createstruct.lpCreateParams = (LPVOID)cs;
     349
     350    className = (LPSTR)cs->szClass;
     351    /* Find the class atom */
     352    if (!(classAtom = (client->IsUnicode() ? GlobalFindAtomW((LPWSTR)cs->szClass) :
     353                                             GlobalFindAtomA(cs->szClass))))
     354    {
     355        if (!HIWORD(cs->szClass))
     356        {
     357            if(!client->IsUnicode())
     358            {
     359                sprintf(tmpClassA,"#%d", (int) className);
     360                classAtom = GlobalFindAtomA(tmpClassA);
     361                className = tmpClassA;
     362            }
     363            else
     364            {
     365              sprintf(tmpClassA,"#%d", (int) className);
     366              AsciiToUnicode(tmpClassA, tmpClassW);
     367              classAtom = GlobalFindAtomW(tmpClassW);
     368              className = (LPSTR)tmpClassW;
     369            }
     370        }
     371        if (!classAtom)
     372        {
     373          if (!HIWORD(cs->szClass)) {
     374                  dprintf(("createChild: bad class name %04x\n", LOWORD(className)));
     375          }
     376          else    dprintf(("createChild: bad class name '%s'\n", tmpClassA ));
     377
     378          SetLastError(ERROR_INVALID_PARAMETER);
     379          return 0;
     380        }
     381    }
     382    createstruct.lpszClass = className;
     383
     384    newchild = new Win32MDIChildWindow(&createstruct, classAtom, client->IsUnicode());
     385
     386    if(newchild && GetLastError() == 0)
    340387    {
    341388        newchild->menuModifyItem();
     
    368415                    client->setMaximizedChild(newchild);
    369416#if 0
    370                     MDI_AugmentFrameMenu( ci, w->parent, hwnd );
     417                    MDI_AugmentFrameMenu( ci, w->parent, newchild->getWindowHandle() );
    371418#endif
    372419                    client->updateFrameText(MDI_REPAINTFRAME, NULL );
     
    387434        if( maximizedChild && maximizedChild->IsWindow() )
    388435            maximizedChild->ShowWindow(SW_SHOWMAXIMIZED);
    389     }
    390     return hwnd;
     436
     437        dprintf(("MDI child creation failed!!"));
     438        return 0;
     439    }
     440    return newchild->getWindowHandle();
    391441}
    392442/**********************************************************************
  • TabularUnified trunk/src/user32/win32wmdichild.h

    r1093 r1322  
    1 /* $Id: win32wmdichild.h,v 1.2 1999-09-29 09:16:32 sandervl Exp $ */
     1/* $Id: win32wmdichild.h,v 1.3 1999-10-16 14:51:43 sandervl Exp $ */
    22/*
    33 * Win32 MDI Client Window Class for OS/2
     
    3232           BOOL menuDeleteItem();
    3333
     34virtual  BOOL   isMDIChild();
     35
    3436        LRESULT DefMDIChildProcA(UINT Msg, WPARAM wParam, LPARAM lParam);
    3537        LRESULT DefMDIChildProcW(UINT Msg, WPARAM wParam, LPARAM lParam);
Note: See TracChangeset for help on using the changeset viewer.