Changeset 2410 for trunk/src


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

fixed dialog rect

Location:
trunk/src/user32/new
Files:
6 edited

Legend:

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

    r2406 r2410  
    1 /* $Id: menu.cpp,v 1.6 2000-01-11 13:06:24 sandervl Exp $*/
     1/* $Id: menu.cpp,v 1.7 2000-01-11 17:34:42 cbratschi Exp $*/
    22/*
    33 * Menu functions
     
    2020 * This is probably not the meaning this style has in MS-Windows.
    2121 */
    22 
    23 /*
    24  CB: not yet implemented:
    25  - Win32BaseWindow handling
    26  - message functions
    27 */
    2822
    2923#include <assert.h>
     
    10851079            FillRect( hdc, &rect, GetSysColorBrush(COLOR_HIGHLIGHT) );
    10861080    else {
    1087         //SvL: TODO: Bug in GDI32; draws black rectangle instead of menu color
     1081        //SvL: TODO: Bug in GDI32; draws black rectangle instead of menu color
    10881082        ///          for everything except the 1st menu item
    1089         RECT dummy = rect;
    1090         dummy.bottom = dummy.top+1;
    1091         dummy.right  = dummy.right+1;
    1092         FillRect( hdc, &dummy, GetSysColorBrush(COLOR_HIGHLIGHT) );
    1093         FillRect( hdc, &rect, GetSysColorBrush(COLOR_MENU) );
     1083        RECT dummy = rect;
     1084        dummy.bottom = dummy.top+1;
     1085        dummy.right  = dummy.right+1;
     1086        FillRect( hdc, &dummy, GetSysColorBrush(COLOR_HIGHLIGHT) );
     1087        FillRect( hdc, &rect, GetSysColorBrush(COLOR_MENU) );
    10941088    }
    10951089
     
    17891783    /* Find where to insert new item */
    17901784
    1791     if ((pos==(UINT)-1) || ((flags & MF_BYPOSITION) && (pos == menu->nItems))) 
     1785    if ((pos==(UINT)-1) || ((flags & MF_BYPOSITION) && (pos == menu->nItems)))
    17921786    {
    17931787        /* Special case: append to menu */
     
    21232117   {
    21242118        Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(menu->hWnd);
    2125         if(win32wnd==NULL)
    2126                 DebugInt3();
     2119        if(win32wnd==NULL)
     2120                DebugInt3();
    21272121
    21282122        ht = win32wnd->HandleNCHitTest(pt);
  • trunk/src/user32/new/oslibwin.cpp

    r2408 r2410  
    1 /* $Id: oslibwin.cpp,v 1.35 2000-01-11 13:52:18 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.36 2000-01-11 17:34:43 cbratschi Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    2626#include "oslibgdi.h"
    2727#include "pmwindow.h"
    28 
    29 #define HAS_3DFRAME(exStyle) \
    30     ((exStyle & WS_EX_CLIENTEDGE_W) || (exStyle & WS_EX_STATICEDGE_W) || (exStyle & WS_EX_WINDOWEDGE_W))
    3128
    3229//******************************************************************************
  • trunk/src/user32/new/win32wbase.cpp

    r2408 r2410  
    1 /* $Id: win32wbase.cpp,v 1.33 2000-01-11 13:52:19 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.34 2000-01-11 17:34:43 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    55 * Copyright 1998-2000 Sander van Leeuwen (sandervl@xs4all.nl)
    66 * Copyright 1999      Daniela Engert (dani@ngrt.de)
    7  * Copyright 2000      Christoph Bratschi (cbratschi@datacomm.ch)
     7 * Copyright 1999-2000 Christoph Bratschi (cbratschi@datacomm.ch)
    88 *
    99 * Parts based on Wine Windows code (windows\win.c)
     
    5151#define SC_PUTMARK              (SC_SCREENSAVE+2)
    5252
    53 #define HAS_DLGFRAME(style,exStyle) \
    54     (((exStyle) & WS_EX_DLGMODALFRAME) || \
    55      (((style) & WS_DLGFRAME) && !((style) & WS_THICKFRAME)))
    56 
    57 #define HAS_THICKFRAME(style,exStyle) \
    58     (((style) & WS_THICKFRAME) && \
    59      !((exStyle) & WS_EX_DLGMODALFRAME) && \
    60      !((style) & WS_CHILD))
    61 
    62 #define HAS_THINFRAME(style) \
    63     (((style) & WS_BORDER) || !((style) & (WS_CHILD | WS_POPUP)))
    64 
    65 #define HAS_BIGFRAME(style,exStyle) \
    66     (((style) & (WS_THICKFRAME | WS_DLGFRAME)) || \
    67      ((exStyle) & WS_EX_DLGMODALFRAME))
    68 
    69 #define HAS_ANYFRAME(style,exStyle) \
    70     (((style) & (WS_THICKFRAME | WS_DLGFRAME | WS_BORDER)) || \
    71      ((exStyle) & WS_EX_DLGMODALFRAME) || \
    72      !((style) & (WS_CHILD | WS_POPUP)))
    73 
    74 #define HAS_3DFRAME(exStyle) \
    75     ((exStyle & WS_EX_CLIENTEDGE) || (exStyle & WS_EX_STATICEDGE) || (exStyle & WS_EX_WINDOWEDGE))
    76 
    77 #define HAS_BORDER(style, exStyle) \
    78     ((style & WS_BORDER) || HAS_THICKFRAME(style) || HAS_DLGFRAME(style,exStyle))
    79 
    80 #define IS_OVERLAPPED(style) \
    81     !(style & (WS_CHILD | WS_POPUP))
    82 
    83 #define HAS_MENU() (!(getStyle() & WS_CHILD) && (GetMenu() != 0))
    84 
    8553/* bits in the dwKeyData */
    8654#define KEYDATA_ALT         0x2000
     
    10901058//dprintf(("CB: %d %d %d %d",rect.left,rect.top,rect.bottom,rect.right));
    10911059    DeleteObject(hrgn);
    1092     //CB: todo: check if intersection with client
     1060    //CB: todo: check if intersection with client, what does PM's frame???
    10931061
    10941062    return rc;
     
    16101578    case WM_SYSCHAR:
    16111579    {
    1612             int iMenuSysKey = 0;
    1613             if (wParam == VK_RETURN && (getStyle() & WS_MINIMIZE))
    1614         {
    1615                 PostMessageA(getWindowHandle(), WM_SYSCOMMAND,
     1580            int iMenuSysKey = 0;
     1581            if (wParam == VK_RETURN && (getStyle() & WS_MINIMIZE))
     1582        {
     1583                PostMessageA(getWindowHandle(), WM_SYSCOMMAND,
    16161584                         (WPARAM)SC_RESTORE, 0L );
    1617                 break;
    1618         }
    1619             if ((HIWORD(lParam) & KEYDATA_ALT) && wParam)
    1620         {
    1621                 if (wParam == VK_TAB || wParam == VK_ESCAPE) break;
    1622                 if (wParam == VK_SPACE && (getStyle() & WS_CHILD))
     1585                break;
     1586        }
     1587            if ((HIWORD(lParam) & KEYDATA_ALT) && wParam)
     1588        {
     1589                if (wParam == VK_TAB || wParam == VK_ESCAPE) break;
     1590                if (wParam == VK_SPACE && (getStyle() & WS_CHILD))
    16231591                getParent()->SendMessageA(Msg, wParam, lParam );
    1624                 else
     1592                else
    16251593                SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam );
    16261594        }
    1627             else /* check for Ctrl-Esc */
     1595            else /* check for Ctrl-Esc */
    16281596            if (wParam != VK_ESCAPE) MessageBeep(0);
    1629             break;
     1597            break;
    16301598    }
    16311599
     
    27282696  if(IsWindowDestroyed()) return;
    27292697
    2730   //CB: todo: dwExStyle, creating new frame controls, destroy not used controls, WS_VISIBLE, WS_CHILD, ...
    2731   //    write test cases
    27322698  if ((dwStyle & 0xFFFF0000) != (oldStyle & 0xFFFF0000))
    27332699  {
    2734     //dprintf(("updateWindowStyle: %x %x",oldStyle,dwStyle));
    2735     OSLibSetWindowStyle(OS2HwndFrame, dwStyle, fTaskList);
     2700    //CB: update
     2701    //OSLibSetWindowStyle(OS2HwndFrame, dwStyle, fTaskList);
    27362702  }
    27372703}
  • trunk/src/user32/new/win32wbase.h

    r2401 r2410  
    1 /* $Id: win32wbase.h,v 1.23 2000-01-10 23:37:24 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.24 2000-01-11 17:34:44 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    5656#define BROADCAST_SEND          0
    5757#define BROADCAST_POST          1
     58
     59#define HAS_DLGFRAME(style,exStyle) \
     60    (((exStyle) & WS_EX_DLGMODALFRAME) || \
     61     (((style) & WS_DLGFRAME) && !((style) & WS_THICKFRAME)))
     62
     63#define HAS_THICKFRAME(style,exStyle) \
     64    (((style) & WS_THICKFRAME) && \
     65     !((exStyle) & WS_EX_DLGMODALFRAME) && \
     66     !((style) & WS_CHILD))
     67
     68#define HAS_THINFRAME(style) \
     69    (((style) & WS_BORDER) || !((style) & (WS_CHILD | WS_POPUP)))
     70
     71#define HAS_BIGFRAME(style,exStyle) \
     72    (((style) & (WS_THICKFRAME | WS_DLGFRAME)) || \
     73     ((exStyle) & WS_EX_DLGMODALFRAME))
     74
     75#define HAS_ANYFRAME(style,exStyle) \
     76    (((style) & (WS_THICKFRAME | WS_DLGFRAME | WS_BORDER)) || \
     77     ((exStyle) & WS_EX_DLGMODALFRAME) || \
     78     !((style) & (WS_CHILD | WS_POPUP)))
     79
     80#define HAS_3DFRAME(exStyle) \
     81    ((exStyle & WS_EX_CLIENTEDGE) || (exStyle & WS_EX_STATICEDGE) || (exStyle & WS_EX_WINDOWEDGE))
     82
     83#define HAS_BORDER(style, exStyle) \
     84    ((style & WS_BORDER) || HAS_THICKFRAME(style) || HAS_DLGFRAME(style,exStyle))
     85
     86#define IS_OVERLAPPED(style) \
     87    !(style & (WS_CHILD | WS_POPUP))
     88
     89#define HAS_MENU() (!(getStyle() & WS_CHILD) && (GetMenu() != 0))
    5890
    5991class Win32BaseWindow : public GenericObject, public ChildWindow
  • trunk/src/user32/new/win32wbasepos.cpp

    r2396 r2410  
    1 /* $Id: win32wbasepos.cpp,v 1.4 2000-01-10 17:18:11 cbratschi Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.5 2000-01-11 17:34:44 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    3838#include "pmframe.h"
    3939#include "win32wdesktop.h"
    40 
    41   /* Some useful macros */
    42 #define HAS_DLGFRAME(style,exStyle) \
    43     (((exStyle) & WS_EX_DLGMODALFRAME) || \
    44      (((style) & WS_DLGFRAME) && !((style) & WS_THICKFRAME)))
    45 
    46 #define HAS_THICKFRAME(style,exStyle) \
    47     (((style) & WS_THICKFRAME) && \
    48      !((exStyle) & WS_EX_DLGMODALFRAME))
    49 
    50 #define HAS_THINFRAME(style) \
    51     (((style) & WS_BORDER) || !((style) & (WS_CHILD | WS_POPUP)))
    52 
    53 #define HAS_BIGFRAME(style,exStyle) \
    54     (((style) & (WS_THICKFRAME | WS_DLGFRAME)) || \
    55      ((exStyle) & WS_EX_DLGMODALFRAME))
    56 
    57 #define HAS_ANYFRAME(style,exStyle) \
    58     (((style) & (WS_THICKFRAME | WS_DLGFRAME | WS_BORDER)) || \
    59      ((exStyle) & WS_EX_DLGMODALFRAME) || \
    60      !((style) & (WS_CHILD | WS_POPUP)))
    61 
    62 #define HAS_3DFRAME(exStyle) \
    63     ((exStyle & WS_EX_CLIENTEDGE) || (exStyle & WS_EX_STATICEDGE) || (exStyle & WS_EX_WINDOWEDGE))
    64 
    65 #define HAS_BORDER(style, exStyle) \
    66     ((style & WS_BORDER) || HAS_THICKFRAME(style) || HAS_DLGFRAME(style,exStyle))
    67 
    68 #define IS_OVERLAPPED(style) \
    69     !(style & (WS_CHILD | WS_POPUP))
    70 
    71 #define HAS_MENU()  (!(getStyle() & WS_CHILD) && (GetMenu() != 0))
    7240
    7341/*******************************************************************
  • 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.