Changeset 2433 for trunk/src/user32/new/win32wbase.cpp
- Timestamp:
- Jan 13, 2000, 9:11:39 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/win32wbase.cpp
r2426 r2433 1 /* $Id: win32wbase.cpp,v 1.3 8 2000-01-13 13:54:53sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.39 2000-01-13 20:11:37 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 13 13 * 14 14 * TODO: Not thread/process safe 15 * 16 * NOTE: Client rectangle always relative to frame window; window rectangle in screen coordinates 15 17 * 16 18 * Project Odin Software License can be found in LICENSE.TXT … … 639 641 // Subclass frame 640 642 pOldFrameProc = FrameSubclassFrameWindow(this); 641 //if (isChild()) FrameSetBorderSize(this,TRUE);642 643 643 644 //preset rects … … 647 648 rectWindow.bottom = cs->y+cs->cy; 648 649 rectClient = rectWindow; //dummy client rect 650 OffsetRect(&rectClient, -rectClient.left, -rectClient.top); 651 649 652 if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow); 650 653 /* Send the WM_CREATE message … … 660 663 if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs)) 661 664 { 665 RECT tmpRect; 666 662 667 //update rect 663 668 rectWindow.left = cs->x; … … 665 670 rectWindow.top = cs->y; 666 671 rectWindow.bottom = cs->y+cs->cy; 672 tmpRect = rectWindow; 667 673 if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow); 668 674 OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top); 675 669 676 rectClient = rectWindow; 670 if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rectClient); 677 OffsetRect(&rectClient, -rectClient.left, -rectClient.top); 678 671 679 //set the window size and update the client 672 SetWindowPos(hwndLinkAfter, rectClient.left,rectClient.top,rectClient.right-rectClient.left,rectClient.bottom-rectClient.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED);680 SetWindowPos(hwndLinkAfter, tmpRect.left, tmpRect.top, tmpRect.right-tmpRect.left, tmpRect.bottom-tmpRect.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED); 673 681 fNoSizeMsg = FALSE; 674 682 if (cs->style & WS_VISIBLE) dwStyle |= WS_VISIBLE; //program could change position in WM_CREATE … … 679 687 MAKELONG(rectClient.right-rectClient.left, 680 688 rectClient.bottom-rectClient.top)); 681 SendInternalMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) ); 689 DWORD lParam; 690 691 if(getParent()) {//in parent coordinates 692 POINT point; 693 694 point.x = rectClient.left; 695 point.y = rectClient.top; 696 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1); 697 698 lParam = MAKELONG(point.x, point.y); 699 } 700 else {//in screen coordinates 701 lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top); 702 } 703 SendInternalMessageA(WM_MOVE, 0, lParam); 682 704 } 683 705 … … 1036 1058 RECT client = rectClient; 1037 1059 1038 mapWin32Rect(getParent() ? getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,OS2HwndFrame,&client);1060 //// mapWin32Rect(getParent() ? getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,OS2HwndFrame,&client); 1039 1061 if ((rect.left >= client.left) && (rect.left < client.right) && 1040 1062 (rect.right >= client.left) && (rect.right < client.right) && … … 1405 1427 case WM_WINDOWPOSCHANGED: 1406 1428 { 1407 1408 /* undocumented SWP flags - from SDK 3.1 */1409 #define SWP_NOCLIENTSIZE 0x08001410 #define SWP_NOCLIENTMOVE 0x10001411 1412 1429 PWINDOWPOS wpos = (PWINDOWPOS)lParam; 1413 1430 WPARAM wp = SIZE_RESTORED; 1414 1431 1415 1432 if (!(wpos->flags & SWP_NOMOVE) && !(wpos->flags & SWP_NOCLIENTMOVE)) 1416 SendInternalMessageA(WM_MOVE, 0, MAKELONG(rectClient.left, rectClient.top)); 1417 1433 { 1434 DWORD lParam; 1435 1436 if(getParent()) {//in parent coordinates 1437 POINT point; 1438 1439 point.x = rectClient.left; 1440 point.y = rectClient.top; 1441 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1); 1442 1443 lParam = MAKELONG(point.x, point.y); 1444 } 1445 else {//in screen coordinates 1446 lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top); 1447 } 1448 SendInternalMessageA(WM_MOVE, 0, lParam); 1449 } 1418 1450 if (!(wpos->flags & SWP_NOSIZE) && !(wpos->flags & SWP_NOCLIENTSIZE)) 1419 1451 { … … 1422 1454 1423 1455 SendInternalMessageA(WM_SIZE, wp, MAKELONG(rectClient.right - rectClient.left, 1424 rectClient.bottom - rectClient.top));1456 rectClient.bottom - rectClient.top)); 1425 1457 } 1426 1458 return 0; … … 1939 1971 1940 1972 dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow)); 1941 #if 1 1973 1942 1974 if (flags & WIN_NEED_SIZE) 1943 1975 { … … 1955 1987 MAKELONG(rectClient.right-rectClient.left, 1956 1988 rectClient.bottom-rectClient.top)); 1957 SendInternalMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) ); 1958 } 1959 #else 1960 if(fFirstShow) { 1961 if(isFrameWindow() && IS_OVERLAPPED(getStyle()) && !isChild()) { 1962 SendInternalMessageA(WM_SIZE, SIZE_RESTORED, 1963 MAKELONG(rectClient.right-rectClient.left, 1964 rectClient.bottom-rectClient.top)); 1965 SendInternalMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) ); 1966 1967 } 1968 fFirstShow = FALSE; 1969 } 1970 #endif 1989 DWORD lParam; 1990 1991 if(getParent()) {//in parent coordinates 1992 POINT point; 1993 1994 point.x = rectClient.left; 1995 point.y = rectClient.top; 1996 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1); 1997 1998 lParam = MAKELONG(point.x, point.y); 1999 } 2000 else {//in screen coordinates 2001 lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top); 2002 } 2003 SendInternalMessageA(WM_MOVE, 0, lParam); 2004 } 1971 2005 switch(nCmdShow) 1972 2006 {
Note:
See TracChangeset
for help on using the changeset viewer.