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

wm_adjustwindowpos & combobox fixes

File:
1 edited

Legend:

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

    r1387 r1391  
    1 /* $Id: pmwindow.cpp,v 1.38 1999-10-20 22:35:53 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.39 1999-10-21 12:19:27 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    253253      WINDOWPOS wp;
    254254      ULONG     parentHeight = 0;
    255       HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE;
     255      HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE, hwndAfter;
    256256
    257257        dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    258258
    259         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
    260         if(!win32wnd->CanReceiveSizeMsgs()) break;
     259        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto RunDefWndProc;;
     260
     261        //SvL: TODO: Workaround. Why is this happening?
     262        //     When this flag is set the coordinates are 0, even though SWP_SIZE & SWP_MOVE are set.
     263//        if ((pswp->fl & SWP_NOADJUST)) goto RunDefWndProc;
     264
     265        if(!win32wnd->CanReceiveSizeMsgs()) goto RunDefWndProc;;
    261266
    262267        WinQueryWindowPos(hwnd, &swpOld);
     
    267272                        hParent = win32wnd->getParent()->getOS2WindowHandle();
    268273                }
    269                 else    break;
    270             }
    271         }
     274                else    goto RunDefWndProc;;
     275            }
     276        }
     277        hwndAfter = pswp->hwndInsertBehind;
    272278        hFrame = win32wnd->getOS2FrameWindowHandle();
    273279        OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame);
     
    285291            OSLibMapWINDOWPOStoSWP(&wp, pswp, &swpOld, hParent, hFrame);
    286292            dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    287             //TODO: What should we return here? 0 means no changes, but the AWP flags
    288             //      aren't very useful either
     293            pswp->fl |= SWP_NOADJUST;
     294            pswp->hwndInsertBehind = hwndAfter;
     295            pswp->hwnd = hFrame;
     296
     297            WinSetMultWindowPos(GetThreadHAB(), pswp, 1);
     298            return (MRESULT)0;
    289299        }
    290300        break;
     
    301311      LONG      xDelta = pswp->cx - swpOld.cx;
    302312
    303         dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     313        dprintf(("OS2: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    304314
    305315        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
     
    314324            }
    315325        }
    316         hFrame = WinQueryWindow(hwnd, QW_PARENT);
    317         OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame);
     326        OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hwnd);
    318327
    319328        win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     
    388397    }
    389398
    390     case WM_MOVE:
    391     {
    392         if (!win32wnd->isFrameWindow()) break;
    393 
    394         HWND      hFrame = win32wnd->getOS2FrameWindowHandle();
    395         SWP       swp, swpo;
    396         WINDOWPOS wp;
    397         ULONG     parentHeight = 0;
    398         RECTL     rcl;
    399 
    400         WinQueryWindowRect (hwnd, &rcl);
    401         WinMapWindowPoints (hwnd, hFrame, (PPOINTL)&rcl, 2);
    402         swp.x  = swpo.x  = rcl.xLeft;
    403         swp.y  = swpo.y  = rcl.yBottom;
    404         swp.cx = swpo.cx = rcl.xRight - rcl.xLeft;
    405         swp.cy = swpo.cy = rcl.yTop   - rcl.yBottom;
    406         swp.fl = SWP_MOVE | SWP_NOREDRAW;
    407         swp.hwnd             = hwnd;
    408         swp.hwndInsertBehind = NULLHANDLE;
    409         dprintf(("OS2: WM_MOVE %x %x (%d,%d) (%d,%d)", hwnd, swp.fl, swp.x, swp.y, swp.cx, swp.cy));
    410 
    411         OSLibMapSWPtoWINDOWPOS(&swp, &wp, &swpo, NULLHANDLE, hFrame);
    412 
    413         wp.flags &= ~SWP_NOMOVE_W;
    414         wp.hwnd = win32wnd->getWindowHandle();
    415         win32wnd->setWindowRect(wp.x, wp.y, wp.x + wp.cx, wp.y + wp.cy);
    416         win32wnd->setClientRect(swpo.x, swpo.y, swpo.x + swpo.cx, swpo.y + swpo.cy);
    417         win32wnd->MsgPosChanged((LPARAM)&wp);
    418         break;
    419     }
    420 
    421399    case WM_SIZE:
    422400    {
    423         break;
     401        dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp2)));
     402        break;
     403    }
     404
     405    case WM_OWNERPOSCHANGE:
     406    {
     407        dprintf(("OS2: WM_OWNERPOSCHANGE"));
     408        goto RunDefWndProc;
     409    }
     410
     411    case WM_CALCVALIDRECTS:
     412    {
     413        dprintf(("OS2: WM_CALCVALIDRECTS"));
     414        goto RunDefWndProc;
    424415    }
    425416
     
    820811            win32wnd->setEraseBkgnd (!erased, !erased);
    821812        }
    822 
    823813        break;
    824814    }
     
    853843    case WM_SYSCOLORCHANGE:
    854844    case WM_SYSVALUECHANGED:
    855     case WM_CALCVALIDRECTS:
    856845    case WM_SETSELECTION:
    857846    case WM_PPAINT:
Note: See TracChangeset for help on using the changeset viewer.