Ignore:
Timestamp:
Nov 1, 1999, 8:11:46 PM (26 years ago)
Author:
sandervl
Message:

Activate + group box fixes + cleanup changes

File:
1 edited

Legend:

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

    r1526 r1540  
    1 /* $Id: win32wbase.cpp,v 1.70 1999-10-31 01:14:42 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.71 1999-11-01 19:11:43 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    3939#include "win32wdesktop.h"
    4040#include "pmwindow.h"
     41#include "controls.h"
    4142#include <wprocess.h>
    4243
     
    7576
    7677void PrintWindowStyle(DWORD dwStyle, DWORD dwExStyle);
     78
     79static fDestroyAll = FALSE;
    7780
    7881//******************************************************************************
     
    199202    OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, 0);
    200203
    201     if(getParent() && getParent()->getFirstChild() == this && getNextChild() == NULL)
     204    if(!fDestroyAll && getParent() && getParent()->getFirstChild() == this && getNextChild() == NULL)
    202205    {
    203206        //if we're the last child that's being destroyed and our
     
    210213        }
    211214    }
     215    else
     216    if(fDestroyAll) {
     217        dprintf(("Destroying window %x %s", getWindowHandle(), windowNameA));
     218        setParent(NULL);  //or else we'll crash in the dtor of the ChildWindow class
     219    }
     220
    212221    if (isOwnDC())
    213222        releaseOwnDC (ownDC);
     
    234243        horzScrollInfo = NULL;
    235244    }
     245}
     246//******************************************************************************
     247//******************************************************************************
     248void Win32BaseWindow::DestroyAll()
     249{
     250    fDestroyAll = TRUE;
     251    GenericObject::DestroyAll(windows);
    236252}
    237253//******************************************************************************
     
    414430  dwExStyle = cs->dwExStyle;
    415431
    416 #if 1
    417   //SvL: Messes up Z-order of dialog controls
    418432  hwndLinkAfter = HWND_TOP;
    419 #else
    420   hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
    421                   ? HWND_BOTTOM : HWND_TOP;
    422 #endif
     433  if(WIDGETS_IsControl(this, BUTTON_CONTROL) && ((dwStyle & 0x0f) == BS_GROUPBOX))
     434  {
     435        hwndLinkAfter = HWND_BOTTOM;
     436        dwStyle |= WS_CLIPSIBLINGS;
     437  }
     438  else
     439  if(WIDGETS_IsControl(this, STATIC_CONTROL) && !(dwStyle & WS_GROUP)) {
     440        dwStyle |= WS_CLIPSIBLINGS;
     441  }
    423442
    424443  /* Increment class window counter */
     
    524543        return FALSE;
    525544  }
     545
    526546  SetLastError(0);
    527547  return TRUE;
     
    622642
    623643  if(getParent()) {
    624         SetWindowPos(getParent()->getWindowHandle(), rectClient.left, rectClient.top,
     644        SetWindowPos(hwndLinkAfter, rectClient.left, rectClient.top,
    625645                     rectClient.right-rectClient.left,
    626646                     rectClient.bottom-rectClient.top,
    627                      SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW);
     647                     SWP_NOACTIVATE | SWP_NOREDRAW);
    628648  }
    629649  else {
    630         SetWindowPos(HWND_TOP, rectClient.left, rectClient.top,
     650        SetWindowPos(hwndLinkAfter, rectClient.left, rectClient.top,
    631651                     rectClient.right-rectClient.left,
    632652                     rectClient.bottom-rectClient.top,
     
    810830{
    811831  lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, MAKELONG((USHORT)x, (USHORT)y));
     832  dprintf(("MsgHitTest returned %x", lastHitTestVal));
    812833  return 1; //TODO: May need to change this
    813834}
     
    10951116                   && hwndTop != GetForegroundWindow() )
    10961117                {
    1097                       SetActiveWindow();
     1118                      ::SetActiveWindow(hwndTop);
    10981119                }
    10991120        }
     
    14211442    case WM_MOUSEACTIVATE:
    14221443    {
    1423         DWORD dwStyle = GetWindowLongA(GWL_STYLE);
    1424         DWORD dwExStyle = GetWindowLongA(GWL_EXSTYLE);
    14251444        dprintf(("DefWndProc: WM_MOUSEACTIVATE for %x Msg %s", Win32Hwnd, GetMsgText(HIWORD(lParam))));
    1426         if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
     1445        if(getStyle() & WS_CHILD && !(getExStyle() & WS_EX_NOPARENTNOTIFY) )
    14271446        {
    14281447            if(getParent()) {
     
    14351454    case WM_SETCURSOR:
    14361455    {
    1437         DWORD dwStyle = GetWindowLongA(GWL_STYLE);
    1438         DWORD dwExStyle = GetWindowLongA(GWL_EXSTYLE);
    14391456        dprintf(("DefWndProc: WM_SETCURSOR for %x Msg %s", Win32Hwnd, GetMsgText(HIWORD(lParam))));
    1440         if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
     1457        if(getStyle() & WS_CHILD && !(getExStyle() & WS_EX_NOPARENTNOTIFY) )
    14411458        {
    14421459            if(getParent()) {
     
    19051922{
    19061923 ULONG showstate = 0;
     1924 HWND hWinAfter;
    19071925
    19081926    dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow));
     
    19721990    }
    19731991
     1992    /* We can't activate a child window (WINE) */
     1993    if(getStyle() & WS_CHILD)
     1994        showstate &= ~SWPOS_ACTIVATE;
     1995
    19741996    if(showstate & SWPOS_SHOW) {
    19751997            setStyle(getStyle() | WS_VISIBLE);
Note: See TracChangeset for help on using the changeset viewer.