Ignore:
Timestamp:
May 22, 2000, 7:21:11 PM (25 years ago)
Author:
cbratschi
Message:

merged controls with Corel WINE 20000513, maximize/minimize fix

File:
1 edited

Legend:

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

    r3581 r3584  
    1 /* $Id: win32wbase.cpp,v 1.191 2000-05-20 14:57:24 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.192 2000-05-22 17:21:11 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    208208    }
    209209    if(propertyList) {
    210         removeWindowProps();
     210        removeWindowProps();
    211211    }
    212212}
     
    503503#if 0
    504504  if(((dwStyle & (WS_CAPTION|WS_POPUP)) == WS_CAPTION) && (getParent() == NULL || getParent() == windowDesktop)) {
    505         fTaskList = TRUE;
     505        fTaskList = TRUE;
    506506  }
    507507#else
     
    867867    //SvL: Don't send WM_(NC)ACTIVATE messages when the window is being destroyed
    868868    if(fDestroyWindowCalled) {
    869         return 0;
     869        return 0;
    870870    }
    871871
     
    916916    //SvL: Don't send WM_(NC)ACTIVATE messages when the window is being destroyed
    917917    if(fDestroyWindowCalled) {
    918         return 0;
     918        return 0;
    919919    }
    920920
     
    927927    //SvL: Don't send WM_(NC)ACTIVATE messages when the window is being destroyed
    928928    if(fDestroyWindowCalled) {
    929         return 0;
     929        return 0;
    930930    }
    931931    return  SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
     
    10561056    RECT client = rectClient;
    10571057
    1058         if ((rect.left >= client.left) && (rect.left < client.right) &&
     1058        if ((rect.left >= client.left) && (rect.left < client.right) &&
    10591059           (rect.right >= client.left) && (rect.right < client.right) &&
    10601060           (rect.top  >= client.top) && (rect.top < client.bottom) &&
    10611061           (rect.bottom >= client.top) && (rect.bottom < client.bottom))
    10621062        {
    1063                 return 0;
    1064         }
    1065 
    1066         dprintf(("MsgNCPaint (%d,%d)(%d,%d)", rect.left, rect.top, rect.right, rect.bottom));
    1067         hrgn = CreateRectRgnIndirect(&rect);
    1068         if (!hrgn) return 0;
    1069 
    1070         rc = SendInternalMessageA(WM_NCPAINT,hrgn,0);
    1071 
    1072         DeleteObject(hrgn);
    1073 
    1074         return rc;
    1075   }
    1076   else  return 0;
     1063                return 0;
     1064        }
     1065
     1066        dprintf(("MsgNCPaint (%d,%d)(%d,%d)", rect.left, rect.top, rect.right, rect.bottom));
     1067        hrgn = CreateRectRgnIndirect(&rect);
     1068        if (!hrgn) return 0;
     1069
     1070        rc = SendInternalMessageA(WM_NCPAINT,hrgn,0);
     1071
     1072        DeleteObject(hrgn);
     1073
     1074        return rc;
     1075  }
     1076  else  return 0;
    10771077}
    10781078//******************************************************************************
     
    13291329        if ((dwStyle & WS_CAPTION) == WS_CAPTION)
    13301330        {
    1331 //          HandleNCPaint((HRGN)1);
     1331          HandleNCPaint((HRGN)1);
    13321332          OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
    13331333        }
     
    16381638        if((HIWORD(lParam) & KEYDATA_ALT) && wParam)
    16391639        {
    1640                 if (wParam == VK_TAB || wParam == VK_ESCAPE) 
    1641                         break;
     1640                if (wParam == VK_TAB || wParam == VK_ESCAPE)
     1641                        break;
    16421642                if (wParam == VK_SPACE && (getStyle() & WS_CHILD)) {
    1643                         getParent()->SendMessageA(Msg, wParam, lParam );
    1644                 }
     1643                        getParent()->SendMessageA(Msg, wParam, lParam );
     1644                }
    16451645                else    SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam );
    16461646        }
    16471647        else /* check for Ctrl-Esc */
    1648                 if (wParam != VK_ESCAPE) MessageBeep(0);
    1649                         break;
     1648                if (wParam != VK_ESCAPE) MessageBeep(0);
     1649                        break;
    16501650    }
    16511651
     
    20372037 ULONG showstate = 0;
    20382038 HWND  hWinAfter;
    2039  BOOL  rc;
     2039 BOOL  rc,wasVisible,showFlag;
    20402040
    20412041    dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow));
     
    20482048        break;
    20492049    case SW_HIDE:
     2050        if (!wasVisible) return wasVisible;
     2051         if(GetCapture() == getWindowHandle() || IsChild(GetCapture()))
     2052           ReleaseCapture();
     2053
    20502054        showstate = SWPOS_HIDE;
    20512055        break;
     
    20772081
    20782082    /* We can't activate a child window (WINE) */
    2079     if(getStyle() & WS_CHILD)
     2083    if((getStyle() & WS_CHILD) && !(getExStyle() & WS_EX_MDICHILD))
    20802084        showstate &= ~SWPOS_ACTIVATE;
    20812085
     
    20852089    else    setStyle(getStyle() & ~WS_VISIBLE);
    20862090
     2091    showFlag = (nCmdShow != SW_HIDE);
     2092
    20872093    rc = OSLibWinShowWindow(OS2HwndFrame, showstate);
    20882094    OSLibWinShowWindow(OS2Hwnd, showstate);
    20892095
    2090     SendInternalMessageA(WM_SHOWWINDOW, (showstate & SWPOS_SHOW) ? 1 : 0, 0);
     2096    //CB: PMFrame: WM_MINMAXFRAME SWP_* handling isn't always successful!
     2097    if ((showstate & SWPOS_MAXIMIZE) == SWPOS_MAXIMIZE)
     2098      setStyle((getStyle() & ~WS_MINIMIZE) | WS_MAXIMIZE);
     2099    else if ((showstate & SWPOS_MINIMIZE) == SWPOS_MINIMIZE)
     2100      setStyle((getStyle() & ~WS_MAXIMIZE) | WS_MINIMIZE);
     2101    else if ((showstate & SWPOS_RESTORE) == SWPOS_RESTORE)
     2102      setStyle(getStyle() & ~(WS_MINIMIZE | WS_MAXIMIZE));
    20912103
    20922104    if (flags & WIN_NEED_SIZE)
     
    21402152    else
    21412153    {
    2142         if (!(fuFlags & SWP_SHOWWINDOW))
    2143               fuFlags |= SWP_NOREDRAW;
    2144         fuFlags &= ~SWP_HIDEWINDOW;
    2145     }
    2146 
    2147     if(cx < 0) cx = 0; 
     2154        if (!(fuFlags & SWP_SHOWWINDOW))
     2155              fuFlags |= SWP_NOREDRAW;
     2156        fuFlags &= ~SWP_HIDEWINDOW;
     2157    }
     2158
     2159    if(cx < 0) cx = 0;
    21482160    if(cy < 0) cy = 0;
    21492161
     
    21592171        fuFlags |= SWP_NOACTIVATE;   /* Already active */
    21602172    }
    2161     else 
     2173    else
    21622174    if((getStyle() & (WS_POPUP | WS_CHILD)) != WS_CHILD )
    21632175    {
     
    21652177        {
    21662178            fuFlags &= ~SWP_NOZORDER;
    2167             hwndInsertAfter = HWND_TOP;           
     2179            hwndInsertAfter = HWND_TOP;
    21682180        }
    21692181    }
     
    22192231
    22202232    if(fuFlags & SWP_SHOWWINDOW && !IsWindowVisible()) {
    2221         setStyle(getStyle() | WS_VISIBLE);
    2222         //SvL: TODO: Send WM_SHOWWINDOW??
    2223         OSLibWinShowWindow(OS2Hwnd, SWPOS_SHOW);
     2233        setStyle(getStyle() | WS_VISIBLE);
     2234        //SvL: TODO: Send WM_SHOWWINDOW??
     2235        OSLibWinShowWindow(OS2Hwnd, SWPOS_SHOW);
    22242236    }
    22252237    else
    22262238    if(fuFlags & SWP_HIDEWINDOW && IsWindowVisible()) {
    2227         setStyle(getStyle() & ~WS_VISIBLE);
    2228         //SvL: TODO: Send WM_SHOWWINDOW??
    2229         OSLibWinShowWindow(OS2Hwnd, SWPOS_HIDE);
     2239        setStyle(getStyle() & ~WS_VISIBLE);
     2240        //SvL: TODO: Send WM_SHOWWINDOW??
     2241        OSLibWinShowWindow(OS2Hwnd, SWPOS_HIDE);
    22302242    }
    22312243    rc = OSLibWinSetMultWindowPos(&swp, 1);
     
    22332245#ifdef DEBUG
    22342246    if(fShow) {
    2235         dprintf(("Frame style 0x%08x, client style 0x%08x", OSLibQueryWindowStyle(OS2HwndFrame), OSLibQueryWindowStyle(OS2Hwnd)));
     2247        dprintf(("Frame style 0x%08x, client style 0x%08x", OSLibQueryWindowStyle(OS2HwndFrame), OSLibQueryWindowStyle(OS2Hwnd)));
    22362248    }
    22372249#endif
     
    23062318    {
    23072319        SetWindowPos(0, 0, 0, 0, 0, SWP_HIDEWINDOW |
    2308                      SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE);
     2320                     SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE);
    23092321        if(!::IsWindow(hwnd))
    23102322        {
    2311                 return TRUE;
     2323                return TRUE;
    23122324        }
    23132325    }
     
    26742686  rc = (getStyle() & WS_DISABLED) != 0;
    26752687  if(rc && !fEnable) {
    2676         SendMessageA(WM_CANCELMODE, 0, 0);
     2688        SendMessageA(WM_CANCELMODE, 0, 0);
    26772689  }
    26782690  OSLibWinEnableWindow(OS2HwndFrame, fEnable);
    26792691  if(fEnable == FALSE) {
    2680         //SvL: No need to clear focus as PM already does this
    2681         if(getWindowHandle() == GetCapture()) {
    2682                 ReleaseCapture();  /* A disabled window can't capture the mouse */
    2683                 dprintf(("Released capture for window %x that is being disabled", getWindowHandle()));
    2684         }
     2692        //SvL: No need to clear focus as PM already does this
     2693        if(getWindowHandle() == GetCapture()) {
     2694                ReleaseCapture();  /* A disabled window can't capture the mouse */
     2695                dprintf(("Released capture for window %x that is being disabled", getWindowHandle()));
     2696        }
    26852697  }
    26862698  return rc;
     
    29842996}
    29852997//******************************************************************************
    2986 //Note: Should return NULL if window is frame window! (IsOS2FrameWindowHandle depends on this 
     2998//Note: Should return NULL if window is frame window! (IsOS2FrameWindowHandle depends on this
    29872999//      behaviour)
    29883000//******************************************************************************
     
    30603072
    30613073    if(window->getOS2FrameWindowHandle() == hwndOS2) {
    3062         return TRUE;
     3074        return TRUE;
    30633075    }
    30643076    return FALSE;
Note: See TracChangeset for help on using the changeset viewer.