Changeset 5951 for trunk/src/user32/oslibwin.cpp
- Timestamp:
- Jun 10, 2001, 2:05:41 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibwin.cpp
r5935 r5951 1 /* $Id: oslibwin.cpp,v 1.9 6 2001-06-09 14:50:19sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.97 2001-06-10 12:05:38 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 52 52 //****************************************************************************** 53 53 //****************************************************************************** 54 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, 54 HWND OSLibWinCreateWindow(HWND hwndParent,ULONG dwWinStyle, ULONG dwOSFrameStyle, 55 55 char *pszName, HWND Owner, ULONG fHWND_BOTTOM, 56 56 ULONG id, BOOL fTaskList,BOOL fShellPosition, … … 93 93 pszName, (dwWinStyle & ~WS_CLIPCHILDREN), 0, 0, 0, 0, 94 94 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 } 96 100 hwndClient = WinCreateWindow (*hwndFrame, WIN32_STDCLASS, 97 101 NULL, dwWinStyle | WS_VISIBLE, 0, 0, 0, 0, 98 102 *hwndFrame, HWND_TOP, FID_CLIENT, NULL, NULL); 103 99 104 return hwndClient; 100 105 } … … 102 107 //Note: Also check OSLibSetWindowStyle when changing this!! 103 108 //****************************************************************************** 104 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle )109 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle) 105 110 { 106 111 *OSWinStyle = 0; 112 *OSFrameStyle = 0; 107 113 108 114 /* Window styles */ 109 #if 0110 //Done explicitely in CreateWindowExA111 if(dwStyle & WS_MINIMIZE_W)112 *OSWinStyle |= WS_MINIMIZED;113 if(dwStyle & WS_VISIBLE_W)114 *OSWinStyle |= WS_VISIBLE;115 #endif116 115 if(dwStyle & WS_DISABLED_W) 117 116 *OSWinStyle |= WS_DISABLED; … … 120 119 if(dwStyle & WS_CLIPCHILDREN_W) 121 120 *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 } 131 134 return TRUE; 135 } 136 //****************************************************************************** 137 //****************************************************************************** 138 BOOL 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); 132 189 } 133 190 //****************************************************************************** … … 360 417 { 361 418 return WinSetWindowText(hwnd, lpsz); 419 } 420 //****************************************************************************** 421 //****************************************************************************** 422 BOOL OSLibWinSetTitleBarText(HWND hwnd, LPSTR lpsz) 423 { 424 return WinSetWindowText(WinWindowFromID(hwnd, FID_TITLEBAR), lpsz); 362 425 } 363 426 //****************************************************************************** … … 759 822 760 823 if(dwWinStyle != dwOldWinStyle) { 761 WinSetWindowULong(hwndClient, QWL_STYLE, dwWinStyle);824 WinSetWindowULong(hwndClient, QWL_STYLE, dwWinStyle); 762 825 } 763 826 … … 781 844 782 845 if(dwWinStyle != dwOldWinStyle) { 783 WinSetWindowULong(hwndFrame, QWL_STYLE, dwWinStyle);846 WinSetWindowULong(hwndFrame, QWL_STYLE, dwWinStyle); 784 847 } 785 848 }
Note:
See TracChangeset
for help on using the changeset viewer.