Changeset 1186 for trunk/src


Ignore:
Timestamp:
Oct 8, 1999, 4:57:18 PM (26 years ago)
Author:
sandervl
Message:

WS_DISABLED fix + removed frame + poschanged bugfixes

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r1184 r1186  
    1 /* $Id: oslibwin.cpp,v 1.15 1999-10-08 12:10:27 cbratschi Exp $ */
     1/* $Id: oslibwin.cpp,v 1.16 1999-10-08 14:57:17 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    643643{
    644644   return WinCalcFrameRect(hwndFrame, (PRECTL)pRect, fClient);
     645}
     646//******************************************************************************
     647//******************************************************************************
     648BOOL OSLibGetMinMaxInfo(HWND hwndFrame, MINMAXINFO *pMinMax)
     649{
     650 TRACKINFO tinfo;
     651
     652   memset(&tinfo, 0, sizeof(TRACKINFO));
     653   WinSendMsg(hwndFrame, WM_QUERYTRACKINFO, (MPARAM)0,(MPARAM)&tinfo);
     654   
     655   pMinMax->ptMinTrackSize.x = tinfo.ptlMinTrackSize.x;
     656   pMinMax->ptMinTrackSize.y = tinfo.ptlMinTrackSize.y;
     657   pMinMax->ptMaxTrackSize.x = tinfo.ptlMaxTrackSize.x;
     658   pMinMax->ptMaxTrackSize.y = tinfo.ptlMaxTrackSize.y;
     659   return TRUE;
    645660}
    646661//******************************************************************************
  • trunk/src/user32/oslibwin.h

    r1176 r1186  
    1 /* $Id: oslibwin.h,v 1.10 1999-10-07 23:21:30 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.11 1999-10-08 14:57:17 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    211211BOOL  OSLibWinQueryWindowRect(HWND hwnd, PRECT pRect, int RelativeTo = RELATIVE_TO_WINDOW);
    212212BOOL  OSLibWinCalcFrameRect(HWND hwndFrame, RECTLOS2 *pRect, BOOL fClient);
     213BOOL  OSLibGetMinMaxInfo(HWND hwndFrame, MINMAXINFO *pMinMax);
    213214
    214215#define QWOS_NEXT         0
  • trunk/src/user32/pmwindow.cpp

    r1176 r1186  
    1 /* $Id: pmwindow.cpp,v 1.21 1999-10-07 23:21:30 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.22 1999-10-08 14:57:17 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    298298        classStyle = win32wnd->getClass()->getStyle();
    299299
     300#if 0
     301        if ((yDelta != 0) && ((classStyle & CS_VREDRAW_W) ||
     302           ((classStyle & CS_HREDRAW_W) && (pswp->cx != pswpo->cx))))
     303#else
    300304        if (yDelta != 0 || xDelta != 0)
     305#endif
    301306        {
    302307            HENUM henum = WinBeginEnumWindows(pswp->hwnd);
     
    321326#endif
    322327
    323                 swp[i].cy += yDelta;
    324                 swp[i].fl  = SWP_SIZE;
     328                swp[i].y += yDelta;
    325329
    326330                if (i == 9)
  • trunk/src/user32/win32wbase.cpp

    r1184 r1186  
    1 /* $Id: win32wbase.cpp,v 1.28 1999-10-08 12:10:27 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.29 1999-10-08 14:57:18 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    339339    if (HOOK_IsHooked( WH_CBT ))
    340340    {
    341     CBT_CREATEWNDA cbtc;
     341        CBT_CREATEWNDA cbtc;
    342342        LRESULT ret;
    343343
    344     cbtc.lpcs = cs;
    345     cbtc.hwndInsertAfter = hwndLinkAfter;
     344        cbtc.lpcs = cs;
     345        cbtc.hwndInsertAfter = hwndLinkAfter;
    346346        ret = unicode ? HOOK_CallHooksW(WH_CBT, HCBT_CREATEWND, Win32Hwnd, (LPARAM)&cbtc)
    347347                      : HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND, Win32Hwnd, (LPARAM)&cbtc);
     
    543543
    544544  fCreated = TRUE; //Allow WM_SIZE messages now
    545   if(SendInternalMessage(WM_NCCREATE, 0, (LPARAM)cs) )
     545  if(SendMessageA(WM_NCCREATE, 0, (LPARAM)cs) )
    546546  {
    547547        //doesn't work right, messes up client rectangle
     
    551551        OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
    552552        dprintf(("Sending WM_CREATE"));
    553         if( (SendInternalMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 )
     553        if( (SendMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 )
    554554        {
    555555            if(!(flags & WIN_NEED_SIZE)) {
     
    598598    if( dwStyle & WS_MINIMIZE )
    599599    {
    600         if( !SendInternalMessageA(WM_QUERYOPEN, 0, 0L ) )
     600        if( !SendMessageA(WM_QUERYOPEN, 0, 0L ) )
    601601        return (SWP_NOSIZE | SWP_NOMOVE);
    602602        swpFlags |= SWP_NOCOPYBITS;
     
    736736//    }
    737737
    738     SendInternalMessageA(WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
     738    SendMessageA(WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
    739739
    740740      /* Some sanity checks */
     
    779779        params.lppos = &winposCopy;
    780780   }
    781    result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect,
    782                                  (LPARAM)&params );
     781   result = SendMessageA(WM_NCCALCSIZE, calcValidRect,
     782                         (LPARAM)&params );
    783783   *newClientRect = params.rgrc[0];
    784784   return result;
     
    821821ULONG Win32BaseWindow::MsgEnable(BOOL fEnable)
    822822{
     823    if(fEnable) {
     824         dwStyle &= ~WS_DISABLED;
     825    }
     826    else dwStyle |= WS_DISABLED;
     827
    823828    return SendInternalMessageA(WM_ENABLE, fEnable, 0);
    824829}
     
    14471452    //SvL: Set background color to default button color (not window (white))
    14481453    case WM_CTLCOLORBTN:
    1449          SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE));
    1450          SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    1451          return GetSysColorBrush(COLOR_BTNFACE);
     1454        SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE));
     1455        SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
     1456        return GetSysColorBrush(COLOR_BTNFACE);
    14521457
    14531458    //SvL: Set background color to default dialog color if window is dialog
    14541459    case WM_CTLCOLORDLG:
    14551460    case WM_CTLCOLORSTATIC:
    1456      if(IsDialog()) {
     1461        if(IsDialog()) {
    14571462            SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE));
    14581463            SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    14591464            return GetSysColorBrush(COLOR_BTNFACE);
    1460      }
    1461      //no break
     1465        }
     1466        //no break
    14621467
    14631468    case WM_CTLCOLORMSGBOX:
     
    15211526            else if (dwStyle & WS_MINIMIZE) wp = SIZE_MINIMIZED;
    15221527
    1523            SendMessageA(WM_SIZE, wp, MAKELONG(rectClient.right  - rectClient.left,
    1524                                               rectClient.bottom - rectClient.top));
     1528            SendMessageA(WM_SIZE, wp, MAKELONG(rectClient.right  - rectClient.left,
     1529                                               rectClient.bottom - rectClient.top));
    15251530        }
    15261531        return 0;
     
    18281833                if(parentwindow) {
    18291834                        if(Msg == WM_CREATE || Msg == WM_DESTROY) {
    1830                                 parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
     1835                                parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
    18311836                        }
    1832                         else    parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
     1837                        else    parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
    18331838                }
    18341839        }
     
    18861891    dprintf(("Win32BaseWindow::SetIcon %x", hIcon));
    18871892    if(OSLibWinSetIcon(OS2HwndFrame, hIcon) == TRUE) {
    1888     SendInternalMessageA(WM_SETICON, hIcon, 0);
    1889     return TRUE;
     1893        SendMessageA(WM_SETICON, hIcon, 0);
     1894        return TRUE;
    18901895    }
    18911896    return FALSE;
     
    19801985           hParent = getParent()->getOS2WindowHandle();
    19811986           OSLibWinQueryWindowPos(OS2Hwnd, &swpOld);
    1982        } else
     1987       }
     1988       else
    19831989           OSLibWinQueryWindowPos(OS2HwndFrame, &swpOld);
    19841990   }
     
    20042010      if (swp.cy < minTrack.y) swp.cy = minTrack.y;
    20052011
    2006       RECTLOS2 rectFrame;
    2007 
    2008       //Calculate correct frame rectangle from client rectangle
    2009       //NOTE: xLeft & yBottom can become too big
    2010       //Some programs use GetSystemMetrics 32/33 to determine offsets
    2011       rectFrame.xLeft   = swp.x;
    2012       rectFrame.yBottom = swp.y;
    2013       rectFrame.xRight  = swp.x + swp.cx;
    2014       rectFrame.yTop    = swp.y + swp.cy;
    2015 
    2016       OSLibWinCalcFrameRect(OS2HwndFrame, &rectFrame, FALSE);     
    2017       swp.x  = rectFrame.xLeft;
    2018       swp.y  = rectFrame.yBottom;
    2019       swp.cx = rectFrame.xRight - rectFrame.xLeft;
    2020       swp.cy = rectFrame.yTop - rectFrame.yBottom;
    2021       if(swp.x < 0) {
    2022         swp.cx += -swp.x;
    2023         swp.x   = 0;
    2024       }
    2025       if(swp.y + swp.cy > ScreenHeight) {
    2026         swp.y = ScreenHeight - swp.cy;
    2027       }
    20282012      swp.hwnd = OS2HwndFrame;
    2029    } else
     2013   }
     2014   else
    20302015      swp.hwnd = OS2Hwnd;
     2016
    20312017   dprintf (("WinSetWindowPos %x %x (%d,%d)(%d,%d) %x", swp.hwnd, swp.hwndInsertBehind, swp.x, swp.y, swp.cx, swp.cy, swp.fl));
    20322018
     
    20352021   if (rc == FALSE)
    20362022   {
    2037 //      SET_ERROR_LAST();
    20382023   }
    20392024   else
     
    21212106        if (isIcon)
    21222107        {
    2123             SendInternalMessageA(WM_ICONERASEBKGND, (WPARAM)hdc, 0);
    2124             SendInternalMessageA(WM_PAINTICON, 0, 0);
     2108            SendMessageA(WM_ICONERASEBKGND, (WPARAM)hdc, 0);
     2109            SendMessageA(WM_PAINTICON, 0, 0);
    21252110        } else
    21262111        {
    2127             SendInternalMessageA(WM_ERASEBKGND, (WPARAM)hdc, 0);
    2128             SendInternalMessageA(WM_PAINT, 0, 0);
     2112            SendMessageA(WM_ERASEBKGND, (WPARAM)hdc, 0);
     2113            SendMessageA(WM_PAINT, 0, 0);
    21292114        }
    21302115        O32_ReleaseDC(OS2Hwnd, hdc);
     
    23632348        return FALSE;
    23642349
    2365     if(windowNameA)     free(windowNameA);
    2366     if(windowNameW)     free(windowNameW);
     2350    if(windowNameA) free(windowNameA);
     2351    if(windowNameW) free(windowNameW);
    23672352
    23682353    windowNameA = (LPSTR)_smalloc(strlen(lpsz)+1);
     
    23842369        return FALSE;
    23852370
    2386     if(windowNameA)     free(windowNameA);
    2387     if(windowNameW)     free(windowNameW);
     2371    if(windowNameA) free(windowNameA);
     2372    if(windowNameW) free(windowNameW);
    23882373
    23892374    windowNameW = (LPWSTR)_smalloc((lstrlenW((LPWSTR)lpsz)+1)*sizeof(WCHAR));
     
    24062391   switch(index) {
    24072392        case GWL_EXSTYLE:
    2408                 {
    2409                   STYLESTRUCT ss;
    2410 
    2411                   ss.styleOld = dwExStyle;
    2412                   ss.styleNew = value;
    2413                   SendInternalMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss);
    2414                   oldval = dwExStyle;
    2415                   setExStyle(value);
    2416                   SendInternalMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);
    2417                   return oldval;
    2418                 }
     2393        {
     2394           STYLESTRUCT ss;
     2395
     2396                ss.styleOld = dwExStyle;
     2397                ss.styleNew = value;
     2398                SendMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss);
     2399                oldval = dwExStyle;
     2400                setExStyle(value);
     2401                SendMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);
     2402                return oldval;
     2403        }
    24192404        case GWL_STYLE:
    2420                 {
    2421                   STYLESTRUCT ss;
    2422 
    2423                   ss.styleOld = dwStyle;
    2424                   ss.styleNew = value;
    2425                   SendInternalMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);
    2426                   oldval = dwStyle;
    2427                   setStyle(value);
    2428                   OSLibSetWindowStyle(OS2HwndFrame, dwStyle);
    2429                   SendInternalMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
    2430                   return oldval;
    2431                 }
     2405        {
     2406           STYLESTRUCT ss;
     2407
     2408                ss.styleOld = dwStyle;
     2409                ss.styleNew = value;
     2410                SendMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);
     2411                oldval = dwStyle;
     2412                setStyle(value);
     2413                OSLibSetWindowStyle(OS2HwndFrame, dwStyle);
     2414                SendMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
     2415                return oldval;
     2416        }
    24322417        case GWL_WNDPROC:
    24332418                oldval = (LONG)getWindowProc();
Note: See TracChangeset for help on using the changeset viewer.