Changeset 5993 for trunk/src/user32


Ignore:
Timestamp:
Jun 13, 2001, 12:29:46 PM (24 years ago)
Author:
sandervl
Message:

OS/2 looks changes + fixes

Location:
trunk/src/user32
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/USER32.DEF

    r5751 r5993  
    1 ; $Id: USER32.DEF,v 1.55 2001-05-19 11:16:01 sandervl Exp $
     1; $Id: USER32.DEF,v 1.56 2001-06-13 10:29:44 sandervl Exp $
    22
    33LIBRARY USER32 INITINSTANCE TERMINSTANCE
     
    693693    _checkOrigin@4                                               @2029 NONAME
    694694
     695    _SetWindowAppearance@4                                       @2030 NONAME
  • trunk/src/user32/oslibwin.cpp

    r5989 r5993  
    1 /* $Id: oslibwin.cpp,v 1.99 2001-06-13 08:19:34 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.100 2001-06-13 10:29:44 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    123123      if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) {
    124124          *OSFrameStyle = FCF_TITLEBAR;
    125           if(dwStyle & WS_SYSMENU_W)
     125          if((dwStyle & WS_SYSMENU_W) && !(dwExStyle & WS_EX_TOOLWINDOW_W))
    126126          {
    127127              *OSFrameStyle |= FCF_SYSMENU;
     
    130130              *OSFrameStyle |= FCF_MINMAX;
    131131          }
     132          else
     133          if(dwStyle & WS_SYSMENU_W) {
     134              *OSFrameStyle |= FCF_CLOSEBUTTON;
     135          }
    132136      }
    133137  }
     
    136140//******************************************************************************
    137141//******************************************************************************
    138 BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect)
     142BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle,
     143                                   DWORD dwExStyle, HICON hSysMenuIcon)
    139144{
    140145  SWP  swp[3];
     
    149154  }
    150155
     156#if 0
    151157  hwndControl = WinWindowFromID(hwndFrame, FID_SYSMENU);
    152158  if(hwndControl) {
     
    165171      i++;
    166172  }
    167   hwndControl = WinWindowFromID(hwndFrame, FID_TITLEBAR);
    168   if(hwndControl) {
    169       swp[i].hwnd = hwndControl;
    170       swp[i].hwndInsertBehind = HWND_TOP;
    171       swp[i].x  = pRect->xLeft;
    172       swp[i].y  = pRect->yBottom;
    173       if(pRect->yTop - pRect->yBottom > minmaxheight) {
    174           swp[i].y += pRect->yTop - pRect->yBottom - minmaxheight;
     173#else
     174  if((dwStyle & WS_SYSMENU_W) && !(dwExStyle & WS_EX_TOOLWINDOW_W) && hSysMenuIcon) {
     175      pRect->xLeft += minmaxwidth/2;
     176  }
     177#endif
     178  if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) {
     179      hwndControl = WinWindowFromID(hwndFrame, FID_TITLEBAR);
     180      if(hwndControl) {
     181          swp[i].hwnd = hwndControl;
     182          swp[i].hwndInsertBehind = HWND_TOP;
     183          swp[i].x  = pRect->xLeft;
     184          swp[i].y  = pRect->yBottom;
     185          if(pRect->yTop - pRect->yBottom > minmaxheight) {
     186              swp[i].y += pRect->yTop - pRect->yBottom - minmaxheight;
     187          }
     188          swp[i].cx = pRect->xRight - pRect->xLeft;
     189          if((dwStyle & WS_MINIMIZEBOX_W) || (dwStyle & WS_MAXIMIZEBOX_W)) {
     190              swp[i].cx -= minmaxwidth;
     191          }
     192          if(dwStyle & WS_SYSMENU_W) {
     193              swp[i].cx -= minmaxwidth/2;
     194          }
     195          swp[i].cy = minmaxheight;
     196          swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
     197          dprintf(("FID_TITLEBAR (%d,%d)(%d,%d)", swp[i].x, swp[i].y, swp[i].cx, swp[i].cy));
     198          pRect->xLeft += swp[i].cx;
     199          i++;
    175200      }
    176       swp[i].cx = pRect->xRight - pRect->xLeft;
    177       if(WinWindowFromID(hwndFrame, FID_MINMAX)) {
    178           swp[i].cx -= (minmaxwidth + minmaxwidth/2);
     201  }
     202  if((dwStyle & WS_MINIMIZEBOX_W) || (dwStyle & WS_MAXIMIZEBOX_W) || (dwStyle & WS_SYSMENU_W)) {
     203      hwndControl = WinWindowFromID(hwndFrame, FID_MINMAX);
     204      if(hwndControl) {
     205          swp[i].hwnd = hwndControl;
     206          swp[i].hwndInsertBehind = HWND_TOP;
     207          swp[i].x  = pRect->xLeft;
     208          swp[i].y  = pRect->yBottom;
     209          if(pRect->yTop - pRect->yBottom > minmaxheight) {
     210              swp[i].y += pRect->yTop - pRect->yBottom - minmaxheight;
     211          }
     212          swp[i].cx = 0;
     213          if((dwStyle & WS_MINIMIZEBOX_W) || (dwStyle & WS_MAXIMIZEBOX_W)) {
     214              swp[i].cx += minmaxwidth;
     215          }
     216          if(dwStyle & WS_SYSMENU_W) {
     217              swp[i].cx += minmaxwidth/2;
     218          }
     219          swp[i].cy = minmaxheight;
     220          swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
     221          dprintf(("FID_MINMAX (%d,%d)(%d,%d)", swp[i].x, swp[i].y, swp[i].cx, swp[i].cy));
     222          pRect->xLeft += swp[i].cx;
     223          i++;
    179224      }
    180       swp[i].cy = minmaxheight;
    181       swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
    182       dprintf(("FID_TITLEBAR (%d,%d)(%d,%d)", swp[i].x, swp[i].y, swp[i].cx, swp[i].cy));
    183       pRect->xLeft += swp[i].cx;
    184       i++;
    185   }
    186   hwndControl = WinWindowFromID(hwndFrame, FID_MINMAX);
    187   if(hwndControl) {
    188       swp[i].hwnd = hwndControl;
    189       swp[i].hwndInsertBehind = HWND_TOP;
    190       swp[i].x  = pRect->xLeft;
    191       swp[i].y  = pRect->yBottom;
    192       if(pRect->yTop - pRect->yBottom > minmaxheight) {
    193           swp[i].y += pRect->yTop - pRect->yBottom - minmaxheight;
    194       }
    195       swp[i].cx = minmaxwidth + minmaxwidth/2;
    196       swp[i].cy = minmaxheight;
    197       swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
    198       dprintf(("FID_MINMAX (%d,%d)(%d,%d)", swp[i].x, swp[i].y, swp[i].cx, swp[i].cy));
    199       pRect->xLeft += swp[i].cx;
    200       i++;
    201225  }
    202226  return WinSetMultWindowPos(GetThreadHAB(), swp, i);
  • trunk/src/user32/oslibwin.h

    r5951 r5993  
    1 /* $Id: oslibwin.h,v 1.56 2001-06-10 12:05:39 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.57 2001-06-13 10:29:44 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    4747DWORD OSLibQueryWindowStyle(HWND hwnd);
    4848
    49 BOOL  OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect);
     49BOOL  OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle, DWORD dwExStyle, HICON hSysMenuIcon);
    5050
    5151#define OSLIB_QWL_USER -4
  • trunk/src/user32/pmwindow.cpp

    r5951 r5993  
    1 /* $Id: pmwindow.cpp,v 1.134 2001-06-10 12:05:39 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.135 2001-06-13 10:29:45 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    157157    return TRUE;
    158158} /* End of main */
     159//******************************************************************************
     160//menu.cpp
     161BOOL MENU_Init();
     162//******************************************************************************
     163void WIN32API SetWindowAppearance(BOOL fLooks)
     164{
     165    if(fLooks) {
     166        SYSCOLOR_Init(FALSE); //use OS/2 colors
     167    }
     168    fOS2Look = fLooks;
     169    MENU_Init();
     170}
    159171//******************************************************************************
    160172//Win32 window message handler
  • trunk/src/user32/user32.cpp

    r5973 r5993  
    1 /* $Id: user32.cpp,v 1.100 2001-06-12 17:02:36 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.101 2001-06-13 10:29:45 sandervl Exp $ */
    22
    33/*
     
    633633        *(BOOL *)pvParam = FALSE; //CB: where is the Warp 4 setting stored?
    634634        break;
     635
    635636    case SPI_GETNONCLIENTMETRICS:
    636637    {
    637638        LPNONCLIENTMETRICSA lpnm = (LPNONCLIENTMETRICSA)pvParam;
    638639               
    639         if (lpnm->cbSize == sizeof(NONCLIENTMETRICSA))
     640        if (lpnm->cbSize == sizeof(NONCLIENTMETRICSA))
    640641        {
    641642            memset(lpnm, 0, sizeof(NONCLIENTMETRICSA));
     
    652653
    653654            LPLOGFONTA lpLogFont = &(lpnm->lfMenuFont);
    654             GetProfileStringA("Desktop", "MenuFont", "MS Sans Serif",
    655                               lpLogFont->lfFaceName, LF_FACESIZE);
    656 
    657             lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 13);
    658             lpLogFont->lfWidth = 0;
    659             lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
    660             lpLogFont->lfWeight = FW_NORMAL;
     655            if(fOS2Look) {
     656                GetProfileStringA("Desktop", "MenuFont", "WarpSans",
     657                                  lpLogFont->lfFaceName, LF_FACESIZE);
     658                lpLogFont->lfWeight = FW_BOLD;
     659                lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 16);
     660                lpLogFont->lfWidth = 0;
     661                lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
     662            }
     663            else {
     664                GetProfileStringA("Desktop", "MenuFont", "MS Sans Serif",
     665                                  lpLogFont->lfFaceName, LF_FACESIZE);
     666                lpLogFont->lfWeight = FW_NORMAL;
     667                lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 13);
     668                lpLogFont->lfWidth = 0;
     669                lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
     670            }
    661671            lpLogFont->lfItalic = FALSE;
    662672            lpLogFont->lfStrikeOut = FALSE;
     
    677687            lpnm->iMenuHeight      = GetSystemMetrics(SM_CYMENU);
    678688            lpnm->iMenuWidth       = lpnm->iMenuHeight; //TODO
    679         }
     689          }
    680690        else
    681         {
     691        {
    682692            dprintf(("SPI_GETNONCLIENTMETRICS: size mismatch !! (is %d; should be %d)\n", lpnm->cbSize, sizeof(NONCLIENTMETRICSA)));
    683693            /* FIXME: SetLastError? */
  • trunk/src/user32/win32wbase.cpp

    r5973 r5993  
    1 /* $Id: win32wbase.cpp,v 1.265 2001-06-12 17:02:41 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.266 2001-06-13 10:29:46 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    12391239      rectOS2.yBottom = height - rect.top;
    12401240      rectOS2.yTop    = height - rect.bottom;
    1241       OSLibWinPositionFrameControls(getOS2FrameWindowHandle(), &rectOS2);
     1241      OSLibWinPositionFrameControls(getOS2FrameWindowHandle(), &rectOS2, dwStyle, dwExStyle, IconForWindow(ICON_SMALL));
    12421242  }
    12431243  return rc;
  • trunk/src/user32/win32wbasenonclient.cpp

    r5973 r5993  
    1 /* $Id: win32wbasenonclient.cpp,v 1.33 2001-06-12 17:02:42 sandervl Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.34 2001-06-13 10:29:46 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    888888  HBITMAP memBmp,oldBmp;
    889889
    890   if(fOS2Look) return;
     890  if(fOS2Look) {
     891      if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW))
     892      {
     893         int size = GetSystemMetrics(SM_CYCAPTION);
     894   
     895         r2 = r;
     896         r2.right  = r2.left + size;
     897         r2.bottom = r2.top + size;
     898         FillRect(hdc, &r2, GetSysColorBrush(COLOR_MENU));
     899
     900         DrawSysButton(hdc,&r);
     901      }
     902      return;
     903  }
    891904
    892905  memDC = CreateCompatibleDC(hdc);
Note: See TracChangeset for help on using the changeset viewer.