Changeset 628 for trunk/src/user32/new/oslibwin.cpp
- Timestamp:
- Aug 22, 1999, 8:29:38 PM (26 years ago)
- File:
-
- 1 edited
-
trunk/src/user32/new/oslibwin.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibwin.cpp
r601 r628 1 /* $Id: oslibwin.cpp,v 1.2 2 1999-08-20 20:09:51 sandervlExp $ */1 /* $Id: oslibwin.cpp,v 1.23 1999-08-22 18:29:37 dengert Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 31 31 if(hwndParent == OSLIB_HWND_DESKTOP) 32 32 { 33 hwndParent = HWND_DESKTOP;33 hwndParent = HWND_DESKTOP; 34 34 } 35 35 … … 39 39 //****************************************************************************** 40 40 HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle, 41 char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame)41 char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame) 42 42 { 43 43 HWND hwndClient; … … 46 46 47 47 if(pszName && *pszName == 0) { 48 pszName = NULL;48 pszName = NULL; 49 49 } 50 50 if(hwndParent == OSLIB_HWND_DESKTOP) { 51 hwndParent = HWND_DESKTOP;51 hwndParent = HWND_DESKTOP; 52 52 } 53 53 if(Owner == OSLIB_HWND_DESKTOP) { 54 Owner = HWND_DESKTOP;54 Owner = HWND_DESKTOP; 55 55 } 56 56 57 57 if(dwFrameStyle) { 58 dwWinStyle &= ~WS_CLIPCHILDREN; //invalid style according to docs 59 if(pszName) 60 dwFrameStyle |= FCF_TITLEBAR; 61 62 dwFrameStyle |= FCF_TASKLIST; 63 *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle, 64 &dwFrameStyle, WIN32_STDCLASS, 65 "", 0, 0, 0, &hwndClient); 66 if(*hwndFrame) { 67 if(pszName) { 68 WinSetWindowText(*hwndFrame, pszName); 69 } 70 return hwndClient; 71 } 72 dprintf(("OSLibWinCreateWindow: WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB()))); 73 return 0; 58 ULONG dwClientStyle; 59 60 dwClientStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP); 61 if(pszName) 62 dwFrameStyle |= FCF_TITLEBAR; 63 64 dwFrameStyle |= FCF_TASKLIST; 65 *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle, 66 &dwFrameStyle, WIN32_STDCLASS, 67 "", dwClientStyle, 0, 0, &hwndClient); 68 if(*hwndFrame) { 69 if(pszName) { 70 WinSetWindowText(*hwndFrame, pszName); 71 } 72 return hwndClient; 73 } 74 dprintf(("OSLibWinCreateWindow: WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB()))); 75 return 0; 74 76 } 75 77 hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, 0, 0, 0, 0, 76 Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL,77 NULL);78 Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL, 79 NULL); 78 80 *hwndFrame = hwndClient; 79 81 return hwndClient; … … 83 85 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle) 84 86 { 85 *OSWinStyle = 0;87 *OSWinStyle = 0; 86 88 *OSFrameStyle = 0; 87 89 88 90 /* Window styles */ 89 91 if(dwStyle & WS_MINIMIZE_W) 90 *OSWinStyle |= WS_MINIMIZED;92 *OSWinStyle |= WS_MINIMIZED; 91 93 //Done explicitely in CreateWindowExA 92 94 #if 0 93 95 if(dwStyle & WS_VISIBLE_W) 94 *OSWinStyle |= WS_VISIBLE;96 *OSWinStyle |= WS_VISIBLE; 95 97 #endif 96 98 if(dwStyle & WS_DISABLED_W) 97 *OSWinStyle |= WS_DISABLED;99 *OSWinStyle |= WS_DISABLED; 98 100 if(dwStyle & WS_CLIPSIBLINGS_W) 99 *OSWinStyle |= WS_CLIPSIBLINGS;101 *OSWinStyle |= WS_CLIPSIBLINGS; 100 102 if(dwStyle & WS_CLIPCHILDREN_W) 101 *OSWinStyle |= WS_CLIPCHILDREN;103 *OSWinStyle |= WS_CLIPCHILDREN; 102 104 if(dwStyle & WS_MAXIMIZE_W) 103 *OSWinStyle |= WS_MAXIMIZED;105 *OSWinStyle |= WS_MAXIMIZED; 104 106 if(dwStyle & WS_GROUP_W) 105 *OSWinStyle |= WS_GROUP;107 *OSWinStyle |= WS_GROUP; 106 108 if(dwStyle & WS_TABSTOP_W) 107 *OSWinStyle |= WS_TABSTOP;109 *OSWinStyle |= WS_TABSTOP; 108 110 109 111 if(dwStyle & WS_CAPTION_W) 110 *OSFrameStyle |= FCF_TITLEBAR;112 *OSFrameStyle |= FCF_TITLEBAR; 111 113 if(dwStyle & WS_DLGFRAME_W) 112 *OSFrameStyle |= FCF_DLGBORDER;114 *OSFrameStyle |= FCF_DLGBORDER; 113 115 else 114 116 if(dwStyle & WS_BORDER_W) 115 *OSFrameStyle |= FCF_BORDER;117 *OSFrameStyle |= FCF_BORDER; 116 118 117 119 if(dwStyle & WS_VSCROLL_W) 118 *OSFrameStyle |= FCF_VERTSCROLL;120 *OSFrameStyle |= FCF_VERTSCROLL; 119 121 if(dwStyle & WS_HSCROLL_W) 120 *OSFrameStyle |= FCF_HORZSCROLL;122 *OSFrameStyle |= FCF_HORZSCROLL; 121 123 if(dwStyle & WS_SYSMENU_W) 122 *OSFrameStyle |= FCF_SYSMENU;124 *OSFrameStyle |= FCF_SYSMENU; 123 125 if(dwStyle & WS_THICKFRAME_W) 124 *OSFrameStyle |= FCF_SIZEBORDER;//??126 *OSFrameStyle |= FCF_SIZEBORDER; //?? 125 127 if(dwStyle & WS_MINIMIZEBOX_W) 126 *OSFrameStyle |= FCF_MINBUTTON;128 *OSFrameStyle |= FCF_MINBUTTON; 127 129 if(dwStyle & WS_MAXIMIZEBOX_W) 128 *OSFrameStyle |= FCF_MAXBUTTON;130 *OSFrameStyle |= FCF_MAXBUTTON; 129 131 130 132 if(dwExStyle & WS_EX_DLGMODALFRAME_W) 131 *OSFrameStyle |= FCF_DLGBORDER;133 *OSFrameStyle |= FCF_DLGBORDER; 132 134 133 135 return TRUE; … … 224 226 //****************************************************************************** 225 227 BOOL OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx, 226 LONG cy, ULONG fl)228 LONG cy, ULONG fl) 227 229 { 228 230 HWND hwndParent = hwndInsertBehind; … … 230 232 231 233 if(fl & SWP_MOVE) { 232 switch(hwndParent)233 {234 case HWNDOS_TOP:235 case HWNDOS_BOTTOM:236 hwndParent = HWND_DESKTOP;237 break;238 }239 y = MapOS2ToWin32Y(hwndParent, cy, y);234 switch(hwndParent) 235 { 236 case HWNDOS_TOP: 237 case HWNDOS_BOTTOM: 238 hwndParent = HWND_DESKTOP; 239 break; 240 } 241 y = MapOS2ToWin32Y(hwndParent, cy, y); 240 242 } 241 243 rc = WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl); … … 250 252 251 253 if(fl & SWP_SHOW) { 252 rc = WinShowWindow(hwnd, TRUE);254 rc = WinShowWindow(hwnd, TRUE); 253 255 } 254 256 if(rc == 0) 255 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));257 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB()))); 256 258 rc = WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, fl); 257 259 if(rc == 0) 258 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB())));260 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB()))); 259 261 return rc; 260 262 } … … 269 271 BOOL OSLibWinQueryWindowRect(HWND hwnd, PRECT pRect, int RelativeTo) 270 272 { 271 BOOL rc;273 BOOL rc; 272 274 RECTLOS2 rectl; 273 275 274 276 rc = WinQueryWindowRect(hwnd, (PRECTL)&rectl); 275 277 if(rc) { 276 if(RelativeTo == RELATIVE_TO_SCREEN) {277 MapOS2ToWin32Rectl(OSLIB_HWND_DESKTOP, hwnd, &rectl, pRect);278 }279 elseMapOS2ToWin32Rectl(&rectl, pRect);280 } 281 else memset(pRect, 0, sizeof(RECT));278 if(RelativeTo == RELATIVE_TO_SCREEN) { 279 MapOS2ToWin32Rectl(OSLIB_HWND_DESKTOP, hwnd, &rectl, pRect); 280 } 281 else MapOS2ToWin32Rectl(&rectl, pRect); 282 } 283 else memset(pRect, 0, sizeof(RECT)); 282 284 return rc; 283 285 } … … 291 293 rc = WinQueryWindowPos(hwnd, &swp); 292 294 if(rc == FALSE) { 293 dprintf(("OSLibWinIsIconic: WinQueryWindowPos %x failed", hwnd));294 return FALSE;295 dprintf(("OSLibWinIsIconic: WinQueryWindowPos %x failed", hwnd)); 296 return FALSE; 295 297 } 296 298 297 299 if(swp.fl & SWP_MINIMIZE) 298 return TRUE;299 else return FALSE;300 return TRUE; 301 else return FALSE; 300 302 } 301 303 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.
