Changeset 20119


Ignore:
Timestamp:
Jan 1, 2003, 3:29:45 PM (22 years ago)
Author:
sandervl
Message:

Fixes for windows with an iconless class and WS_EX_DLGMODALFRAME style. (they shouldn't have a system menu)

Location:
tags/trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/user32/oslibwin.cpp

    r20107 r20119  
    1 /* $Id: oslibwin.cpp,v 1.131 2002-12-29 17:17:16 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.132 2003-01-01 14:29:42 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    117117//Note: Also check OSLibSetWindowStyle when changing this!!
    118118//******************************************************************************
    119 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle)
     119BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle,
     120                          ULONG *OSFrameStyle)
    120121{
    121122  *OSWinStyle   = 0;
     
    135136      if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) {
    136137          *OSFrameStyle = FCF_TITLEBAR;
     138
    137139          if((dwStyle & WS_SYSMENU_W) && !(dwExStyle & WS_EX_TOOLWINDOW_W))
    138140          {
     
    155157//******************************************************************************
    156158BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle,
    157                                    DWORD dwExStyle, HICON hSysMenuIcon, BOOL drawCloseButton)
     159                                   DWORD dwExStyle, HICON hSysMenuIcon,
     160                                   BOOL drawCloseButton, BOOL fClassIcon)
    158161{
    159162  SWP  swp[3];
     
    171174 
    172175  if(fOS2Look == OS2_APPEARANCE_SYSMENU) {
     176      //Note: If no class icon *and* WS_EX_DLGMODALFRAME -> no system menu!!
     177      //      --> TODO
    173178      hwndControl = WinWindowFromID(hwndFrame, FID_SYSMENU);
    174179      if(hwndControl) {
     
    187192          i++;
    188193      }
    189 
    190194  }
    191195  else
    192   if((dwStyle & WS_SYSMENU_W) && !(dwExStyle & WS_EX_TOOLWINDOW_W) && hSysMenuIcon) {
     196  //Note: If no class icon *and* WS_EX_DLGMODALFRAME -> no system menu!!
     197  if((dwStyle & WS_SYSMENU_W) && !(dwExStyle & WS_EX_TOOLWINDOW_W) &&
     198     !(!fClassIcon && (dwExStyle & WS_EX_DLGMODALFRAME_W)) && hSysMenuIcon)
     199  {
    193200      pRect->xLeft += minmaxwidth/2;
    194201  }
     
    988995//******************************************************************************
    989996//******************************************************************************
    990 void OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle, ULONG dwExStyle)
     997void OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle,
     998                         ULONG dwExStyle)
    991999{
    9921000    ULONG dwWinStyle;
     
    10951103   } // os2look
    10961104}
    1097 
    10981105//******************************************************************************
    10991106//******************************************************************************
  • TabularUnified tags/trunk/src/user32/oslibwin.h

    r19889 r20119  
    1 /* $Id: oslibwin.h,v 1.69 2002-10-15 09:18:10 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.70 2003-01-01 14:29:43 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    4444                           int classStyle, HWND *hwndFrame);
    4545
    46 BOOL  OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle);
    47 void  OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle, ULONG dwExStyle);
     46BOOL  OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle,
     47                           ULONG *OSFrameStyle);
     48void  OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle,
     49                          ULONG dwExStyle);
     50
    4851DWORD OSLibQueryWindowStyle(HWND hwnd);
    4952
    50 BOOL  OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle, DWORD dwExStyle, HICON hSysMenuIcon, BOOL drawCloseButton);
     53BOOL  OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle,
     54                                    DWORD dwExStyle, HICON hSysMenuIcon,
     55                                    BOOL drawCloseButton, BOOL fClassIcon);
    5156BOOL  OSLibChangeCloseButtonState(HWND hwndFrame, BOOL State);
    5257
  • TabularUnified tags/trunk/src/user32/win32wbase.cpp

    r20116 r20119  
    1 /* $Id: win32wbase.cpp,v 1.348 2002-12-31 16:52:00 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.349 2003-01-01 14:29:44 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    13741374      OSLibWinPositionFrameControls(getOS2FrameWindowHandle(), &rectOS2,
    13751375                                    dwStyle, dwExStyle, IconForWindow(ICON_SMALL),
    1376                                     fCloseButton);
     1376                                    fCloseButton, windowClass->getIcon() != NULL);
    13771377  }
    13781378  return rc;
     
    37123712                setStyle(ss.styleNew);
    37133713                SendMessageA(getWindowHandle(),WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);
    3714                 OSLibSetWindowStyle(getOS2FrameWindowHandle(), getOS2WindowHandle(), getStyle(), getExStyle());
     3714                OSLibSetWindowStyle(getOS2FrameWindowHandle(), getOS2WindowHandle(),
     3715                                    getStyle(), getExStyle());
    37153716
    37163717                //TODO: Might not be correct to use ShowWindow here
  • TabularUnified tags/trunk/src/user32/win32wbasenonclient.cpp

    r20107 r20119  
    1 /* $Id: win32wbasenonclient.cpp,v 1.45 2002-12-29 17:17:16 sandervl Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.46 2003-01-01 14:29:45 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    907907
    908908  if(fOS2Look) {
    909       if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW) &&
    910            fOS2Look != OS2_APPEARANCE_SYSMENU)
     909      //Note: If no class icon *and* WS_EX_DLGMODALFRAME -> no system menu
     910      if((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW) &&
     911         !(!windowClass->getIcon() && (dwExStyle & WS_EX_DLGMODALFRAME)) &&
     912         fOS2Look != OS2_APPEARANCE_SYSMENU)
    911913      {
    912914         HICON hSysIcon = IconForWindow(ICON_SMALL);
     
    986988  }
    987989
    988   if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW))
     990  //Note: If no class icon *and* WS_EX_DLGMODALFRAME -> no system menu
     991  if((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW) &&
     992     !(!windowClass->getIcon() && (dwExStyle & WS_EX_DLGMODALFRAME)))
    989993  {
    990994    if (DrawSysButton(memDC,&r))
     
    15501554  return DrawCaptionTemp(hwnd,hdc,rect,hFont,hIcon,(LPWSTR)str,uFlags,TRUE);
    15511555}
    1552 
     1556#if 0
     1557//Control helpers
     1558/***********************************************************************
     1559 *           NC_GetSysPopupPos
     1560 */
     1561void NC_GetSysPopupPos( HWND hwnd, RECT* rect )
     1562{
     1563    if (IsIconic(hwnd)) GetWindowRect( hwnd, rect );
     1564    else
     1565    {
     1566#ifdef __WIN32OS2__
     1567        Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1568        if (!win32wnd) return;
     1569
     1570        win32wnd->GetSysPopupPos(rect);
     1571
     1572        RELEASE_WNDOBJ(win32wnd);
     1573#else
     1574        WND *wndPtr = WIN_FindWndPtr( hwnd );
     1575        if (!wndPtr) return;
     1576
     1577        NC_GetInsideRect( hwnd, rect );
     1578        OffsetRect( rect, wndPtr->rectWindow.left, wndPtr->rectWindow.top);
     1579        if (wndPtr->dwStyle & WS_CHILD)
     1580            ClientToScreen( GetParent(hwnd), (POINT *)rect );
     1581        if (TWEAK_WineLook == WIN31_LOOK) {
     1582            rect->right = rect->left + GetSystemMetrics(SM_CXSIZE);
     1583            rect->bottom = rect->top + GetSystemMetrics(SM_CYSIZE);
     1584        }
     1585        else {
     1586            rect->right = rect->left + GetSystemMetrics(SM_CYCAPTION) - 1;
     1587            rect->bottom = rect->top + GetSystemMetrics(SM_CYCAPTION) - 1;
     1588        }
     1589        WIN_ReleaseWndPtr( wndPtr );
     1590#endif
     1591    }
     1592}
     1593//*****************************************************************************
     1594//*****************************************************************************
     1595BOOL NC_DrawSysButton95 (HWND hwnd, HDC hdc, BOOL down)
     1596{
     1597    BOOL ret;
     1598
     1599    Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1600    if (!win32wnd) return FALSE;
     1601
     1602    ret = win32wnd->DrawSysButton(hwnd, hdc);
     1603
     1604    RELEASE_WNDOBJ(win32wnd);
     1605
     1606    return ret;
     1607}
     1608#endif
Note: See TracChangeset for help on using the changeset viewer.