Ignore:
Timestamp:
Oct 17, 1999, 6:42:40 PM (26 years ago)
Author:
sandervl
Message:

Implemented SetWindowPlacement + bugfixes

File:
1 edited

Legend:

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

    r1336 r1337  
    1 /* $Id: win32wbase.cpp,v 1.49 1999-10-17 15:46:09 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.50 1999-10-17 16:42:39 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    726726    if (isSubclassedOS2Wnd) OSLibWinSubclassWindow(OS2Hwnd,pOldWndProc);
    727727
     728    fIsDestroyed = TRUE;
    728729    //According to the SDK, WM_PARENTNOTIFY messages are sent to the parent (this window)
    729730    //before any window destruction has begun
     
    739740    if (hwndVertScroll && OSLibWinQueryWindow(hwndVertScroll,QWOS_PARENT) == OSLIB_HWND_OBJECT) OSLibWinDestroyWindow(hwndVertScroll);
    740741
    741     fIsDestroyed = TRUE;
    742742    if(getFirstChild() == NULL) {
    743743        delete this;
     
    846846 WORD fwSizeType = 0;
    847847
     848    dwStyle &= ~(WS_MINIMIZE|WS_MAXIMIZE);
    848849    if(fMinimize) {
    849850            fwSizeType = SIZE_MINIMIZED;
     851            dwStyle |= WS_MINIMIZE;
    850852    }
    851853    else
    852854    if(fMaximize) {
    853855            fwSizeType = SIZE_MAXIMIZED;
     856            dwStyle |= WS_MAXIMIZE;
    854857    }
    855858    else    fwSizeType = SIZE_RESTORED;
     
    10051008                                                    // bit 24, 1=extended key
    10061009                                                    // bit 25-28, reserved
    1007                                             // bit 29, key is released, always 1 for WM_SYSKEYUP ?? <- conflict according to the MS docs
     1010                                                    // bit 29, key is released, always 1 for WM_SYSKEYUP ?? <- conflict according to the MS docs
    10081011    if (keyWasPressed)
    10091012        lParam |= 1 << 30;                          // bit 30, previous state, 1 means key was pressed
     
    18841887    {
    18851888        /* should happen only in CreateWindowEx() */
    1886         int wParam = SIZE_RESTORED;
    1887 
    1888             flags &= ~WIN_NEED_SIZE;
    1889             if (dwStyle & WS_MAXIMIZE)
    1890                 wParam = SIZE_MAXIMIZED;
    1891             else
    1892             if (dwStyle & WS_MINIMIZE)
    1893                 wParam = SIZE_MINIMIZED;
    1894        
     1889        int wParam = SIZE_RESTORED;
     1890
     1891        flags &= ~WIN_NEED_SIZE;
     1892        if (dwStyle & WS_MAXIMIZE)
     1893            wParam = SIZE_MAXIMIZED;
     1894        else
     1895        if (dwStyle & WS_MINIMIZE)
     1896            wParam = SIZE_MINIMIZED;
     1897
    18951898        SendMessageA(WM_SIZE, wParam,
    18961899                     MAKELONG(rectClient.right-rectClient.left,
     
    20452048}
    20462049//******************************************************************************
     2050//TODO: WPF_RESTOREMAXIMIZED
     2051//******************************************************************************
     2052BOOL Win32BaseWindow::SetWindowPlacement(WINDOWPLACEMENT *winpos)
     2053{
     2054   if(isFrameWindow())
     2055   {
     2056      // Set the minimized position
     2057      if (winpos->flags & WPF_SETMINPOSITION)
     2058      {
     2059         OSLibSetWindowMinPos(OS2HwndFrame, winpos->ptMinPosition.x, winpos->ptMinPosition.y);
     2060      }
     2061
     2062      //TODO: Max position
     2063
     2064      // Set the new restore position.
     2065      OSLibSetWindowRestoreRect(OS2HwndFrame, &winpos->rcNormalPosition);
     2066   }
     2067
     2068   return ShowWindow(winpos->showCmd);
     2069}
     2070//******************************************************************************
    20472071//Also destroys all the child windows (destroy parent, destroy children)
    20482072//******************************************************************************
     
    22472271        }
    22482272        break;
    2249        
     2273
    22502274    case GW_HWNDLAST:
    22512275        if(getParent())
     
    22612285        hwndRelated = window->getWindowHandle();
    22622286        break;
    2263        
     2287
    22642288    case GW_HWNDNEXT:
    22652289        window = (Win32BaseWindow *)getNextChild();
     
    22682292        }
    22692293        break;
    2270        
     2294
    22712295    case GW_HWNDPREV:
    22722296        if(!getParent())
     
    22902314        }
    22912315        break;
    2292                
     2316
    22932317    case GW_OWNER:
    22942318        if(getOwner()) {
     
    24462470                ss.styleOld = dwExStyle;
    24472471                ss.styleNew = value;
    2448         dprintf(("SetWindowLong GWL_EXSTYLE %x new style %x", getWindowHandle(), value));
     2472                dprintf(("SetWindowLong GWL_EXSTYLE %x new style %x", getWindowHandle(), value));
    24492473                SendMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss);
    24502474                setExStyle(ss.styleNew);
     
    24582482                ss.styleOld = dwStyle;
    24592483                ss.styleNew = value;
    2460         dprintf(("SetWindowLong GWL_STYLE %x new style %x", getWindowHandle(), value));
     2484                dprintf(("SetWindowLong GWL_STYLE %x new style %x", getWindowHandle(), value));
    24612485                SendMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);
    24622486                setStyle(ss.styleNew);
    2463                 OSLibSetWindowStyle(OS2HwndFrame, dwStyle);
     2487                if(!IsWindowDestroyed())
     2488                    OSLibSetWindowStyle(OS2HwndFrame, dwStyle);
    24642489                SendMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
    24652490                return ss.styleOld;
Note: See TracChangeset for help on using the changeset viewer.