Ignore:
Timestamp:
Jan 11, 2000, 6:34:44 PM (26 years ago)
Author:
cbratschi
Message:

fixed dialog rect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/window.cpp

    r2400 r2410  
    1 /* $Id: window.cpp,v 1.29 2000-01-10 23:29:15 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.30 2000-01-11 17:34:44 cbratschi Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    55 * Copyright 1999 Sander van Leeuwen
    66 * Copyright 1999 Daniela Engert (dani@ngrt.de)
     7 * Copyright 2000 Christoph Bratschi (cbratschi@datacomm.ch)
    78 *
    89 * Parts based on Wine Windows code (windows\win.c)
     
    807808        WS_EX_STATICEDGE | WS_EX_TOOLWINDOW);
    808809    if (exStyle & WS_EX_DLGMODALFRAME) style &= ~WS_THICKFRAME;
    809 #if 0  //CB: todo
    810     Win32BaseWindow::NC_AdjustRectOuter( rect, style, menu, exStyle );
    811     Win32BaseWindow::NC_AdjustRectInner( rect, style, exStyle );
    812 #endif
     810
     811    //Adjust rect outer (Win32BaseWindow::AdjustRectOuter)
     812    /* Decide if the window will be managed (see CreateWindowEx) */
     813    //if (!WindowNeedsWMBorder()) //CB: check Options.managed
     814    {
     815      if (HAS_THICKFRAME(style,exStyle))
     816        InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) );
     817      else
     818        if (HAS_DLGFRAME(style,exStyle))
     819          InflateRect(rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) );
     820        else
     821          if (HAS_THINFRAME(style))
     822            InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER));
     823
     824      if ((style & WS_CAPTION) == WS_CAPTION)
     825      {
     826        if (exStyle & WS_EX_TOOLWINDOW)
     827          rect->top -= GetSystemMetrics(SM_CYSMCAPTION);
     828        else
     829          rect->top -= GetSystemMetrics(SM_CYCAPTION);
     830      }
     831    }
     832
     833    if (menu)
     834      rect->top -= GetSystemMetrics(SM_CYMENU);
     835
     836    //Adjust rect inner (Win32BaseWindow::AdjustRectInner)
     837    if (exStyle & WS_EX_CLIENTEDGE)
     838      InflateRect (rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
     839
     840    if (exStyle & WS_EX_STATICEDGE)
     841      InflateRect (rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER));
     842
     843    if (style & WS_VSCROLL) rect->right  += GetSystemMetrics(SM_CXVSCROLL);
     844    if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL);
     845
    813846    dprintf(("AdjustWindowRectEx returned (%d,%d)(%d,%d)\n", rect->left, rect->top, rect->right, rect->bottom));
    814847    return TRUE;
Note: See TracChangeset for help on using the changeset viewer.