Changeset 1337 for trunk/src/user32
- Timestamp:
- Oct 17, 1999, 6:42:40 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibwin.cpp
r1333 r1337 1 /* $Id: oslibwin.cpp,v 1.3 0 1999-10-17 12:17:43 cbratschiExp $ */1 /* $Id: oslibwin.cpp,v 1.31 1999-10-17 16:42:38 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 962 962 //****************************************************************************** 963 963 //****************************************************************************** 964 964 BOOL OSLibSetWindowRestoreRect(HWND hwnd, PRECT pRect) 965 { 966 ULONG yHeight = OSLibGetWindowHeight(WinQueryWindow(hwnd, QW_PARENT)); 967 968 WinSetWindowUShort(hwnd, QWS_XRESTORE, (USHORT)pRect->left ); 969 WinSetWindowUShort(hwnd, QWS_YRESTORE, (USHORT)(yHeight - pRect->top - 970 (pRect->bottom - pRect->top))); 971 WinSetWindowUShort(hwnd, QWS_CXRESTORE, (USHORT)(pRect->right - pRect->left)); 972 WinSetWindowUShort(hwnd, QWS_CYRESTORE, (USHORT)(pRect->bottom - pRect->top)); 973 return TRUE; 974 } 975 //****************************************************************************** 976 //****************************************************************************** 977 BOOL OSLibSetWindowMinPos(HWND hwnd, ULONG x, ULONG y) 978 { 979 ULONG yHeight = OSLibGetWindowHeight(WinQueryWindow(hwnd, QW_PARENT)); 980 981 WinSetWindowUShort(hwnd, QWS_XMINIMIZE, (USHORT)x ); 982 WinSetWindowUShort(hwnd, QWS_YMINIMIZE, (USHORT)(yHeight - y - 983 ( 2 * WinQuerySysValue( HWND_DESKTOP, SV_CYSIZEBORDER)) - 984 WinQuerySysValue( HWND_DESKTOP, SV_CYICON))); 985 return TRUE; 986 } 987 //****************************************************************************** 988 //****************************************************************************** -
trunk/src/user32/oslibwin.h
r1333 r1337 1 /* $Id: oslibwin.h,v 1.1 7 1999-10-17 12:17:43 cbratschiExp $ */1 /* $Id: oslibwin.h,v 1.18 1999-10-17 16:42:39 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 275 275 PVOID OSLibWinSubclassWindow(HWND hwnd,PVOID newWndProc); 276 276 277 BOOL OSLibSetWindowRestoreRect(HWND hwnd, PRECT pRect); 278 BOOL OSLibSetWindowMinPos(HWND hwnd, ULONG x, ULONG y); 279 277 280 #endif //__OSLIBWIN_H__ -
trunk/src/user32/win32wbase.cpp
r1336 r1337 1 /* $Id: win32wbase.cpp,v 1. 49 1999-10-17 15:46:09 sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.50 1999-10-17 16:42:39 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 726 726 if (isSubclassedOS2Wnd) OSLibWinSubclassWindow(OS2Hwnd,pOldWndProc); 727 727 728 fIsDestroyed = TRUE; 728 729 //According to the SDK, WM_PARENTNOTIFY messages are sent to the parent (this window) 729 730 //before any window destruction has begun … … 739 740 if (hwndVertScroll && OSLibWinQueryWindow(hwndVertScroll,QWOS_PARENT) == OSLIB_HWND_OBJECT) OSLibWinDestroyWindow(hwndVertScroll); 740 741 741 fIsDestroyed = TRUE;742 742 if(getFirstChild() == NULL) { 743 743 delete this; … … 846 846 WORD fwSizeType = 0; 847 847 848 dwStyle &= ~(WS_MINIMIZE|WS_MAXIMIZE); 848 849 if(fMinimize) { 849 850 fwSizeType = SIZE_MINIMIZED; 851 dwStyle |= WS_MINIMIZE; 850 852 } 851 853 else 852 854 if(fMaximize) { 853 855 fwSizeType = SIZE_MAXIMIZED; 856 dwStyle |= WS_MAXIMIZE; 854 857 } 855 858 else fwSizeType = SIZE_RESTORED; … … 1005 1008 // bit 24, 1=extended key 1006 1009 // bit 25-28, reserved 1007 // bit 29, key is released, always 1 for WM_SYSKEYUP ?? <- conflict according to the MS docs1010 // bit 29, key is released, always 1 for WM_SYSKEYUP ?? <- conflict according to the MS docs 1008 1011 if (keyWasPressed) 1009 1012 lParam |= 1 << 30; // bit 30, previous state, 1 means key was pressed … … 1884 1887 { 1885 1888 /* should happen only in CreateWindowEx() */ 1886 1887 1888 1889 1890 1891 1892 1893 1894 1889 int wParam = SIZE_RESTORED; 1890 1891 flags &= ~WIN_NEED_SIZE; 1892 if (dwStyle & WS_MAXIMIZE) 1893 wParam = SIZE_MAXIMIZED; 1894 else 1895 if (dwStyle & WS_MINIMIZE) 1896 wParam = SIZE_MINIMIZED; 1897 1895 1898 SendMessageA(WM_SIZE, wParam, 1896 1899 MAKELONG(rectClient.right-rectClient.left, … … 2045 2048 } 2046 2049 //****************************************************************************** 2050 //TODO: WPF_RESTOREMAXIMIZED 2051 //****************************************************************************** 2052 BOOL Win32BaseWindow::SetWindowPlacement(WINDOWPLACEMENT *winpos) 2053 { 2054 if(isFrameWindow()) 2055 { 2056 // Set the minimized position 2057 if (winpos->flags & WPF_SETMINPOSITION) 2058 { 2059 OSLibSetWindowMinPos(OS2HwndFrame, winpos->ptMinPosition.x, winpos->ptMinPosition.y); 2060 } 2061 2062 //TODO: Max position 2063 2064 // Set the new restore position. 2065 OSLibSetWindowRestoreRect(OS2HwndFrame, &winpos->rcNormalPosition); 2066 } 2067 2068 return ShowWindow(winpos->showCmd); 2069 } 2070 //****************************************************************************** 2047 2071 //Also destroys all the child windows (destroy parent, destroy children) 2048 2072 //****************************************************************************** … … 2247 2271 } 2248 2272 break; 2249 2273 2250 2274 case GW_HWNDLAST: 2251 2275 if(getParent()) … … 2261 2285 hwndRelated = window->getWindowHandle(); 2262 2286 break; 2263 2287 2264 2288 case GW_HWNDNEXT: 2265 2289 window = (Win32BaseWindow *)getNextChild(); … … 2268 2292 } 2269 2293 break; 2270 2294 2271 2295 case GW_HWNDPREV: 2272 2296 if(!getParent()) … … 2290 2314 } 2291 2315 break; 2292 2316 2293 2317 case GW_OWNER: 2294 2318 if(getOwner()) { … … 2446 2470 ss.styleOld = dwExStyle; 2447 2471 ss.styleNew = value; 2448 dprintf(("SetWindowLong GWL_EXSTYLE %x new style %x", getWindowHandle(), value));2472 dprintf(("SetWindowLong GWL_EXSTYLE %x new style %x", getWindowHandle(), value)); 2449 2473 SendMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss); 2450 2474 setExStyle(ss.styleNew); … … 2458 2482 ss.styleOld = dwStyle; 2459 2483 ss.styleNew = value; 2460 dprintf(("SetWindowLong GWL_STYLE %x new style %x", getWindowHandle(), value));2484 dprintf(("SetWindowLong GWL_STYLE %x new style %x", getWindowHandle(), value)); 2461 2485 SendMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss); 2462 2486 setStyle(ss.styleNew); 2463 OSLibSetWindowStyle(OS2HwndFrame, dwStyle); 2487 if(!IsWindowDestroyed()) 2488 OSLibSetWindowStyle(OS2HwndFrame, dwStyle); 2464 2489 SendMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss); 2465 2490 return ss.styleOld; -
trunk/src/user32/win32wbase.h
r1336 r1337 1 /* $Id: win32wbase.h,v 1.2 7 1999-10-17 15:46:10 sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.28 1999-10-17 16:42:40 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 148 148 BOOL ShowWindow(ULONG nCmdShow); 149 149 BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags); 150 BOOL SetWindowPlacement(WINDOWPLACEMENT *winpos); 150 151 BOOL DestroyWindow(); 151 152 HWND SetActiveWindow(); -
trunk/src/user32/window.cpp
r1336 r1337 1 /* $Id: window.cpp,v 1.1 7 1999-10-17 15:46:10 sandervl Exp $ */1 /* $Id: window.cpp,v 1.18 1999-10-17 16:42:40 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 147 147 { 148 148 sprintf(tmpClassA,"#%d", (int) className); 149 149 AsciiToUnicode(tmpClassA, tmpClassW); 150 150 classAtom = GlobalFindAtomW(tmpClassW); 151 151 className = (LPCWSTR)tmpClassW; … … 463 463 if(!window) { 464 464 dprintf(("SetWindowPos, window %x not found", hwnd)); 465 SetLastError(ERROR_INVALID_WINDOW_HANDLE);465 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 466 466 return 0; 467 467 } … … 471 471 //****************************************************************************** 472 472 //****************************************************************************** 473 BOOL WIN32API SetWindowPlacement( HWND arg1, const WINDOWPLACEMENT * arg2) 474 { 475 dprintf(("USER32: SetWindowPlacement\n")); 476 return O32_SetWindowPlacement(arg1, arg2); 477 } 478 //****************************************************************************** 479 //****************************************************************************** 480 BOOL WIN32API GetWindowPlacement( HWND arg1, LPWINDOWPLACEMENT arg2) 481 { 482 #ifdef DEBUG 483 WriteLog("USER32: GetWindowPlacement\n"); 484 #endif 485 return O32_GetWindowPlacement(arg1, arg2); 473 BOOL WIN32API SetWindowPlacement(HWND hwnd, const WINDOWPLACEMENT *winpos) 474 { 475 Win32BaseWindow *window; 476 477 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 478 if(!window) { 479 dprintf(("SetWindowPlacement, window %x not found", hwnd)); 480 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 481 return 0; 482 } 483 return window->SetWindowPlacement((WINDOWPLACEMENT *)winpos); 484 } 485 //****************************************************************************** 486 //****************************************************************************** 487 BOOL WIN32API GetWindowPlacement(HWND hwnd, LPWINDOWPLACEMENT arg2) 488 { 489 dprintf(("USER32: GetWindowPlacement\n")); 490 return O32_GetWindowPlacement(Win32BaseWindow::Win32ToOS2FrameHandle(hwnd), arg2); 486 491 } 487 492 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.