Changeset 325 for trunk/src/user32/new/oslibwin.cpp
- Timestamp:
- Jul 18, 1999, 12:39:52 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibwin.cpp
r324 r325 1 /* $Id: oslibwin.cpp,v 1. 9 1999-07-17 18:30:51 sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.10 1999-07-18 10:39:51 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 22 22 #include "oslibutil.h" 23 23 #include "oslibmsg.h" 24 #include "oslibgdi.h" 24 25 #include "pmwindow.h" 25 26 … … 41 42 { 42 43 HWND hwndClient; 43 RECTL rectl;44 44 45 45 dprintf(("WinCreateWindow %x %x %x %s", hwndParent, dwWinStyle, dwFrameStyle, pszName)); … … 53 53 if(dwFrameStyle) { 54 54 dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs 55 if(pszName) 56 dwFrameStyle |= FCF_TITLEBAR; 57 55 58 *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle, 56 59 &dwFrameStyle, WIN32_STDCLASS, 57 "", 0, 0, 0, &hwndClient) != 0;60 "", 0, 0, 0, &hwndClient); 58 61 if(*hwndFrame) { 59 60 61 62 if(pszName) { 63 WinSetWindowText(*hwndFrame, pszName); 64 } 62 65 return hwndClient; 63 66 } … … 158 161 //****************************************************************************** 159 162 //****************************************************************************** 160 LONG OSLibWinQueryWindowTextLength(HWND hwnd)161 {162 return WinQueryWindowTextLength(hwnd);163 }164 //******************************************************************************165 //******************************************************************************166 LONG OSLibWinQueryWindowText(HWND hwnd,LONG lLength,char* pun)167 {168 return WinQueryWindowText(hwnd,lLength,pun);169 }170 163 //****************************************************************************** 171 164 //****************************************************************************** … … 179 172 LONG cy, ULONG fl) 180 173 { 181 RECTL rectl;182 HWND hwndParent;183 184 174 if(fl & SWP_MOVE) { 185 y = MapOS2ToWin32Y(hwnd, y); 186 } 175 y = MapOS2ToWin32Y(hwnd, cy, y); 176 } 177 dprintf(("WinSetWindowPos %x %x %d %d %d %d %x", hwnd, hwndInsertBehind, x, y, cx, cy, fl)); 187 178 return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl); 188 179 } … … 198 189 if(rc == 0) 199 190 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB()))); 200 rc = WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl);191 rc = WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, fl); 201 192 if(rc == 0) 202 193 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB()))); … … 211 202 //****************************************************************************** 212 203 //****************************************************************************** 213 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect) 214 { 215 return WinQueryUpdateRect(hwnd, (RECTL *)pRect); 204 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PRECT pRect) 205 { 206 BOOL rc; 207 RECTLOS2 rectl; 208 209 rc = WinQueryUpdateRect(hwnd, (PRECTL)&rectl); 210 if(rc) { 211 MapOS2ToWin32Rectl(hwnd, &rectl, pRect); 212 } 213 return rc; 216 214 } 217 215 //****************************************************************************** … … 296 294 //****************************************************************************** 297 295 //****************************************************************************** 298 inline ULONG OS2TOWIN32POINT(RECTL *parent, RECTL *child, ULONG y) 299 { 300 return (parent->yTop - parent->yBottom - (child->yTop - child->yBottom) - y - 1); 301 } 302 //****************************************************************************** 303 //****************************************************************************** 304 ULONG MapOS2ToWin32Y(HWND hwndChild) 305 { 306 HWND hwndParent; 307 RECTL rectParent = {0}, rectChild = {0}; 308 309 WinQueryWindowRect(hwndChild, &rectChild); 310 hwndParent = WinQueryWindow(hwndChild, QW_PARENT); 311 WinQueryWindowRect(hwndParent, &rectParent); 312 return OS2TOWIN32POINT(&rectParent, &rectChild, rectChild.yBottom); 313 } 314 //****************************************************************************** 315 //****************************************************************************** 316 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y) 317 { 318 HWND hwndParent; 319 RECTL rectParent = {0}, rectChild = {0}; 320 321 WinQueryWindowRect(hwndChild, &rectChild); 322 hwndParent = WinQueryWindow(hwndChild, QW_PARENT); 323 WinQueryWindowRect(hwndParent, &rectParent); 324 return OS2TOWIN32POINT(&rectParent, &rectChild, y); 325 } 326 //****************************************************************************** 327 //****************************************************************************** 328 ULONG MapOS2ToWin32Y(PRECTL rectParent, PRECTL rectChild, ULONG y) 329 { 330 return OS2TOWIN32POINT(rectParent, rectChild, y); 331 } 332 //****************************************************************************** 333 //****************************************************************************** 334 ULONG MapOS2ToWin32Y(PRECTL rectParent, HWND hwndChild, ULONG y) 335 { 336 RECTL rectChild = {0}; 337 338 WinQueryWindowRect(hwndChild, &rectChild); 339 return OS2TOWIN32POINT(rectParent, &rectChild, y); 340 } 341 //****************************************************************************** 342 //****************************************************************************** 343 ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTL rectChild, ULONG y) 344 { 345 HWND hwndParent; 346 RECTL rectParent = {0}; 347 348 hwndParent = WinQueryWindow(hwndChild, QW_PARENT); 349 WinQueryWindowRect(hwndParent, &rectParent); 350 return OS2TOWIN32POINT(&rectParent, rectChild, y); 351 } 352 //****************************************************************************** 353 //****************************************************************************** 296 LONG OSLibWinQueryWindowTextLength(HWND hwnd) 297 { 298 return WinQueryWindowTextLength(hwnd); 299 } 300 //****************************************************************************** 301 //****************************************************************************** 302 LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz) 303 { 304 return WinQueryWindowText(hwnd, length, lpsz); 305 } 306 //****************************************************************************** 307 //****************************************************************************** 308 BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz) 309 { 310 return WinSetWindowText(hwnd, lpsz); 311 } 312 //****************************************************************************** 313 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.