- Timestamp:
- Jun 7, 2000, 11:45:52 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r3662 r3663 1 /* $Id: win32wbase.cpp,v 1.19 8 2000-06-07 14:51:30 sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.199 2000-06-07 21:45:50 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 1158 1158 //****************************************************************************** 1159 1159 //****************************************************************************** 1160 BOOL Win32BaseWindow::isDesktopWindow() 1161 { 1162 return FALSE; 1163 } 1164 //****************************************************************************** 1165 //****************************************************************************** 1160 1166 BOOL Win32BaseWindow::IsWindowIconic() 1161 1167 { … … 2395 2401 Win32BaseWindow *Win32BaseWindow::getParent() 2396 2402 { 2397 Win32BaseWindow *wndparent = (Win32BaseWindow *)ChildWindow:: GetParent();2403 Win32BaseWindow *wndparent = (Win32BaseWindow *)ChildWindow::getParentOfChild(); 2398 2404 return ((ULONG)wndparent == (ULONG)windowDesktop) ? NULL : wndparent; 2399 2405 } … … 2402 2408 HWND Win32BaseWindow::GetParent() 2403 2409 { 2410 if((!(getStyle() & (WS_POPUP|WS_CHILD)))) { 2411 return 0; 2412 } 2413 2414 Win32BaseWindow *wndparent = (Win32BaseWindow *)ChildWindow::getParentOfChild(); 2415 2404 2416 if(getStyle() & WS_CHILD) { 2405 if( getParent()) {2406 return getParent()->getWindowHandle();2417 if(wndparent) { 2418 return wndparent->getWindowHandle(); 2407 2419 } 2420 dprintf(("WARNING: GetParent: WS_CHILD but no parent!!")); 2408 2421 DebugInt3(); 2409 2422 return 0; … … 2417 2430 HWND oldhwnd; 2418 2431 Win32BaseWindow *newparent; 2419 Win32BaseWindow *oldparent = (Win32BaseWindow *)ChildWindow:: GetParent();2432 Win32BaseWindow *oldparent = (Win32BaseWindow *)ChildWindow::getParentOfChild(); 2420 2433 BOOL fShow = FALSE; 2421 2434 2422 2435 if(oldparent) { 2423 2436 oldhwnd = oldparent->getWindowHandle(); 2424 oldparent-> RemoveChild(this);2437 oldparent->removeChild(this); 2425 2438 } 2426 2439 else oldhwnd = 0; … … 2434 2447 2435 2448 newparent = GetWindowFromHandle(hwndNewParent); 2436 if(newparent )2449 if(newparent && !newparent->isDesktopWindow()) 2437 2450 { 2438 2451 setParent(newparent); 2439 getParent()-> AddChild(this);2452 getParent()->addChild(this); 2440 2453 OSLibWinSetParent(getOS2WindowHandle(), getParent()->getOS2WindowHandle()); 2454 if(!(getStyle() & WS_CHILD)) 2455 { 2456 //TODO: Send WM_STYLECHANGED msg? 2457 setStyle(getStyle() | WS_CHILD); 2458 if(getWindowId()) 2459 { 2460 DestroyMenu( (HMENU) getWindowId() ); 2461 setWindowId(0); 2462 } 2463 } 2441 2464 } 2442 2465 else { 2443 2466 setParent(windowDesktop); 2444 windowDesktop-> AddChild(this);2467 windowDesktop->addChild(this); 2445 2468 OSLibWinSetParent(getOS2WindowHandle(), OSLIB_HWND_DESKTOP); 2469 2470 //TODO: Send WM_STYLECHANGED msg? 2471 setStyle(getStyle() & ~WS_CHILD); 2472 setWindowId(0); 2446 2473 } 2447 2474 /* SetParent additionally needs to make hwndChild the topmost window -
trunk/src/user32/win32wbase.h
r3662 r3663 1 /* $Id: win32wbase.h,v 1.9 7 2000-06-07 14:51:31sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.98 2000-06-07 21:45:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 156 156 virtual BOOL isMDIClient(); 157 157 virtual BOOL isMDIChild(); 158 virtual BOOL isDesktopWindow(); 158 159 159 160 BOOL fHasParentDC() { return fParentDC; }; 160 161 161 162 Win32BaseWindow *getParent(); 162 void setParent(Win32BaseWindow *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); };163 void setParent(Win32BaseWindow *pwindow) { setParentOfChild((ChildWindow *)pwindow); }; 163 164 WNDPROC getWindowProc() { return win32wndproc; }; 164 165 void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; }; -
trunk/src/user32/win32wdesktop.cpp
r3662 r3663 1 /* $Id: win32wdesktop.cpp,v 1.1 3 2000-06-07 14:51:33sandervl Exp $ */1 /* $Id: win32wdesktop.cpp,v 1.14 2000-06-07 21:45:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Desktop Window for OS/2 … … 72 72 } 73 73 //****************************************************************************** 74 //****************************************************************************** 75 BOOL Win32Desktop::isDesktopWindow() 76 { 77 return TRUE; 78 } 79 //****************************************************************************** 74 80 //Disabling the desktop is not a good idea (mouse no longer responds) 75 81 //****************************************************************************** -
trunk/src/user32/win32wdesktop.h
r2469 r3663 1 /* $Id: win32wdesktop.h,v 1. 6 2000-01-18 20:08:17sandervl Exp $ */1 /* $Id: win32wdesktop.h,v 1.7 2000-06-07 21:45:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Desktop Window for OS/2 … … 25 25 virtual BOOL EnableWindow(BOOL fEnable); 26 26 27 virtual BOOL isDesktopWindow(); 28 27 29 protected: 28 30 private: -
trunk/src/user32/win32wndchild.cpp
r2803 r3663 1 /* $Id: win32wndchild.cpp,v 1. 5 2000-02-16 14:28:25sandervl Exp $ */1 /* $Id: win32wndchild.cpp,v 1.6 2000-06-07 21:45:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Child/Parent window class for OS/2 … … 30 30 { 31 31 if(parent) { 32 parent-> RemoveChild(this);32 parent->removeChild(this); 33 33 } 34 34 //SvL: PM sends WM_DESTROY for all the children … … 43 43 //FIFO insertion 44 44 //****************************************************************************** 45 BOOL ChildWindow:: AddChild(ChildWindow *child)45 BOOL ChildWindow::addChild(ChildWindow *child) 46 46 { 47 47 ChildWindow *curchild; … … 67 67 //Remove child from linked list. Doesn't delete it! 68 68 //****************************************************************************** 69 BOOL ChildWindow:: RemoveChild(ChildWindow *child)69 BOOL ChildWindow::removeChild(ChildWindow *child) 70 70 { 71 71 ChildWindow *curchild = children; … … 99 99 //****************************************************************************** 100 100 //****************************************************************************** 101 BOOL ChildWindow:: DestroyChildren()101 BOOL ChildWindow::destroyChildren() 102 102 { 103 103 while(children) { -
trunk/src/user32/win32wndchild.h
r2469 r3663 1 /* $Id: win32wndchild.h,v 1. 4 2000-01-18 20:08:17sandervl Exp $ */1 /* $Id: win32wndchild.h,v 1.5 2000-06-07 21:45:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Child/Parent window class for OS/2 … … 28 28 protected: 29 29 30 ChildWindow * GetParent(){ return parent; };31 ChildWindow * SetParent(ChildWindow *newParent)30 ChildWindow *getParentOfChild() { return parent; }; 31 ChildWindow *setParentOfChild(ChildWindow *newParent) 32 32 { 33 33 ChildWindow *oldparent = parent; … … 37 37 } 38 38 39 BOOL AddChild(ChildWindow *child);40 BOOL RemoveChild(ChildWindow *child);39 BOOL addChild(ChildWindow *child); 40 BOOL removeChild(ChildWindow *child); 41 41 42 42 void setNextChild(ChildWindow *child) { nextchild = child; }; 43 43 44 BOOL DestroyChildren();44 BOOL destroyChildren(); 45 45 46 46 private: -
trunk/src/user32/window.cpp
r3662 r3663 1 /* $Id: window.cpp,v 1.6 8 2000-06-07 14:51:33sandervl Exp $ */1 /* $Id: window.cpp,v 1.69 2000-06-07 21:45:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 318 318 return 0; 319 319 } 320 if(window->isDesktopWindow()) { 321 dprintf(("WARNING: Trying to destroy desktop window!")); 322 return FALSE; 323 } 320 324 return window->DestroyWindow(); 321 325 } … … 353 357 HWND WIN32API SetParent( HWND hwndChild, HWND hwndNewParent) 354 358 { 355 Win32BaseWindow *window ;359 Win32BaseWindow *window, *parent; 356 360 357 361 window = Win32BaseWindow::GetWindowFromHandle(hwndChild); … … 360 364 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 361 365 return 0; 366 } 367 if(hwndNewParent == HWND_DESKTOP) { 368 hwndNewParent = GetDesktopWindow(); 369 } 370 else { 371 parent = Win32BaseWindow::GetWindowFromHandle(hwndNewParent); 372 if(!window) { 373 dprintf(("SetParent, parent %x not found", hwndNewParent)); 374 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 375 return 0; 376 } 362 377 } 363 378 dprintf(("SetParent %x %x", hwndChild, hwndNewParent));
Note:
See TracChangeset
for help on using the changeset viewer.