Changeset 4463 for trunk/src


Ignore:
Timestamp:
Oct 9, 2000, 7:26:55 PM (25 years ago)
Author:
sandervl
Message:

mdi fix + ShowOwnedPopups implemented

Location:
trunk/src/user32
Files:
5 edited

Legend:

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

    r4455 r4463  
    1 /* $Id: dc.cpp,v 1.73 2000-10-08 14:09:40 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.74 2000-10-09 17:26:47 sandervl Exp $ */
    22
    33/*
     
    330330   pHps->isClient = FALSE;
    331331
     332#ifdef DEBUG
    332333   GreGetDCOrigin(pHps->hps, &point);
     334#endif
    333335
    334336   if(pHps->isClientArea)
     
    399401        rcl.yTop    += rcltemp.yBottom;
    400402        rcl.yBottom += rcltemp.yBottom;
    401    }
    402    pHps->ptlOrigin.x = rcltemp.xLeft;
    403    pHps->ptlOrigin.y = rcltemp.yBottom;
     403
     404        pHps->ptlOrigin.x = rcltemp.xLeft;
     405        pHps->ptlOrigin.y = rcltemp.yBottom;
     406   }
    404407 
    405408   dprintf2(("selectClientArea %x: (%d,%d) -> (%d,%d)", window->getWindowHandle(), rcltemp.xLeft, rcltemp.yBottom, rcl.xLeft, rcl.yBottom));
     
    616619        dprintf (("USER32: WARNING: WinQueryUpdateRect failed (error or no update rectangle)!!"));
    617620
    618         selectClientArea(wnd, pHps);
    619 
    620621        HRGN hrgnClip = GpiCreateRegion(pHps->hps, 1, &rectl);
    621622        GpiSetClipRegion(pHps->hps, hrgnClip, &hrgnOldClip);
     623
     624        selectClientArea(wnd, pHps);
    622625
    623626        //save old clip region (restored for CS_OWNDC windows in EndPaint)
     
    669672   WinShowTrackRect(wnd->getOS2WindowHandle(), FALSE);
    670673
     674#ifdef DEBUG
     675   POINTL point;
     676   GreGetDCOrigin(pHps->hps, &point);
     677   dprintf(("dc origin (%d,%d)", point.x, point.y));
     678#endif
     679
    671680   if(wnd->needsEraseBkgnd() && lComplexity != RGN_NULL) {
    672681        wnd->setEraseBkgnd(FALSE);
     
    674683   }
    675684   else lpps->fErase = TRUE;
     685
     686#ifdef DEBUG
     687   GreGetDCOrigin(pHps->hps, &point);
     688   dprintf(("dc origin (%d,%d)", point.x, point.y));
     689#endif
    676690
    677691   lpps->hdc    = (HDC)pHps->hps;
  • trunk/src/user32/pmwindow.cpp

    r4421 r4463  
    1 /* $Id: pmwindow.cpp,v 1.104 2000-10-04 19:35:31 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.105 2000-10-09 17:26:50 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    839839        rc = WinQueryUpdateRect(hwnd, &rectl);
    840840        dprintf(("OS2: WM_PAINT %x (%d,%d) (%d,%d) rc=%d", win32wnd->getWindowHandle(), rectl.xLeft, rectl.yBottom, rectl.xRight, rectl.yTop, rc));
     841
    841842        if(rc && win32wnd->IsWindowCreated() && (rectl.xLeft != rectl.xRight &&
    842843           rectl.yBottom != rectl.yTop))
     
    10091010  TRACKINFO track;
    10101011  RECTL     rcl;
    1011   PRECT     pWindowRect;
     1012  PRECT     pWindowRect, pClientRect;
    10121013  HWND      hwndTracking;
    10131014  HPS       hpsTrack;
     
    10361037   }
    10371038
    1038    rcl.xLeft   = pWindowRect->left;
    1039    rcl.yTop    = OSLibQueryScreenHeight() - pWindowRect->top;
    1040    rcl.xRight  = pWindowRect->right;
    1041    rcl.yBottom = OSLibQueryScreenHeight() - pWindowRect->bottom;
    1042    if(hwndTracking != HWND_DESKTOP) {
    1043         WinMapWindowPoints(win32wnd->getOS2WindowHandle(), HWND_DESKTOP, (PPOINTL)&rcl, 2);
    1044    }
    1045    WinCopyRect(hab, &track.rclTrack, &rcl);   /* starting point */
    1046  
    1047    WinSetRect(hab, &track.rclBoundary, 0, 0, parentWidth, parentHeight); /* bounding rectangle */
    1048  
     1039   mapWin32ToOS2Rect(parentHeight, pWindowRect, (PRECTLOS2)&track.rclTrack);
     1040   WinQueryWindowRect(hwndTracking, &track.rclBoundary);
     1041
    10491042   track.ptlMinTrackSize.x = 10;
    10501043   track.ptlMinTrackSize.y = 10;  /* set smallest allowed size of rectangle */
     
    10561049   track.fs = flags;
    10571050 
    1058    if(WinTrackRect(HWND_DESKTOP, NULL, &track) )
     1051   if(WinTrackRect(hwndTracking, NULL, &track) )
    10591052   {
    10601053        if(hpsTrack)    WinReleasePS(hpsTrack);
  • trunk/src/user32/win32wbase.cpp

    r4434 r4463  
    1 /* $Id: win32wbase.cpp,v 1.214 2000-10-05 18:37:26 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.215 2000-10-09 17:26:52 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    21782178   RECT oldClientRect = rectClient;
    21792179
    2180     if(getWindowHandle() == 0x68000004) {
    2181         rc = FALSE;
    2182     }
    21832180    if (fuFlags &
    21842181       ~(SWP_NOSIZE     | SWP_NOMOVE     | SWP_NOZORDER     |
  • trunk/src/user32/win32wmdiclient.cpp

    r3662 r4463  
    1 /* $Id: win32wmdiclient.cpp,v 1.29 2000-06-07 14:51:33 sandervl Exp $ */
     1/* $Id: win32wmdiclient.cpp,v 1.30 2000-10-09 17:26:54 sandervl Exp $ */
    22/*
    33 * Win32 MDI Client Window Class for OS/2
     
    12571257    wndClass.cbWndExtra    = 0;
    12581258    wndClass.hCursor       = 0;
    1259     wndClass.hbrBackground = (HBRUSH)LTGRAY_BRUSH;
     1259    wndClass.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
    12601260    wndClass.lpszClassName = MDICLIENTCLASSNAMEA;
    12611261
  • trunk/src/user32/window.cpp

    r4460 r4463  
    1 /* $Id: window.cpp,v 1.79 2000-10-08 20:05:29 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.80 2000-10-09 17:26:55 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    1616 *
    1717 * TODO: Decide what to do about commands for OS/2 windows (non-Win32 apps)
     18 * TODO: ShowOwnedPopups needs to be tested
     19 *       GetLastActivePopup needs to be rewritten
     20 *       ArrangeIconicWindows probably also
    1821 *
    1922 */
     
    3235#include "winicon.h"
    3336#include <win\winpos.h>
     37#include <win\win.h>
    3438#include <heapstring.h>
    3539
     
    289293    if(!window) {
    290294        dprintf(("CreateMDIWindowW, window %x not found", hwndParent));
    291         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     295        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    292296        return 0;
    293297    }
     
    319323    }
    320324    if(window->isDesktopWindow()) {
    321         dprintf(("WARNING: Trying to destroy desktop window!"));
    322         return FALSE;
     325    dprintf(("WARNING: Trying to destroy desktop window!"));
     326    return FALSE;
    323327    }
    324328    return window->DestroyWindow();
     
    366370    }
    367371    if(hwndNewParent == HWND_DESKTOP) {
    368         hwndNewParent = GetDesktopWindow();
     372    hwndNewParent = GetDesktopWindow();
    369373    }
    370374    else {
    371         parent = Win32BaseWindow::GetWindowFromHandle(hwndNewParent);
    372         if(!window) {
    373                 dprintf(("SetParent, parent %x not found", hwndNewParent));
    374                 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    375                 return 0;
    376         }
     375        parent = Win32BaseWindow::GetWindowFromHandle(hwndNewParent);
     376        if(!window) {
     377            dprintf(("SetParent, parent %x not found", hwndNewParent));
     378            SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     379            return 0;
     380    }
    377381    }
    378382    dprintf(("SetParent %x %x", hwndChild, hwndNewParent));
     
    402406
    403407    if(hwnd == HWND_DESKTOP) {
    404         window = windowDesktop;
     408    window = windowDesktop;
    405409    }
    406410    else {
    407         window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    408         if(!window) {
    409                 dprintf(("GetTopWindow, window %x not found", hwnd));
    410                 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    411                 return 0;
    412         }
     411        window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     412        if(!window) {
     413            dprintf(("GetTopWindow, window %x not found", hwnd));
     414            SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     415            return 0;
     416    }
    413417    }
    414418    hwndTop = window->GetTopWindow();
     
    482486    if( IsWindow(hwnd) )
    483487    {
    484         WINDOWPLACEMENT wndpl;
    485         UINT flags;
     488    WINDOWPLACEMENT wndpl;
     489    UINT flags;
    486490
    487491        GetWindowPlacement(hwnd, &wndpl);
    488         wndpl.length  = sizeof(wndpl);
    489         wndpl.showCmd = showCmd;
    490         wndpl.flags = 0;
    491 
    492         if(lpPoint)
    493         {
     492    wndpl.length  = sizeof(wndpl);
     493    wndpl.showCmd = showCmd;
     494    wndpl.flags = 0;
     495
     496    if(lpPoint)
     497    {
    494498            wndpl.flags |= WPF_SETMINPOSITION;
    495             wndpl.ptMinPosition = *lpPoint;
    496         }
    497         if(lpRect)
    498         {
     499        wndpl.ptMinPosition = *lpPoint;
     500    }
     501    if(lpRect)
     502    {
    499503            wndpl.rcNormalPosition = *lpRect;
    500         }
     504    }
    501505        SetWindowPlacement( hwnd, &wndpl);
    502506    }
     
    747751    //convert from parent coordinates to screen (if necessary)
    748752    if(window->getParent()) {
    749         MapWindowPoints(window->getParent()->getWindowHandle(), 0, (PPOINT)pRect, 2);
     753        MapWindowPoints(window->getParent()->getWindowHandle(), 0, (PPOINT)pRect, 2);
    750754    }
    751755
     
    807811    int rc = window->GetWindowTextW(lpsz, cch);
    808812    if(rc) {
    809         LPSTR astring = UnicodeToAsciiString(lpsz);
    810         dprintf(("GetWindowTextW %x %s", hwnd, lpsz));
    811         free(astring);
     813        LPSTR astring = UnicodeToAsciiString(lpsz);
     814        dprintf(("GetWindowTextW %x %s", hwnd, lpsz));
     815        free(astring);
    812816    }
    813817    else dprintf(("GetWindowTextW %x returned %d", hwnd, rc));
     
    848852    dprintf(("SetWindowTextW %x %s", hwnd, astring));
    849853    free(astring);
    850     if(hwnd == 0x68000008) {
    851         int i;
    852         i = 5;
    853     }
    854854#endif
    855855    return window->SetWindowTextW((LPWSTR)lpsz);
     
    913913    if(style == 0 && menu == FALSE && exStyle == 0) {
    914914        dprintf(("AdjustWindowRectEx %x %x %d (%d,%d)(%d,%d) -> no change required", style, exStyle, menu, rect->left, rect->top, rect->right, rect->bottom));
    915         return TRUE;    //nothing needs to be changed (VERIFIED in NT 4)
     915    return TRUE;    //nothing needs to be changed (VERIFIED in NT 4)
    916916    }
    917917    dprintf(("AdjustWindowRectEx %x %x %d (%d,%d)(%d,%d)\n", style, exStyle, menu, rect->left, rect->top, rect->right, rect->bottom));
    918918    /* Correct the window style */
    919919    if (!(style & (WS_POPUP | WS_CHILD)))  /* Overlapped window */
    920         style |= WS_CAPTION;
     920        style |= WS_CAPTION;
    921921
    922922    //SvL: Include WS_POPUP -> otherwise HAS_THINFRAME is true for popup windows
     
    949949    //Adjust rect inner (Win32BaseWindow::AdjustRectInner)
    950950    if(!(style & WS_ICONIC)) {
    951         if (exStyle & WS_EX_CLIENTEDGE)
    952                 InflateRect (rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
    953 
    954         if (exStyle & WS_EX_STATICEDGE)
    955                 InflateRect (rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER));
    956 
    957         //SvL: scrollbars aren't checked *UNLESS* the style includes a border (any border)
     951    if (exStyle & WS_EX_CLIENTEDGE)
     952            InflateRect (rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
     953
     954    if (exStyle & WS_EX_STATICEDGE)
     955            InflateRect (rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER));
     956
     957    //SvL: scrollbars aren't checked *UNLESS* the style includes a border (any border)
    958958        //     --> VERIFIED IN NT4, SP6 (fixes MFC apps with scrollbars + bar controls)
    959         if(style & (WS_THICKFRAME|WS_BORDER|WS_DLGFRAME)) {
    960                 if (style & WS_VSCROLL) rect->right  += GetSystemMetrics(SM_CXVSCROLL);
    961                 if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL);
    962         }
     959    if(style & (WS_THICKFRAME|WS_BORDER|WS_DLGFRAME)) {
     960            if (style & WS_VSCROLL) rect->right  += GetSystemMetrics(SM_CXVSCROLL);
     961            if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL);
     962    }
    963963    }
    964964
     
    986986    if(wndFrom != windowDesktop)
    987987    {
    988         window = wndFrom;
     988    window = wndFrom;
    989989        while(window)
    990990        {
     
    998998    if(wndTo != windowDesktop)
    999999    {
    1000         window = wndTo;
     1000    window = wndTo;
    10011001        while(window)
    10021002        {
     
    10661066
    10671067    if(!hwnd) {
    1068         return (TRUE);
     1068    return (TRUE);
    10691069    }
    10701070    wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
     
    15521552BOOL WIN32API OpenIcon(HWND hwnd)
    15531553{
    1554   dprintf(("USER32:  OpenIcon"));
     1554  dprintf(("USER32: OpenIcon %x", hwnd));
    15551555
    15561556  if(!IsIconic(hwnd))
     
    15601560}
    15611561//******************************************************************************
    1562 //******************************************************************************
    1563 BOOL WIN32API ShowOwnedPopups( HWND hwnd, BOOL  arg2)
    1564 {
    1565     dprintf(("USER32:  ShowOwnedPopups (OPEN32: todo) %x", hwnd));
    1566     return O32_ShowOwnedPopups(Win32BaseWindow::Win32ToOS2Handle(hwnd), arg2);
     1562//SDK: Windows can only be shown with ShowOwnedPopups if they were previously
     1563//     hidden with the same api
     1564//TODO: -> needs testing
     1565//******************************************************************************
     1566BOOL WIN32API ShowOwnedPopups(HWND hwndOwner, BOOL fShow)
     1567{
     1568  Win32BaseWindow *window, *owner;
     1569  HWND hwnd;
     1570
     1571  owner = Win32BaseWindow::GetWindowFromHandle(hwndOwner);
     1572  if(!owner) {
     1573        dprintf(("ShowOwnedPopups, window %x not found", hwndOwner));
     1574        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1575        return FALSE;
     1576  }
     1577  dprintf(("USER32: ShowOwnedPopups %x %d", hwnd, fShow));
     1578
     1579  hwnd = GetWindow(GetDesktopWindow(), GW_CHILD);
     1580  while(hwnd) {
     1581        window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1582        if(window) {
     1583            if(window == owner && (window->getStyle() & WS_POPUP))
     1584            {
     1585                if(fShow) {
     1586                    if(window->getFlags() & WIN_NEEDS_SHOW_OWNEDPOPUP)
     1587                    {
     1588                        /*
     1589                        * In Windows, ShowOwnedPopups(TRUE) generates WM_SHOWWINDOW messages with SW_PARENTOPENING,
     1590                        * regardless of the state of the owner
     1591                        */
     1592                        SendMessageA(hwnd, WM_SHOWWINDOW, SW_SHOW, SW_PARENTOPENING);
     1593                        window->setFlags(window->getFlags() & ~WIN_NEEDS_SHOW_OWNEDPOPUP);
     1594                    }
     1595                }
     1596                else
     1597                {
     1598                    if(IsWindowVisible(hwnd))
     1599                    {
     1600                        /*
     1601                         * In Windows, ShowOwnedPopups(FALSE) generates WM_SHOWWINDOW messages with SW_PARENTCLOSING,
     1602                         * regardless of the state of the owner
     1603                         */
     1604                        SendMessageA(hwnd, WM_SHOWWINDOW, SW_HIDE, SW_PARENTCLOSING);
     1605                        window->setFlags(window->getFlags() | WIN_NEEDS_SHOW_OWNEDPOPUP);
     1606                    }
     1607                }
     1608            }
     1609        }
     1610        else    dprintf(("WARNING: window %x is not valid", hwnd));
     1611
     1612        hwnd = GetWindow(hwnd, GW_HWNDNEXT);
     1613  }
     1614  return TRUE;
    15671615}
    15681616//******************************************************************************
     
    15861634    hwnd = Win32BaseWindow::OS2ToWin32Handle(O32_GetLastActivePopup(hWnd));
    15871635
    1588     dprintf(("GetLastActivePopup %x returned %x", hWnd, hwnd));
     1636    dprintf(("GetLastActivePopup %x returned %x NOT CORRECTLY IMPLEMENTED", hWnd, hwnd));
    15891637    return hwnd;
    15901638}
Note: See TracChangeset for help on using the changeset viewer.