- Timestamp:
- Jul 17, 1999, 5:23:38 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibwin.cpp
r322 r323 1 /* $Id: oslibwin.cpp,v 1. 7 1999-07-17 12:49:40 cbratschiExp $ */1 /* $Id: oslibwin.cpp,v 1.8 1999-07-17 15:23:38 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 38 38 //****************************************************************************** 39 39 HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle, 40 char *pszName, ULONG x, ULONG y, ULONG cx, ULONG cy, 41 HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame) 40 char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame) 42 41 { 43 42 HWND hwndClient; 44 43 RECTL rectl; 45 44 45 if(pszName && *pszName == 0) { 46 pszName = NULL; 47 } 46 48 if(hwndParent == 0) { 47 49 hwndParent = HWND_DESKTOP; 48 }49 if(WinQueryWindowRect(hwndParent, &rectl) == TRUE) {50 y = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, y);51 50 } 52 51 if(dwFrameStyle) { … … 59 58 WinSetWindowText(*hwndFrame, pszName); 60 59 } 61 WinSetWindowPos(*hwndFrame, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP,62 x, y, cx, cy, SWP_SIZE | SWP_MOVE);63 64 60 return hwndClient; 65 61 } … … 67 63 return 0; 68 64 } 69 hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, x, y, cx, cy,65 hwndClient = WinCreateWindow(hwndParent, WIN32_STDCLASS, pszName, dwWinStyle, 0, 0, 0, 0, 70 66 Owner, (fHWND_BOTTOM) ? HWND_BOTTOM :HWND_TOP, 0, NULL, 71 67 NULL); … … 83 79 if(dwStyle & WINWS_MINIMIZE) 84 80 *OSWinStyle |= WS_MINIMIZED; 81 //Done explicitely in CreateWindowExA 82 #if 0 85 83 if(dwStyle & WINWS_VISIBLE) 86 84 *OSWinStyle |= WS_VISIBLE; 85 #endif 87 86 if(dwStyle & WINWS_DISABLED) 88 87 *OSWinStyle |= WS_DISABLED; … … 178 177 LONG cy, ULONG fl) 179 178 { 179 RECTL rectl; 180 HWND hwndParent; 181 182 if(fl & SWP_MOVE) { 183 hwndParent = WinQueryWindow(hwnd, QW_PARENT); 184 if(WinQueryWindowRect(hwnd, &rectl)) { 185 y = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, y); 186 } 187 } 180 188 return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl); 181 189 } … … 184 192 BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl) 185 193 { 186 return WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl); 194 BOOL rc; 195 196 if(fl & SWP_SHOW) { 197 rc = WinShowWindow(hwnd, TRUE); 198 } 199 if(rc == 0) 200 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB()))); 201 rc = WinSetWindowPos(hwnd, 0, 0, 0, 0, 0, fl); 202 if(rc == 0) 203 dprintf(("WinShowWindow %x failed %x", hwnd, WinGetLastError(GetThreadHAB()))); 204 return rc; 187 205 } 188 206 //****************************************************************************** -
trunk/src/user32/new/oslibwin.h
r322 r323 1 /* $Id: oslibwin.h,v 1. 6 1999-07-17 12:49:41 cbratschiExp $ */1 /* $Id: oslibwin.h,v 1.7 1999-07-17 15:23:38 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 20 20 21 21 HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle, 22 char *pszName, ULONG x, ULONG y, ULONG cx, ULONG cy, 23 HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame); 22 char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame); 24 23 25 24 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle); -
trunk/src/user32/new/pmwindow.cpp
r319 r323 1 /* $Id: pmwindow.cpp,v 1. 5 1999-07-17 09:17:58 sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.6 1999-07-17 15:23:38 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 35 35 { 36 36 hab = WinInitialize(0); 37 dprintf(("Winitialize returned %x", hab)); 37 38 hmq = WinCreateMsgQueue(hab, 0); 38 39 39 if(!hab || !hmq) { 40 if(!hab || !hmq) 41 { 40 42 UINT error; 41 43 … … 44 46 if (!hab || error != PMERR_MSG_QUEUE_ALREADY_EXISTS) 45 47 { 46 dprintf(("WinInitialize or WinCreateMsgQueue failed %x %x", hab, hmq)); 47 dprintf((" Error = %x",error)); 48 return(FALSE); 49 } else 48 dprintf(("WinInitialize or WinCreateMsgQueue failed %x %x", hab, hmq)); 49 dprintf((" Error = %x",error)); 50 return(FALSE); 51 } 52 else 50 53 { 51 //CB: get queue handle (todo) 54 if(!hab) { 55 hab = WinQueryAnchorBlock(HWND_DESKTOP); 56 dprintf(("WinQueryAnchorBlock returned %x", hab)); 57 } 58 if(!hmq) { 59 hmq = HMQ_CURRENT; 60 } 52 61 } 53 62 } 54 63 SetThreadHAB(hab); 64 dprintf(("InitPM: hmq = %x", hmq)); 55 65 SetThreadMessageQueue(hmq); 56 66 … … 113 123 case WM_CREATE: 114 124 //Processing is done in after WinCreateWindow returns 115 break; 125 dprintf(("OS2: WM_CREATE %x", hwnd)); 126 RestoreOS2TIB(); 127 return (MRESULT)FALSE; 116 128 117 129 case WM_QUIT: 130 dprintf(("OS2: WM_QUIT %x", hwnd)); 118 131 if(win32wnd->MsgQuit()) { 119 132 goto RunDefWndProc; … … 122 135 123 136 case WM_CLOSE: 137 dprintf(("OS2: WM_CLOSE %x", hwnd)); 124 138 if(win32wnd->MsgClose()) { 125 139 goto RunDefWndProc; … … 128 142 129 143 case WM_DESTROY: 144 dprintf(("OS2: WM_DESTROY %x", hwnd)); 130 145 if(win32wnd->MsgDestroy()) { 131 146 goto RunDefWndProc; … … 134 149 135 150 case WM_ENABLE: 151 dprintf(("OS2: WM_ENABLE %x", hwnd)); 136 152 if(win32wnd->MsgEnable((ULONG)mp1)) { 137 153 goto RunDefWndProc; … … 140 156 141 157 case WM_SHOW: 158 dprintf(("OS2: WM_SHOW %x", hwnd)); 142 159 if(win32wnd->MsgShow((ULONG)mp1)) { 143 160 goto RunDefWndProc; … … 152 169 ULONG xScreen, yScreen, yParent, xParent; 153 170 171 dprintf(("OS2: WM_MOVE %x", hwnd)); 154 172 rc = WinQueryWindowRect(hwnd, &rectl); 155 173 if(rc == TRUE) { … … 169 187 break; 170 188 } 171 yParent = point.x;189 xParent = point.x; 172 190 yParent = OS2TOWIN32POINT(rectl2.yTop - rectl2.yBottom, point.y); 173 191 } … … 207 225 case WM_ADJUSTWINDOWPOS: 208 226 { 209 // if(win32wnd->MsgWindowPosChanging(0, 0)) { 227 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x", hwnd)); 228 // if(win32wnd->MsgWindowPosChanging(0, 0)) { 229 goto RunDefWndProc; 230 // } 210 231 break; 211 232 } … … 215 236 HPS hps; 216 237 238 dprintf(("OS2: WM_ERASEBACKGROUND %x", hwnd)); 217 239 hps = WinGetPS(hwnd); 218 240 if(win32wnd->MsgEraseBackGround((ULONG)hps)) … … 232 254 SWP swp; 233 255 256 dprintf(("OS2: WM_SIZE %x", hwnd)); 234 257 rc = WinQueryWindowPos(hwnd, &swp); 235 258 if(rc == FALSE) { … … 251 274 HWND hwndActivate = (HWND)mp1; 252 275 276 dprintf(("OS2: WM_ACTIVATE %x", hwnd)); 253 277 if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) { 254 278 //another (non-win32) application's window … … 268 292 HWND hwndFocus = (HWND)mp1; 269 293 294 dprintf(("OS2: WM_SETFOCUS %x", hwnd)); 270 295 if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) { 271 296 //another (non-win32) application's window … … 360 385 361 386 case WM_PAINT: 387 dprintf(("OS2: WM_PAINT %x", hwnd)); 362 388 if(win32wnd->MsgPaint(0, 0)) { 363 389 goto RunDefWndProc; … … 393 419 break; 394 420 default: 421 dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd)); 395 422 RestoreOS2TIB(); 396 423 return WinDefWindowProc( hwnd, msg, mp1, mp2 ); … … 400 427 401 428 RunDefWndProc: 429 dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd)); 402 430 RestoreOS2TIB(); 403 431 return WinDefWindowProc( hwnd, msg, mp1, mp2 ); -
trunk/src/user32/new/win32wnd.cpp
r321 r323 1 /* $Id: win32wnd.cpp,v 1. 6 1999-07-17 11:52:23sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.7 1999-07-17 15:23:38 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 72 72 Win32Hwnd = 0; 73 73 74 //CB: what does this code? Win32Hwnd is always 0!75 74 if(HMHandleAllocate(&Win32Hwnd, (ULONG)this) != 0) 76 75 { … … 335 334 OS2Hwnd = OSLibWinCreateWindow((getParent()) ? getParent()->getOS2WindowHandle() : 0, 336 335 dwOSWinStyle, dwOSFrameStyle, (char *)cs->lpszName, 337 cs->x, cs->y, cs->cx, cs->cy,338 336 (owner) ? owner->getOS2WindowHandle() : 0, 339 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, &OS2HwndFrame); 337 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, 338 &OS2HwndFrame); 340 339 341 340 if(OS2Hwnd == 0) { … … 351 350 return FALSE; 352 351 } 352 #if 0 353 353 if(OS2Hwnd != OS2HwndFrame) { 354 354 if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) { … … 361 361 } 362 362 } 363 #endif 363 364 /* Set the window menu */ 364 365 if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION ) … … 389 390 if( (sendMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 ) 390 391 { 391 /* Send the size messages */ 392 dprintf(("Sent WM_CREATE")); 393 394 if (!(flags & WIN_NEED_SIZE)) 395 { 396 /* send it anyway */ 397 if (((rectClient.right-rectClient.left) <0) 398 ||((rectClient.bottom-rectClient.top)<0)) 399 dprintf(("sending bogus WM_SIZE message 0x%08lx\n", 400 MAKELONG(rectClient.right-rectClient.left, 401 rectClient.bottom-rectClient.top))); 402 SendMessageA(WM_SIZE, SIZE_RESTORED, 403 MAKELONG(rectClient.right-rectClient.left, 404 rectClient.bottom-rectClient.top)); 405 SendMessageA(WM_MOVE, 0, 406 MAKELONG( rectClient.left, 407 rectClient.top ) ); 408 } 409 410 #if 0 411 /* Show the window, maximizing or minimizing if needed */ 412 413 if (dwStyle & (WS_MINIMIZE | WS_MAXIMIZE)) 414 { 415 RECT16 newPos; 416 UINT16 swFlag = (dwStyle & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE; 417 dwStyle &= ~(WS_MAXIMIZE | WS_MINIMIZE); 418 WINPOS_MinMaximize(swFlag, &newPos ); 419 swFlag = ((dwStyle & WS_CHILD) || GetActiveWindow()) 420 ? SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED 421 : SWP_NOZORDER | SWP_FRAMECHANGED; 422 SetWindowPos(0, newPos.left, newPos.top, 423 newPos.right, newPos.bottom, swFlag ); 424 } 425 #endif 426 427 if( dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) ) 428 { 429 /* Notify the parent window only */ 430 431 NotifyParent(WM_CREATE, 0, 0); 432 if( !IsWindow() ) 433 { 434 return FALSE; 435 } 436 } 392 SetWindowPos(HWND_TOP, rectClient.left, rectClient.top, 393 rectClient.right-rectClient.left, 394 rectClient.bottom-rectClient.top, 395 SWP_NOACTIVATE); 437 396 438 397 if (cs->style & WS_VISIBLE) ShowWindow( sw ); … … 802 761 if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) { 803 762 dprintf(("WM_NCCREATE returned FALSE\n")); 804 return( 0); //don't create window763 return(-1); //don't create window 805 764 } 806 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {807 dprintf(("WM_CREATE returned FALSE\n"));808 return( 0); //don't create window765 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == -1) { 766 dprintf(("WM_CREATE returned -1\n")); 767 return(-1); //don't create window 809 768 } 810 769 NotifyParent(Msg, wParam, lParam); 811 770 812 return( 1);771 return(0); 813 772 } 814 773 case WM_LBUTTONDOWN: … … 952 911 case SW_SHOW: 953 912 case SW_SHOWDEFAULT: //todo 954 showstate = SWPOS_SHOW ;913 showstate = SWPOS_SHOW | SWPOS_ACTIVATE; 955 914 break; 956 915 case SW_HIDE: 957 916 showstate = SWPOS_HIDE; 958 917 break; 918 case SW_RESTORE: 919 showstate = SWPOS_RESTORE | SWPOS_SHOW | SWPOS_ACTIVATE; 920 break; 959 921 case SW_MINIMIZE: 960 922 showstate = SWPOS_MINIMIZE; 961 923 break; 962 924 case SW_SHOWMAXIMIZED: 963 showstate = SWPOS_MAXIMIZE | SWPOS_SHOW ;925 showstate = SWPOS_MAXIMIZE | SWPOS_SHOW | SWPOS_ACTIVATE; 964 926 break; 965 927 case SW_SHOWMINIMIZED: 928 showstate = SWPOS_MINIMIZE | SWPOS_SHOW | SWPOS_ACTIVATE; 929 break; 930 case SW_SHOWMINNOACTIVE: 966 931 showstate = SWPOS_MINIMIZE | SWPOS_SHOW; 967 932 break; 968 case SW_SHOWMINNOACTIVE: //TODO 969 showstate = SWPOS_MINIMIZE | SWPOS_SHOW; 970 break; 971 case SW_SHOWNA: //TODO 933 case SW_SHOWNA: 972 934 showstate = SWPOS_SHOW; 973 935 break; 974 case SW_SHOWNOACTIVATE: //TODO936 case SW_SHOWNOACTIVATE: 975 937 showstate = SWPOS_SHOW; 976 938 break; 977 939 case SW_SHOWNORMAL: 978 showstate = SWPOS_RESTORE ;979 break; 980 } 981 return OSLibWinShowWindow(OS2Hwnd Frame, showstate);940 showstate = SWPOS_RESTORE | SWPOS_ACTIVATE | SWPOS_SHOW; 941 break; 942 } 943 return OSLibWinShowWindow(OS2Hwnd, showstate); 982 944 } 983 945 //****************************************************************************** … … 1031 993 setstate |= SWPOS_SHOW; 1032 994 1033 return OSLibWinSetWindowPos(OS2Hwnd Frame, hwndInsertAfter, x, y, cx, cy, setstate);995 return OSLibWinSetWindowPos(OS2Hwnd, hwndInsertAfter, x, y, cx, cy, setstate); 1034 996 } 1035 997 //****************************************************************************** … … 1110 1072 BOOL Win32Window::IsIconic() 1111 1073 { 1112 return OSLibWinIsIconic(OS2Hwnd Frame);1074 return OSLibWinIsIconic(OS2Hwnd); 1113 1075 } 1114 1076 //****************************************************************************** … … 1152 1114 else return 0; 1153 1115 } 1154 hwndRelated = OSLibWinQueryWindow(OS2Hwnd Frame, getcmd);1116 hwndRelated = OSLibWinQueryWindow(OS2Hwnd, getcmd); 1155 1117 if(hwndRelated) 1156 1118 { … … 1168 1130 HWND Win32Window::SetActiveWindow() 1169 1131 { 1170 return OSLibWinSetActiveWindow(OS2Hwnd Frame);1132 return OSLibWinSetActiveWindow(OS2Hwnd); 1171 1133 } 1172 1134 //****************************************************************************** … … 1175 1137 BOOL Win32Window::EnableWindow(BOOL fEnable) 1176 1138 { 1177 return OSLibWinEnableWindow(OS2Hwnd Frame, fEnable);1139 return OSLibWinEnableWindow(OS2Hwnd, fEnable); 1178 1140 } 1179 1141 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.