- Timestamp:
- Oct 15, 1999, 3:52:56 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/pmwindow.cpp
r1306 r1311 1 /* $Id: pmwindow.cpp,v 1. 29 1999-10-15 09:26:22sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.30 1999-10-15 13:52:54 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 261 261 262 262 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 263 if (win32wnd->isChild()) 264 hParent = win32wnd->getParent()->getOS2WindowHandle(); 263 if (win32wnd->isChild()) { 264 if(win32wnd->getParent()) { 265 hParent = win32wnd->getParent()->getOS2WindowHandle(); 266 } 267 else break; 268 } 265 269 else 266 270 hFrame = win32wnd->getOS2FrameWindowHandle(); … … 294 298 295 299 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 296 if (win32wnd->isChild()) 297 hParent = win32wnd->getParent()->getOS2WindowHandle(); 300 if (win32wnd->isChild()) { 301 if(win32wnd->getParent()) { 302 hParent = win32wnd->getParent()->getOS2WindowHandle(); 303 } 304 else goto RunDefWndProc; //parent has just been destroyed 305 } 298 306 else 299 307 hFrame = WinQueryWindow(hwnd, QW_PARENT); -
trunk/src/user32/win32wbase.cpp
r1307 r1311 1 /* $Id: win32wbase.cpp,v 1.4 4 1999-10-15 10:03:15sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.45 1999-10-15 13:52:54 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 101 101 fInternalMsg = FALSE; 102 102 fNoSizeMsg = FALSE; 103 fIsDestroyed = FALSE; 103 104 104 105 windowNameA = NULL; … … 161 162 Win32BaseWindow::~Win32BaseWindow() 162 163 { 163 OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, 0); 164 OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, 0); 165 166 if (isOwnDC()) 164 OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, 0); 165 OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, 0); 166 167 if(getParent() && getParent()->getFirstChild() == this && getNextChild() == NULL) 168 { 169 //if we're the last child that's being destroyed and our 170 //parent window was also destroyed, then we delete the parent object 171 if(getParent()->IsWindowDestroyed()) 172 { 173 dprintf(("Last Child (%x) destroyed, get rid of our parent window (%x)", getWindowHandle(), getParent()->getWindowHandle())); 174 delete getParent(); 175 setParent(NULL); //or else we'll crash in the dtor of the ChildWindow class 176 } 177 } 178 if (isOwnDC()) 167 179 releaseOwnDC (ownDC); 168 180 169 if(Win32Hwnd)181 if(Win32Hwnd) 170 182 HwFreeWindowHandle(Win32Hwnd); 171 183 172 if(userWindowLong)184 if(userWindowLong) 173 185 free(userWindowLong); 174 if(windowNameA) {186 if(windowNameA) { 175 187 free(windowNameA); 176 188 windowNameA = NULL; 177 }178 if(windowNameW) {189 } 190 if(windowNameW) { 179 191 free(windowNameW); 180 192 windowNameW = NULL; 181 }182 if(vertScrollInfo) {193 } 194 if(vertScrollInfo) { 183 195 free(vertScrollInfo); 184 196 vertScrollInfo = NULL; 185 }186 if(horzScrollInfo) {197 } 198 if(horzScrollInfo) { 187 199 free(horzScrollInfo); 188 200 horzScrollInfo = NULL; 189 }201 } 190 202 //TODO: Destroy windows if they're not associated with our window anymore (showwindow false)? 191 203 // hwndHorzScroll … … 197 209 BOOL Win32BaseWindow::isChild() 198 210 { 199 return ( dwStyle & WS_CHILD) != 0;211 return ((dwStyle & WS_CHILD) != 0); 200 212 } 201 213 //****************************************************************************** … … 655 667 return 0; //app handles this message 656 668 } 657 delete this;658 669 return 1; 659 670 } … … 663 674 { 664 675 ULONG rc; 665 666 rc = SendInternalMessageA(WM_DESTROY, 0, 0); 667 delete this; 668 return rc; 676 Win32BaseWindow *child; 677 678 //According to the SDK, WM_PARENTNOTIFY messages are sent to the parent (this window) 679 //before any window destruction has begun 680 child = (Win32BaseWindow *)getFirstChild(); 681 while(child) { 682 child->NotifyParent(WM_DESTROY, 0, 0); 683 684 child = (Win32BaseWindow *)child->getNextChild(); 685 } 686 SendInternalMessageA(WM_DESTROY, 0, 0); 687 688 fIsDestroyed = TRUE; 689 if(getFirstChild() == NULL) { 690 delete this; 691 } 692 return 1; 669 693 } 670 694 //****************************************************************************** … … 1661 1685 1662 1686 case WM_DESTROY: 1687 win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0); 1663 1688 rc = win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0); 1664 1689 break; … … 1714 1739 case WM_DESTROY: 1715 1740 win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0); 1716 NotifyParent(Msg, wParam, lParam);1717 1741 rc = win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0); 1718 1742 break; … … 1762 1786 case WM_DESTROY: 1763 1787 win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0); 1764 NotifyParent(Msg, wParam, lParam);1765 1788 rc = win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0); 1766 1789 break; … … 1810 1833 case WM_DESTROY: 1811 1834 win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0); 1812 NotifyParent(Msg, wParam, lParam);1813 1835 rc = win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0); 1814 1836 break; -
trunk/src/user32/win32wbase.h
r1281 r1311 1 /* $Id: win32wbase.h,v 1.2 2 1999-10-14 09:22:42sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.23 1999-10-15 13:52:55 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 163 163 BOOL IsDialog() { return fIsDialog; }; 164 164 165 BOOL IsWindowDestroyed() { return fIsDestroyed; }; 165 166 BOOL IsWindowEnabled(); 166 167 BOOL IsWindowVisible(); … … 247 248 //sent by PM and those sent by apps 248 249 BOOL fNoSizeMsg; 250 BOOL fIsDestroyed; 249 251 250 252 PVOID pOldFrameProc; -
trunk/src/user32/win32wndchild.cpp
r949 r1311 1 /* $Id: win32wndchild.cpp,v 1. 1 1999-09-15 23:19:02sandervl Exp $ */1 /* $Id: win32wndchild.cpp,v 1.2 1999-10-15 13:52:56 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Child/Parent window class for OS/2 … … 29 29 parent->RemoveChild(this); 30 30 } 31 //SvL: PM sends WM_DESTROY for all the children 32 #if 0 31 33 if(children != 0) { 32 34 dprintf(("ChildWindow::~ChildWindow children not yet destroyed!!")); 33 35 DestroyChildren(); 34 36 } 37 #endif 35 38 } 36 39 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.