Ignore:
Timestamp:
Jun 10, 2001, 2:05:41 PM (24 years ago)
Author:
sandervl
Message:

bugfixes + os/2 look support added

File:
1 edited

Legend:

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

    r5935 r5951  
    1 /* $Id: oslibwin.cpp,v 1.96 2001-06-09 14:50:19 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.97 2001-06-10 12:05:38 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    5252//******************************************************************************
    5353//******************************************************************************
    54 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle,
     54HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, ULONG dwOSFrameStyle,
    5555                          char *pszName, HWND Owner, ULONG fHWND_BOTTOM,
    5656                          ULONG id, BOOL fTaskList,BOOL fShellPosition,
     
    9393                           pszName, (dwWinStyle & ~WS_CLIPCHILDREN), 0, 0, 0, 0,
    9494                           Owner, (fHWND_BOTTOM) ? HWND_BOTTOM : HWND_TOP,
    95                            id, NULL, NULL);
     95                           id, (PVOID)&FCData, NULL);
     96    if(fOS2Look && *hwndFrame) {
     97        FCData.flCreateFlags = dwOSFrameStyle;
     98        WinCreateFrameControls(*hwndFrame, &FCData, NULL);
     99    }
    96100    hwndClient = WinCreateWindow (*hwndFrame, WIN32_STDCLASS,
    97101                              NULL, dwWinStyle | WS_VISIBLE, 0, 0, 0, 0,
    98102                              *hwndFrame, HWND_TOP, FID_CLIENT, NULL, NULL);
     103
    99104    return hwndClient;
    100105}
     
    102107//Note: Also check OSLibSetWindowStyle when changing this!!
    103108//******************************************************************************
    104 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle)
     109BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle)
    105110{
    106111  *OSWinStyle   = 0;
     112  *OSFrameStyle = 0;
    107113
    108114  /* Window styles */
    109 #if 0
    110   //Done explicitely in CreateWindowExA
    111   if(dwStyle & WS_MINIMIZE_W)
    112         *OSWinStyle |= WS_MINIMIZED;
    113   if(dwStyle & WS_VISIBLE_W)
    114         *OSWinStyle |= WS_VISIBLE;
    115 #endif
    116115  if(dwStyle & WS_DISABLED_W)
    117116        *OSWinStyle |= WS_DISABLED;
     
    120119  if(dwStyle & WS_CLIPCHILDREN_W)
    121120        *OSWinStyle |= WS_CLIPCHILDREN;
    122 #if 0
    123   if(dwStyle & WS_MAXIMIZE_W)
    124         *OSWinStyle |= WS_MAXIMIZED;
    125   if(dwStyle & WS_GROUP_W)
    126         *OSWinStyle |= WS_GROUP;
    127   if(dwStyle & WS_TABSTOP_W)
    128         *OSWinStyle |= WS_TABSTOP;
    129 #endif
    130 
     121
     122  if(fOS2Look) {
     123      if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) {
     124          *OSFrameStyle = FCF_TITLEBAR;
     125          if(dwStyle & WS_SYSMENU_W)
     126          {
     127              *OSFrameStyle |= FCF_SYSMENU;
     128          }
     129          if((dwStyle & WS_MINIMIZEBOX_W) || (dwStyle & WS_MAXIMIZEBOX_W)) {
     130              *OSFrameStyle |= FCF_MINMAX;
     131          }
     132      }
     133  }
    131134  return TRUE;
     135}
     136//******************************************************************************
     137//******************************************************************************
     138BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect)
     139{
     140  SWP  swp[3];
     141  HWND hwndControl;
     142  int  i = 0;
     143  static int minmaxwidth = 0;
     144
     145  if(minmaxwidth == 0) {
     146      minmaxwidth = WinQuerySysValue(HWND_DESKTOP, SV_CXMINMAXBUTTON);
     147  }
     148
     149  hwndControl = WinWindowFromID(hwndFrame, FID_SYSMENU);
     150  if(hwndControl) {
     151      swp[i].hwnd = hwndControl;
     152      swp[i].hwndInsertBehind = HWND_TOP;
     153      swp[i].x  = pRect->xLeft;
     154      swp[i].y  = pRect->yBottom;
     155      swp[i].cx = minmaxwidth/2;
     156      swp[i].cy = pRect->yTop - pRect->yBottom;
     157      swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
     158      pRect->xLeft += swp[i].cx;
     159      i++;
     160  }
     161  hwndControl = WinWindowFromID(hwndFrame, FID_TITLEBAR);
     162  if(hwndControl) {
     163      swp[i].hwnd = hwndControl;
     164      swp[i].hwndInsertBehind = HWND_TOP;
     165      swp[i].x  = pRect->xLeft;
     166      swp[i].y  = pRect->yBottom;
     167      swp[i].cx = pRect->xRight - pRect->xLeft;
     168      if(WinWindowFromID(hwndFrame, FID_MINMAX)) {
     169          swp[i].cx -= minmaxwidth - minmaxwidth/2;
     170      }
     171      swp[i].cy = pRect->yTop - pRect->yBottom;
     172      swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
     173      pRect->xLeft += swp[i].cx;
     174      i++;
     175  }
     176  hwndControl = WinWindowFromID(hwndFrame, FID_MINMAX);
     177  if(hwndControl) {
     178      swp[i].hwnd = hwndControl;
     179      swp[i].hwndInsertBehind = HWND_TOP;
     180      swp[i].x  = pRect->xLeft;
     181      swp[i].y  = pRect->yBottom;
     182      swp[i].cx = minmaxwidth + minmaxwidth/2;
     183      swp[i].cy = pRect->yTop - pRect->yBottom;
     184      swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
     185      pRect->xLeft += swp[i].cx;
     186      i++;
     187  }
     188  return WinSetMultWindowPos(GetThreadHAB(), swp, i);
    132189}
    133190//******************************************************************************
     
    360417{
    361418  return WinSetWindowText(hwnd, lpsz);
     419}
     420//******************************************************************************
     421//******************************************************************************
     422BOOL OSLibWinSetTitleBarText(HWND hwnd, LPSTR lpsz)
     423{
     424  return WinSetWindowText(WinWindowFromID(hwnd, FID_TITLEBAR), lpsz);
    362425}
    363426//******************************************************************************
     
    759822
    760823    if(dwWinStyle != dwOldWinStyle) {
    761         WinSetWindowULong(hwndClient, QWL_STYLE, dwWinStyle);
     824         WinSetWindowULong(hwndClient, QWL_STYLE, dwWinStyle);
    762825    }
    763826
     
    781844
    782845    if(dwWinStyle != dwOldWinStyle) {
    783       WinSetWindowULong(hwndFrame, QWL_STYLE, dwWinStyle);
     846         WinSetWindowULong(hwndFrame, QWL_STYLE, dwWinStyle);
    784847    }
    785848}
Note: See TracChangeset for help on using the changeset viewer.