Changeset 2335 for trunk/src


Ignore:
Timestamp:
Jan 5, 2000, 10:25:08 PM (26 years ago)
Author:
cbratschi
Message:

single frame works now

Location:
trunk/src/user32/new
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/oslibgdi.cpp

    r2290 r2335  
    1 /* $Id: oslibgdi.cpp,v 1.9 2000-01-01 14:57:18 cbratschi Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.10 2000-01-05 21:25:03 cbratschi Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    430430//******************************************************************************
    431431//******************************************************************************
     432BOOL mapWin32Rect(HWND os2From,HWND os2To,PRECT rectWin32)
     433{
     434  RECTL rect;
     435
     436  mapWin32ToOS2Rect(os2From,rectWin32,(PRECTLOS2)&rect);
     437  WinMapWindowPoints((os2From == OSLIB_HWND_DESKTOP) ? HWND_DESKTOP:os2From,(os2To == OSLIB_HWND_DESKTOP) ? HWND_DESKTOP:os2To,(PPOINTL)&rect,2);
     438  mapOS2ToWin32Rect(os2To,(PRECTLOS2)&rect,rectWin32);
     439}
     440//******************************************************************************
     441//******************************************************************************
    432442BOOL copyOS2ToWin32Rect(PRECTLOS2 rectOS2,PRECT rectWin32)
    433443{
  • trunk/src/user32/new/oslibgdi.h

    r2290 r2335  
    1 /* $Id: oslibgdi.h,v 1.7 2000-01-01 14:54:52 cbratschi Exp $ */
     1/* $Id: oslibgdi.h,v 1.8 2000-01-05 21:25:03 cbratschi Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    6969BOOL mapWin32ToOS2Rect(HWND os2From,HWND os2To,PRECT rectWin32,PRECTLOS2 rectOS2);
    7070BOOL mapWin32ToOS2Rect(Win32BaseWindow *wndFrom,Win32BaseWindow *wndTo,PRECT rectWin32,PRECTLOS2 rectOS2);
     71BOOL mapWin32Rect(HWND os2From,HWND os2To,PRECT rectWin32);
    7172BOOL copyOS2ToWin32Rect(PRECTLOS2 rectOS2,PRECT rectWin32);
    7273BOOL copyWin32ToOS2WindowRect(PRECT rectWin32,PRECTLOS2 rectOS2);
  • trunk/src/user32/new/oslibmsg.cpp

    r2314 r2335  
    1 /* $Id: oslibmsg.cpp,v 1.8 2000-01-03 22:53:16 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.9 2000-01-05 21:25:03 cbratschi Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    225225        while(rc == FALSE);
    226226
    227         return rc;
     227        return rc;
    228228  }
    229229  else
     
    237237  }
    238238  if(rc) {
    239         OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE);
     239        OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE);
    240240        memcpy(MsgThreadPtr, &os2msg, sizeof(QMSG));
    241241  }
     
    410410
    411411    return yyrc;
    412 } 
     412}
    413413//******************************************************************************
    414414BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode)
  • trunk/src/user32/new/oslibmsgtranslate.cpp

    r2309 r2335  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.4 2000-01-03 20:53:49 cbratschi Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.5 2000-01-05 21:25:04 cbratschi Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    112112  memset(winMsg, 0, sizeof(MSG));
    113113  win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(os2Msg->hwnd);
     114  if (!win32wnd) win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(os2Msg->hwnd);
    114115  //PostThreadMessage posts WIN32APP_POSTMSG msg without window handle
    115116  if((win32wnd == 0) && (os2Msg->msg != WM_CREATE) && (os2Msg->msg != WIN32APP_POSTMSG))
     
    120121  winMsg->pt.x = os2Msg->ptl.x;
    121122  winMsg->pt.y = mapScreenY(os2Msg->ptl.y);
     123
    122124  if(win32wnd) //==0 for WM_CREATE
    123125    winMsg->hwnd = win32wnd->getWindowHandle();
     
    206208      case WM_HITTEST:
    207209      {
    208         OSLIBPOINT pt;
    209 
    210         pt.x = (*(POINTS *)&os2Msg->mp1).x;
    211         pt.y = (*(POINTS *)&os2Msg->mp1).y;
    212 
    213         mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);
    214210        winMsg->message  = WINWM_NCHITTEST;
    215211        winMsg->wParam  = 0;
    216         winMsg->lParam  = MAKELONG((USHORT)pt.x, (USHORT)pt.y);
     212        winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    217213        return TRUE;
    218214      }
     
    276272
    277273    case WM_WINDOWPOSCHANGED:
    278     {
    279       PSWP      pswp  = (PSWP)os2Msg->mp1;
    280       SWP       swpOld = *(pswp + 1);
    281       HWND      hParent = NULLHANDLE;
    282       LONG      yDelta = pswp->cy - swpOld.cy;
    283       LONG      xDelta = pswp->cx - swpOld.cx;
    284 
    285         dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    286 
    287         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto dummymessage;
    288 
    289         if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    290             if (win32wnd->isChild()) {
    291                 if(win32wnd->getParent()) {
    292                         hParent = win32wnd->getParent()->getOS2WindowHandle();
    293                 }
    294                 else    goto dummymessage; //parent has just been destroyed
    295             }
    296         }
    297         OSLibMapSWPtoWINDOWPOS(pswp, &thdb->wp, &swpOld, hParent, win32wnd->getOS2FrameWindowHandle());
    298 
    299         if (!win32wnd->CanReceiveSizeMsgs())    goto dummymessage;
    300 //CB: todo: send WM_NCCALCSIZE
    301 #if 0   //CB: ignore it
    302         dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy));
    303         win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    304 
    305         thdb->wp.hwnd = win32wnd->getWindowHandle();
    306         if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
    307         {
    308            Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    309            thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();
    310         }
    311 
    312         PRECT lpRect = win32wnd->getWindowRect();
    313         //SvL: Only send it when the client has changed & the frame hasn't
    314         //     If the frame size/position has changed, pmframe.cpp will send
    315         //     this message
    316         if(lpRect->right == thdb->wp.x+thdb->wp.cx && lpRect->bottom == thdb->wp.y+thdb->wp.cy) {
    317                 winMsg->message    = WINWM_WINDOWPOSCHANGED;
    318                 winMsg->lParam = (LPARAM)&thdb->wp;
    319         }
    320         else {
    321             win32wnd->setWindowRect(thdb->wp.x, thdb->wp.y, thdb->wp.x+thdb->wp.cx, thdb->wp.y+thdb->wp.cy);
    322             goto dummymessage;
    323         }
    324 #else
    325274        goto dummymessage;
    326 #endif
    327     }
    328275
    329276    case WM_ACTIVATE:
     
    668615    case WM_HITTEST:
    669616    {
    670         OSLIBPOINT pt;
    671 
    672         pt.x = (*(POINTS *)&os2Msg->mp1).x;
    673         pt.y = (*(POINTS *)&os2Msg->mp1).y;
    674 
    675         mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);
    676617        winMsg->message  = WINWM_NCHITTEST;
    677618        winMsg->wParam  = 0;
    678         winMsg->lParam  = MAKELONG((USHORT)pt.x, (USHORT)pt.y);
     619        winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    679620        break;
    680621    }
  • trunk/src/user32/new/oslibwin.cpp

    r2309 r2335  
    1 /* $Id: oslibwin.cpp,v 1.32 2000-01-03 20:53:50 cbratschi Exp $ */
     1/* $Id: oslibwin.cpp,v 1.33 2000-01-05 21:25:04 cbratschi Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    9090  *hwndFrame = WinCreateWindow (hwndParent,
    9191                                WC_FRAME,
    92                                 pszName, dwWinStyle, 0, 0, 50, 30,
     92                                pszName, dwWinStyle, 0, 0, 0, 0,
    9393                                hwndParent, HWND_TOP,
    9494                                id, &FCData, NULL);
  • trunk/src/user32/new/pmframe.cpp

    r2309 r2335  
    1 /* $Id: pmframe.cpp,v 1.4 2000-01-03 20:53:50 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.5 2000-01-05 21:25:05 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    262262      PSWP pswp = (PSWP)mp1,swpClient;
    263263      RECTL *client = (PRECTL)mp2,rect;
     264      RECT winRect;
    264265      INT ccount;
    265266
     
    269270      ccount = (INT)OldFrameProc(hwnd,msg,mp1,mp2);
    270271      SetWin32TIB();
     272      dprintf(("Frame size: %d %d",win32wnd->getWindowWidth(),win32wnd->getWindowHeight()));
     273      win32wnd->MsgFormatFrame();
     274      //CB: todo: use result for WM_CALCVALIDRECTS
    271275      mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
    272276      WinMapWindowPoints(WinQueryWindow(hwnd,QW_PARENT),hwnd,(PPOINTL)&rect,2);
    273 //dprintf(("CB: %d %d %d %d",rect.xLeft,rect.yBottom,rect.xRight,rect.yTop));
     277      dprintf(("New client position: %d %d %d %d",rect.xLeft,rect.yBottom,rect.xRight,rect.yTop));
    274278      swpClient = &pswp[ccount-1];
    275279      swpClient->x = rect.xLeft;
     
    339343      else
    340344      {
    341         dprintf(("USER32: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y));
     345        dprintf(("PMFRAME: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y));
    342346
    343347        //CB: WinWindowFromPoint: PM sends WM_HITTEST -> loop -> stack overflow
     
    351355
    352356    case WM_PAINT:
     357        //CB: todo: call defframe if minimized
    353358        dprintf(("PMFRAME: WM_PAINT"));
    354359        if (win32wnd->IsWindowCreated())
     
    356361        goto RunDefWndProc;
    357362
    358 //CB: not yet checked
     363    case WM_SIZE:
     364        dprintf(("PMFRAME: WM_SIZE"));
     365        goto RunDefFrameProc;
     366
    359367    case WM_ADJUSTWINDOWPOS:
    360368    {
     
    381389            goto RunDefFrameProc;
    382390
    383         if(!win32wnd->CanReceiveSizeMsgs()) {
    384 //SvL: Doing this breaks button.exe, header4(a).exe & style.exe
    385 //            goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
    386             break;
    387         }
     391        if(!win32wnd->CanReceiveSizeMsgs())
     392           break;
    388393
    389394        WinQueryWindowPos(hwnd, &swpOld);
     
    419424            pswp->hwnd = hwnd;
    420425
    421 //            goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
    422426            RestoreOS2TIB();
    423427            return (MRESULT)0xf;
    424428        }
    425         goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
     429        goto RunDefFrameProc;
    426430    }
    427431
     
    434438
    435439        dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    436 
    437         RestoreOS2TIB();
    438         rc = OldFrameProc(hwnd,msg,mp1,mp2);
    439         SetWin32TIB();
    440440
    441441        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
     
    453453
    454454        win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
    455         win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    456 
     455dprintf(("CB: %d %d %d %d",wp.x,wp.y,wp.x+wp.cx,wp.y+wp.cy));
    457456        if(win32wnd->CanReceiveSizeMsgs())
    458457          win32wnd->MsgPosChanged((LPARAM)&wp);
    459458
    460459PosChangedEnd:
     460        //calls WM_FORMATFRAME if SWP_SIZE is set
     461        RestoreOS2TIB();
     462        rc = OldFrameProc(hwnd,msg,mp1,mp2);
     463        SetWin32TIB();
     464
    461465        RestoreOS2TIB();
    462466        return rc;
  • trunk/src/user32/new/pmwindow.cpp

    r2291 r2335  
    1 /* $Id: pmwindow.cpp,v 1.32 2000-01-01 17:07:42 cbratschi Exp $ */
     1/* $Id: pmwindow.cpp,v 1.33 2000-01-05 21:25:05 cbratschi Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    243243        break;
    244244
    245 #if 1
    246245    case WM_ADJUSTWINDOWPOS:
    247     {
    248 //      PSWP     pswp = (PSWP)mp1;
    249 
    250 //        dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    251         goto RunDefWndProc;
    252     }
    253 #else
    254     case WM_ADJUSTWINDOWPOS:
    255     {
    256       PSWP     pswp = (PSWP)mp1;
    257       SWP      swpOld, swpNew;
    258       WINDOWPOS wp;
    259       ULONG     parentHeight = 0;
    260       HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE, hwndAfter;
    261 
    262         dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    263 
    264         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto RunDefWndProc;;
    265 
    266         //SvL: TODO: Workaround. Why is this happening?
    267         //     When this flag is set the coordinates are 0, even though SWP_SIZE & SWP_MOVE are set.
    268 //        if ((pswp->fl & SWP_NOADJUST)) goto RunDefWndProc;
    269 
    270         if(!win32wnd->CanReceiveSizeMsgs()) goto RunDefWndProc;;
    271 
    272         WinQueryWindowPos(hwnd, &swpOld);
    273 
    274         if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    275             if (win32wnd->isChild()) {
    276                 if(win32wnd->getParent()) {
    277                         hParent = win32wnd->getParent()->getOS2WindowHandle();
    278                 }
    279                 else    goto RunDefWndProc;;
    280             }
    281         }
    282         hwndAfter = pswp->hwndInsertBehind;
    283         hFrame = win32wnd->getOS2FrameWindowHandle();
    284         OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame);
    285 
    286         wp.hwnd = win32wnd->getWindowHandle();
    287         if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
    288         {
    289            Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    290            if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle();
    291         }
    292         if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0)
    293         {//app or default window handler changed wp
    294             dprintf(("OS2: WM_ADJUSTWINDOWPOS, app changed windowpos struct"));
    295             dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    296             OSLibMapWINDOWPOStoSWP(&wp, &swpNew, &swpOld, hParent, hFrame);
    297             dprintf(("%x (%d,%d), (%d,%d)", swpNew.fl, swpNew.x, swpNew.y, swpNew.cx, swpNew.cy));
    298             swpNew.fl |= SWP_NOADJUST;
    299             swpNew.hwndInsertBehind = hwndAfter;
    300             swpNew.hwnd = hFrame;
    301 
    302             WinSetMultWindowPos(GetThreadHAB(), &swpNew, 1);
    303             return (MRESULT)0;
    304         }
    305         break;
    306     }
    307 #endif
     246        goto RunDefWndProc;
    308247
    309248    case WM_WINDOWPOSCHANGED:
     
    584523
    585524        win32wnd->setWindowRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    586         win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
     525        //win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    587526        wp.x = swpOld.x;
    588527        wp.y = swpOld.y;
  • trunk/src/user32/new/user32.cpp

    r2290 r2335  
    1 /* $Id: user32.cpp,v 1.23 2000-01-01 14:57:25 cbratschi Exp $ */
     1/* $Id: user32.cpp,v 1.24 2000-01-05 21:25:06 cbratschi Exp $ */
    22
    33/*
     
    703703
    704704    case SM_CXBORDER:
    705         rc = 1;
    706         break;
    707 
    708705    case SM_CYBORDER:
    709706        rc = 1;
     707        break;
     708
     709    case SM_CXDLGFRAME:
     710    case SM_CYDLGFRAME:
     711        rc = 3;
     712        break;
     713
     714    case SM_CYMENU:
     715    case SM_CXMENUSIZE:
     716    case SM_CYMENUSIZE:
     717        rc = 19;
     718        break;
     719
     720    case SM_CXSIZE:
     721    case SM_CYSIZE:
     722        rc = GetSystemMetrics(SM_CYCAPTION)-2;
     723        break;
     724
     725    case SM_CXFRAME:
     726    case SM_CYFRAME:
     727        rc = 4;
     728        break;
     729
     730    case SM_CXEDGE:
     731    case SM_CYEDGE:
     732        rc = 2;
     733        break;
     734
     735    case SM_CXMINSPACING:
     736        rc = 160;
     737        break;
     738
     739    case SM_CYMINSPACING:
     740        rc = 24;
     741        break;
     742
     743    case SM_CXSMICON:
     744    case SM_CYSMICON:
     745        rc = 16;
     746        break;
     747
     748    case SM_CYSMCAPTION:
     749        rc = 16;
     750        break;
     751
     752    case SM_CXSMSIZE:
     753    case SM_CYSMSIZE:
     754        rc = 15;
    710755        break;
    711756
     
    728773        rc = FALSE;
    729774        break;
    730     case SM_CXEDGE: //size of 3D window edge
    731         rc = 1;
    732         break;
    733     case SM_CYEDGE:
    734         rc = 1;
    735         break;
    736     case SM_CXMINSPACING: //can be SM_CXMINIMIZED or larger
    737         //CB: replace with const
    738         rc = O32_GetSystemMetrics(SM_CXMINIMIZED);
    739         break;
    740     case SM_CYMINSPACING:
    741         //CB: replace with const
    742         rc = GetSystemMetrics(SM_CYMINIMIZED);
    743         break;
    744775    case SM_CXICON:
    745776    case SM_CYICON:
    746777        rc = 32;  //CB: Win32: only 32x32, OS/2 32x32/40x40
    747778                  //    we must implement 32x32 for all screen resolutions
    748         break;
    749     case SM_CXSMICON: //recommended size of small icons (TODO: adjust to screen res.)
    750         rc = 16;
    751         break;
    752     case SM_CYSMICON:
    753         rc = 16;
    754         break;
    755     case SM_CYSMCAPTION:    //size in pixels of a small caption (TODO: ????)
    756         rc = 8;
    757         break;
    758     case SM_CXSMSIZE:   //size of small caption buttons (pixels) (TODO: implement properly)
    759         rc = 16;
    760         break;
    761     case SM_CYSMSIZE:
    762         rc = 16;
    763         break;
    764     case SM_CXMENUSIZE: //TODO: size of menu bar buttons (such as MDI window close)
    765         rc = 16;
    766         break;
    767     case SM_CYMENUSIZE:
    768         rc = 16;
    769779        break;
    770780    case SM_ARRANGE:
  • trunk/src/user32/new/win32wbase.cpp

    r2309 r2335  
    1 /* $Id: win32wbase.cpp,v 1.21 2000-01-03 20:53:50 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.22 2000-01-05 21:25:07 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    673673  if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )
    674674  {
     675#if 0 //CB: todo
    675676        if (cs->hMenu) {
    676677            SetMenu(cs->hMenu);
     
    682683                }
    683684        }
     685#endif
    684686  }
    685687  else
     
    697699  rectWindow.top = cs->y;
    698700  rectWindow.bottom = cs->y+cs->cy;
    699   rectClient = rectWindow;
    700   if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2);
     701  rectClient = rectWindow; //dummy client rect
     702  MapWindowPoints(getParent() ? getParent()->getWindowHandle():OSLIB_HWND_DESKTOP,0,(PPOINT)&rectWindow,2);
    701703  /* Send the WM_CREATE message
    702704   * Perhaps we shouldn't allow width/height changes as well.
     
    705707  maxPos.x = rectWindow.left; maxPos.y = rectWindow.top;
    706708
    707   //SetWindowPos(hwndLinkAfter,cs->x,cs->y,cs->cx,cs->cy,SWP_NOACTIVATE | SWP_NOREDRAW);
    708 
    709709  //Note: Solitaire crashes when receiving WM_SIZE messages before WM_CREATE
    710   fNoSizeMsg = FALSE;
     710  //fNoSizeMsg = FALSE;
    711711  fCreated = TRUE;
    712712
    713   if(SendInternalMessageA(WM_NCCREATE, 0, (LPARAM)cs) )
     713  if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs))
    714714  {
    715715        RECT rect;
     
    721721        rectWindow.bottom = cs->y+cs->cy;
    722722        rectClient = rectWindow;
    723         if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2);
    724         SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient );
     723        MapWindowPoints(getParent() ? getParent()->getWindowHandle():OSLIB_HWND_DESKTOP,0,(PPOINT)&rectWindow,2);
    725724        OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
    726725        //set the window size and update the client
    727726        rect = rectWindow;
    728         if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rect,2);
     727        MapWindowPoints(0,getParent() ? getParent()->getWindowHandle():OSLIB_HWND_DESKTOP,(PPOINT)&rect,2);
    729728        SetWindowPos(hwndLinkAfter,rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED);
     729        fNoSizeMsg = FALSE;
    730730        if( (SendInternalMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 )
    731731        {
     
    737737            }
    738738
    739             if( getStyle() & WS_CHILD && !(getExStyle() & WS_EX_NOPARENTNOTIFY) )
     739            if( (getStyle() & WS_CHILD) && !(getExStyle() & WS_EX_NOPARENTNOTIFY) )
    740740            {
    741741                /* Notify the parent window only */
     
    886886ULONG Win32BaseWindow::MsgHitTest(MSG *msg)
    887887{
    888   lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, MAKELONG((USHORT)msg->pt.x, (USHORT)msg->pt.y));
     888  lastHitTestVal = SendInternalMessageA(WM_NCHITTEST,msg->wParam,msg->lParam);
    889889  dprintf2(("MsgHitTest returned %x", lastHitTestVal));
    890890
     
    11101110//******************************************************************************
    11111111//******************************************************************************
     1112ULONG  Win32BaseWindow::MsgFormatFrame()
     1113{
     1114  RECT window = rectWindow,client = rectClient,rect;
     1115  WINDOWPOS wndPos;
     1116
     1117  wndPos.hwnd = Win32Hwnd;
     1118  wndPos.hwndInsertAfter = 0;
     1119  rect = rectWindow;
     1120  MapWindowPoints(Win32Hwnd,(getParent()) ? getParent()->getWindowHandle():HWND_DESKTOP,(PPOINT)&rect,2);
     1121  wndPos.x = rect.left;
     1122  wndPos.y = rect.top;
     1123  wndPos.cx = rect.right-rect.left;
     1124  wndPos.cy = rect.bottom-rect.top;
     1125  wndPos.flags = 0;
     1126
     1127  return SendNCCalcSize(TRUE,&window,&window,&client,&wndPos,&rectClient);
     1128}
     1129//******************************************************************************
     1130//******************************************************************************
    11121131ULONG Win32BaseWindow::MsgSetText(LPSTR lpsz, LONG cch)
    11131132{
     
    14801499
    14811500  /* Decide if the window will be managed (see CreateWindowEx) */
    1482   if (!WindowNeedsWMBorder())
     1501  //if (!WindowNeedsWMBorder()) //CB: check Options.managed
    14831502  {
    14841503    if (HAS_THICKFRAME(dwStyle,dwExStyle ))
     
    15201539//******************************************************************************
    15211540//******************************************************************************
    1522 LONG Win32BaseWindow::HandleNCCalcSize(RECT *winRect)
    1523 {
    1524   RECT tmpRect = { 0, 0, 0, 0 };
    1525   LONG result = 0;
    1526   UINT style = (UINT) GetClassLongA(Win32Hwnd,GCL_STYLE);
     1541LONG Win32BaseWindow::HandleNCCalcSize(BOOL calcValidRects,RECT *winRect)
     1542{
     1543  RECT tmpRect = { 0, 0, 0, 0 },*clientRect;
     1544  LONG result = WVR_ALIGNTOP | WVR_ALIGNLEFT;
     1545  UINT style;
     1546
     1547  if (!calcValidRects) return 0;
     1548
     1549  style = (UINT) GetClassLongA(Win32Hwnd,GCL_STYLE);
    15271550
    15281551  if (style & CS_VREDRAW) result |= WVR_VREDRAW;
    15291552  if (style & CS_HREDRAW) result |= WVR_HREDRAW;
    15301553
    1531   if( !( dwStyle & WS_MINIMIZE ) )
    1532   {
    1533     AdjustRectOuter(&tmpRect,FALSE);
    1534 
    1535     winRect->left   -= tmpRect.left;
    1536     winRect->top    -= tmpRect.top;
    1537     winRect->right  -= tmpRect.right;
    1538     winRect->bottom -= tmpRect.bottom;
     1554  clientRect = &((NCCALCSIZE_PARAMS*)winRect)->rgrc[2];
     1555  clientRect->left = 0;
     1556  clientRect->right = rectWindow.right-rectWindow.left;
     1557  clientRect->top = 0;
     1558  clientRect->bottom = rectWindow.bottom-rectWindow.top;
     1559  mapWin32Rect(OS2HwndFrame,getParent() ? getParent()->getWindowHandle():OSLIB_HWND_DESKTOP,clientRect);
     1560
     1561  if(!(dwStyle & WS_MINIMIZE))
     1562  {
     1563    AdjustRectOuter(&tmpRect,FALSE); //CB: todo: menu
     1564
     1565    clientRect->left   -= tmpRect.left;
     1566    clientRect->top    -= tmpRect.top;
     1567    clientRect->right  -= tmpRect.right;
     1568    clientRect->bottom -= tmpRect.bottom;
    15391569
    15401570    if (HAS_MENU(this))
     
    15501580    SetRect (&tmpRect, 0, 0, 0, 0);
    15511581    AdjustRectInner(&tmpRect);
    1552     winRect->left   -= tmpRect.left;
    1553     winRect->top    -= tmpRect.top;
    1554     winRect->right  -= tmpRect.right;
    1555     winRect->bottom -= tmpRect.bottom;
     1582    clientRect->left   -= tmpRect.left;
     1583    clientRect->top    -= tmpRect.top;
     1584    clientRect->right  -= tmpRect.right;
     1585    clientRect->bottom -= tmpRect.bottom;
    15561586  }
    15571587
     
    15731603    if (HAS_THICKFRAME(dwStyle,dwExStyle))
    15741604    {
    1575       InflateRect( &rect, -GetSystemMetrics(SM_CXFRAME), -GetSystemMetrics(SM_CYFRAME) );
    1576       if (!PtInRect( &rect, pt ))
     1605      InflateRect(&rect,-GetSystemMetrics(SM_CXFRAME),-GetSystemMetrics(SM_CYFRAME));
     1606      if (!PtInRect(&rect,pt))
    15771607      {
    15781608        /* Check top sizing border */
     
    16051635        }
    16061636      }
    1607     }
    1608     else  /* No thick frame */
     1637    } else  /* No thick frame */
    16091638    {
    16101639      if (HAS_DLGFRAME(dwStyle,dwExStyle))
     
    16201649    {
    16211650      if (dwExStyle & WS_EX_TOOLWINDOW)
    1622         rect.top += GetSystemMetrics(SM_CYSMCAPTION) - 1;
     1651        rect.top += GetSystemMetrics(SM_CYSMCAPTION)-1;
    16231652      else
    1624         rect.top += GetSystemMetrics(SM_CYCAPTION) - 1;
    1625       if (!PtInRect( &rect, pt ))
     1653        rect.top += GetSystemMetrics(SM_CYCAPTION)-1;
     1654      if (!PtInRect(&rect,pt))
    16261655      {
    16271656        /* Check system menu */
     
    16651694
    16661695  ScreenToClient(Win32Hwnd,&pt);
    1667   rect = rectClient;
     1696  getClientRect(&rect);
    16681697  if (PtInRect(&rect,pt)) return HTCLIENT;
    16691698
     
    24512480
    24522481    case WM_NCCALCSIZE:
    2453         return HandleNCCalcSize((RECT*)lParam);
     2482        return HandleNCCalcSize((BOOL)wParam,(RECT*)lParam);
    24542483
    24552484    case WM_CTLCOLORMSGBOX:
  • trunk/src/user32/new/win32wbase.h

    r2312 r2335  
    1 /* $Id: win32wbase.h,v 1.16 2000-01-03 21:37:17 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.17 2000-01-05 21:25:08 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    4141//PostThreadMessage is done through Open32; which means the message id will be translated
    4242//(0xc00 added)
    43 #define OPEN32_MSGDIFF            0xC00
     43#define OPEN32_MSGDIFF            0xC00
    4444#define WIN32APP_POSTMSG          (0x1000+OPEN32_MSGDIFF)
    4545
     
    8686         ULONG  MsgHitTest(MSG *msg);
    8787         ULONG  MsgNCPaint();
     88         ULONG  MsgFormatFrame();
    8889         ULONG  DispatchMsgA(MSG *msg);
    8990         ULONG  DispatchMsgW(MSG *msg);
     
    138139         {
    139140                *rect = rectClient;
    140                 rectClient.right  -= rectClient.left;
    141                 rectClient.bottom -= rectClient.top;
    142                 rectClient.left = rectClient.top = 0;
     141                rect->right  -= rect->left;
     142                rect->bottom -= rect->top;
     143                rect->left = rect->top = 0;
    143144         }
    144145         void   setClientRect(PRECT rect)       { rectClient = *rect; };
     
    164165         HICON  GetIcon()                           { return (HICON) iconResource; };
    165166
    166         void   SetWindowRegion(HRGN hRegion)       { hWindowRegion = hRegion; };
    167          HRGN   GetWindowRegion()                   { return hWindowRegion; };
     167        void   SetWindowRegion(HRGN hRegion)       { hWindowRegion = hRegion; };
     168         HRGN   GetWindowRegion()                   { return hWindowRegion; };
    168169
    169170         BOOL   ShowWindow(ULONG nCmdShow);
     
    318319        BOOL    fParentDC;
    319320
    320         HRGN    hWindowRegion;
     321        HRGN    hWindowRegion;
    321322
    322323        DWORD   dwThreadId;             //id of thread that created this window
     
    367368        VOID  AdjustRectOuter(LPRECT rect,BOOL menu);
    368369        VOID  AdjustRectInner(LPRECT rect);
    369         LONG  HandleNCCalcSize(RECT *winRect);
     370        LONG  HandleNCCalcSize(BOOL calcValidRects,RECT *winRect);
    370371        LONG  HandleNCHitTest(POINT pt);
    371372        VOID  GetInsideRect(RECT *rect);
  • trunk/src/user32/new/win32wbasepos.cpp

    r2292 r2335  
    1 /* $Id: win32wbasepos.cpp,v 1.2 2000-01-02 19:30:45 cbratschi Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.3 2000-01-05 21:25:08 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    172172   result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect,
    173173                         (LPARAM)&params );
    174    *newClientRect = params.rgrc[0];
     174   if (calcValidRect)
     175   {
     176      /* If the application send back garbage, ignore it */
     177      if (params.rgrc[2].left <= params.rgrc[2].right && params.rgrc[2].top <= params.rgrc[2].bottom)
     178         *newClientRect = params.rgrc[2];
     179      else
     180        SetRectEmpty(newClientRect);
     181   }
     182
    175183   return result;
    176184}
Note: See TracChangeset for help on using the changeset viewer.