- Timestamp:
- Aug 31, 1999, 12:36:24 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/makefile
r743 r750 1 # $Id: makefile,v 1.3 7 1999-08-30 14:21:25sandervl Exp $1 # $Id: makefile,v 1.38 1999-08-31 10:36:22 sandervl Exp $ 2 2 3 3 # … … 31 31 controls.obj button.obj static.obj scroll.obj listbox.obj \ 32 32 combo.obj edit.obj clipboard.obj winicon.obj win32wmdiclient.obj \ 33 oslibutil.obj oslibmsg.obj dib.obj oslibdos.obj \33 oslibutil.obj oslibmsg.obj dib.obj oslibdos.obj win32wmdichild.obj \ 34 34 winprop.obj wingdi.obj oslibgdi.obj winaccel.obj winscrollbar.obj \ 35 35 nativerc.obj oslibres.obj dummy.obj \ … … 106 106 win32dlg.obj: win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h 107 107 win32wndchild.obj: win32wndchild.cpp win32wndchild.h 108 win32wmdiclient.obj: win32wmdiclient.cpp win32wmdiclient.h 108 win32wmdiclient.obj: win32wmdiclient.cpp win32wbase.h win32wmdiclient.h win32wmdichild.h 109 win32wmdichild.obj: win32wmdichild.cpp win32wbase.h win32wmdiclient.h win32wmdichild.h 109 110 gen_object.obj: gen_object.cpp gen_object.h heapshared.h 110 111 oslibwin.obj: oslibwin.cpp oslibwin.h oslibutil.h oslibgdi.h $(PDWIN32_INCLUDE)\winconst.h -
trunk/src/user32/new/win32wbase.cpp
r745 r750 1 /* $Id: win32wbase.cpp,v 1. 2 1999-08-30 16:38:59 dengertExp $ */1 /* $Id: win32wbase.cpp,v 1.3 1999-08-31 10:36:22 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 1419 1419 return FALSE; 1420 1420 } 1421 winres->setOS2Handle(OS2HwndMenu); 1421 1422 menuResource = winres; 1422 1423 return TRUE; … … 1717 1718 if(hwndParent != OSLIB_HWND_DESKTOP) 1718 1719 {//if the current process owns the window, just do a quick search 1719 child = (Win32BaseWindow *)parent-> GetFirstChild();1720 child = (Win32BaseWindow *)parent->getFirstChild(); 1720 1721 if(hwndChildAfter != 0) 1721 1722 { … … 1724 1725 if(child->getWindowHandle() == hwndChildAfter) 1725 1726 { 1726 child = (Win32BaseWindow *)child-> GetNextChild();1727 child = (Win32BaseWindow *)child->getNextChild(); 1727 1728 break; 1728 1729 } 1729 child = (Win32BaseWindow *)child-> GetNextChild();1730 child = (Win32BaseWindow *)child->getNextChild(); 1730 1731 } 1731 1732 } … … 1738 1739 return child->getWindowHandle(); 1739 1740 } 1740 child = (Win32BaseWindow *)child-> GetNextChild();1741 child = (Win32BaseWindow *)child->getNextChild(); 1741 1742 } 1742 1743 } … … 1947 1948 case GWL_EXSTYLE: 1948 1949 oldval = dwExStyle; 1949 dwExStyle = value;1950 setExStyle(value); 1950 1951 return oldval; 1951 1952 case GWL_STYLE: 1952 1953 oldval = dwStyle; 1953 dwStyle = value;1954 setStyle(value); 1954 1955 return oldval; 1955 1956 case GWL_WNDPROC: -
trunk/src/user32/new/win32wbase.h
r741 r750 1 /* $Id: win32wbase.h,v 1. 1 1999-08-30 12:00:12sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.2 1999-08-31 10:36:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 49 49 #define WM_WIN32_POSTMESSAGEW 0x4001 50 50 51 class Win32BaseWindow : public GenericObject, pr ivateChildWindow51 class Win32BaseWindow : public GenericObject, protected ChildWindow 52 52 { 53 53 public: … … 89 89 90 90 DWORD getStyle() { return dwStyle; }; 91 void setStyle(DWORD newstyle) { dwStyle = newstyle; }; 91 92 DWORD getExStyle() { return dwExStyle; }; 93 void setExStyle(DWORD newexstyle) { dwExStyle = newexstyle; }; 92 94 HWND getWindowHandle() { return Win32Hwnd; }; 93 95 HWND getOS2WindowHandle() { return OS2Hwnd; }; … … 105 107 BOOL isChild(); 106 108 PRECT getClientRect() { return &rectClient; }; 109 void setClientRect(PRECT rect) { rectClient = *rect; }; 107 110 PRECT getWindowRect() { return &rectWindow; }; 108 111 void setClientRect(LONG left, LONG top, LONG right, LONG bottom) … … 197 200 void Init(); 198 201 202 char *getWindowNameA() { return windowNameA; }; 203 199 204 HWND OS2Hwnd; 200 205 HWND OS2HwndFrame; -
trunk/src/user32/new/win32wmdiclient.cpp
r743 r750 1 /* $Id: win32wmdiclient.cpp,v 1. 1 1999-08-30 14:21:50sandervl Exp $ */1 /* $Id: win32wmdiclient.cpp,v 1.2 1999-08-31 10:36:23 sandervl Exp $ */ 2 2 /* 3 * Win32 Window Class for OS/23 * Win32 MDI Client Window Class for OS/2 4 4 * 5 5 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl) … … 22 22 #include <misc.h> 23 23 #include <heapstring.h> 24 #include <win32wnd.h> 24 25 #include <win32wmdiclient.h> 25 #include <win32wnd.h>26 26 #include <spy.h> 27 27 #include "wndmsg.h" … … 43 43 : Win32BaseWindow(lpCreateStructA, classAtom, isUnicode) 44 44 { 45 memset(&ci, 0, sizeof(ci)); 45 maximizedChild = 0; 46 activeChild = 0; 47 nActiveChildren = 0; 48 nTotalCreated = 0; 49 frameTitle = NULL; 50 mdiFlags = 0; 51 idFirstChild = 0; 52 hWindowMenu = 0; 46 53 } 47 54 //****************************************************************************** … … 54 61 LRESULT Win32MDIClientWindow::MDIClientWndProc(UINT message, WPARAM wParam, LPARAM lParam) 55 62 { 56 LPCREATESTRUCTA cs; 57 RECT rect; 58 INT nItems; 59 LRESULT retvalue; 60 Win32Window *frameWnd; 63 LPCREATESTRUCTA cs; 64 LPCLIENTCREATESTRUCT ccs; 65 RECT rect; 66 INT nItems; 67 LRESULT retvalue; 68 Win32Window *frameWnd; 69 Win32MDIChildWindow *mdichild; 61 70 62 71 frameWnd = (Win32Window *)getParent(); … … 65 74 } 66 75 76 switch (message) 77 { 78 case WM_CREATE: 79 cs = (LPCREATESTRUCTA)lParam; 80 ccs = (LPCLIENTCREATESTRUCT)cs->lpCreateParams; 81 82 hWindowMenu = ccs->hWindowMenu; 83 idFirstChild = ccs->idFirstChild; 84 85 maximizedChild = 0; 86 activeChild = 0; 87 nActiveChildren = 0; 88 nTotalCreated = 0; 89 frameTitle = NULL; 90 mdiFlags = 0; 91 92 setStyle(getStyle() | WS_CLIPCHILDREN); 93 94 // MDI_UpdateFrameText(frameWnd, hwnd, MDI_NOFRAMEREPAINT,frameWnd->text); 95 96 AppendMenuA( hWindowMenu, MF_SEPARATOR, 0, NULL ); 97 98 setClientRect(frameWnd->getClientRect()); 99 100 dprintf(("MDIClient created - hwnd = %04x, idFirst = %u\n", getWindowHandle(), idFirstChild )); 101 102 retvalue = 0; 103 goto END; 104 105 case WM_DESTROY: 106 // if( maximizedChild ) MDI_RestoreFrameMenu(w, frameWnd->hwndSelf); 107 108 if((nItems = GetMenuItemCount(hWindowMenu)) > 0) 109 { 110 idFirstChild = nItems - 1; 111 nActiveChildren++; /* to delete a separator */ 112 while( nActiveChildren-- ) 113 DeleteMenu(hWindowMenu,MF_BYPOSITION,idFirstChild--); 114 } 115 retvalue = 0; 116 goto END; 117 118 case WM_MDIACTIVATE: 119 if( activeChild && activeChild->getWindowHandle() != (HWND)wParam ) 120 121 mdichild = (Win32MDIChildWindow *)GetWindowFromHandle((HWND)wParam); 122 if(mdichild) { 123 mdichild->SetWindowPos(0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE); 124 } 125 retvalue = 0; 126 goto END; 127 67 128 #if 0 68 switch (message) 69 { 70 case WM_CREATE: 71 cs = (LPCREATESTRUCTA)lParam; 72 73 ci->hWindowMenu = cs->lpCreateParams->hWindowMenu; 74 ci->idFirstChild = cs->lpCreateParams->idFirstChild; 75 76 ci->hwndChildMaximized = 0; 77 ci->nActiveChildren = 0; 78 ci->nTotalCreated = 0; 79 ci->frameTitle = NULL; 80 ci->mdiFlags = 0; 81 ci->self = hwnd; 82 w->dwStyle |= WS_CLIPCHILDREN; 83 84 MDI_UpdateFrameText(frameWnd, hwnd, MDI_NOFRAMEREPAINT,frameWnd->text); 85 86 AppendMenuA( ci->hWindowMenu, MF_SEPARATOR, 0, NULL ); 87 88 GetClientRect(frameWnd->hwndSelf, &rect); 89 w->rectClient = rect; 90 91 dprintf(("MDIClient created - hwnd = %04x, idFirst = %u\n", 92 hwnd, ci->idFirstChild )); 93 94 retvalue = 0; 95 goto END; 96 97 case WM_DESTROY: 98 if( ci->hwndChildMaximized ) MDI_RestoreFrameMenu(w, frameWnd->hwndSelf); 99 if((nItems = GetMenuItemCount(ci->hWindowMenu)) > 0) 100 { 101 ci->idFirstChild = nItems - 1; 102 ci->nActiveChildren++; /* to delete a separator */ 103 while( ci->nActiveChildren-- ) 104 DeleteMenu(ci->hWindowMenu,MF_BYPOSITION,ci->idFirstChild--); 105 } 106 retvalue = 0; 107 goto END; 108 109 case WM_MDIACTIVATE: 110 if( ci->hwndActiveChild != (HWND)wParam ) 111 SetWindowPos((HWND)wParam, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE); 112 retvalue = 0; 113 goto END; 114 115 case WM_MDICASCADE: 129 case WM_MDICASCADE: 116 130 retvalue = MDICascade(w, ci); 117 131 goto END; 118 119 case WM_MDICREATE: 120 if (lParam) retvalue = MDICreateChild( w, ci, hwnd, 121 (MDICREATESTRUCTA*)lParam ); 122 else retvalue = 0; 123 goto END; 124 125 case WM_MDIDESTROY: 126 retvalue = MDIDestroyChild( w, ci, hwnd, (HWND)wParam, TRUE ); 127 goto END; 128 129 case WM_MDIGETACTIVE: 130 if (lParam) *(BOOL *)lParam = (ci->hwndChildMaximized > 0); 131 retvalue = ci->hwndActiveChild; 132 goto END; 133 134 case WM_MDIICONARRANGE: 135 ci->mdiFlags |= MDIF_NEEDUPDATE; 132 #endif 133 134 case WM_MDICREATE: 135 if (lParam) { 136 retvalue = Win32MDIChildWindow::createChild( this, (MDICREATESTRUCTA*)lParam ); 137 } 138 else retvalue = 0; 139 goto END; 140 141 case WM_MDIDESTROY: 142 // retvalue = MDIDestroyChild( w, ci, hwnd, (HWND)wParam, TRUE ); 143 goto END; 144 145 case WM_MDIGETACTIVE: 146 if (lParam) 147 *(BOOL *)lParam = (maximizedChild != 0); 148 149 retvalue = (activeChild) ? activeChild->getWindowHandle() : 0; 150 goto END; 151 152 #if 0 153 case WM_MDIICONARRANGE: 154 mdiFlags |= MDIF_NEEDUPDATE; 136 155 ArrangeIconicWindows(hwnd); 137 ci->sbRecalc = SB_BOTH+1; 138 SendMessageA(hwnd, WM_MDICALCCHILDSCROLL, 0, 0L); 139 retvalue = 0; 140 goto END; 141 142 case WM_MDIMAXIMIZE: 143 ShowWindow( (HWND)wParam, SW_MAXIMIZE ); 144 retvalue = 0; 145 goto END; 146 147 case WM_MDINEXT: /* lParam != 0 means previous window */ 148 MDI_SwitchActiveChild(hwnd, (HWND)wParam, (lParam)? FALSE : TRUE ); 149 break; 150 151 case WM_MDIRESTORE: 152 SendMessageA( (HWND)wParam, WM_SYSCOMMAND, SC_RESTORE, 0); 153 retvalue = 0; 154 goto END; 155 156 case WM_MDISETMENU: 157 retvalue = MDISetMenu( hwnd, (HMENU)wParam, (HMENU)lParam ); 158 goto END; 159 case WM_MDIREFRESHMENU: 160 retvalue = MDIRefreshMenu( hwnd, (HMENU)wParam, (HMENU)lParam ); 161 goto END; 162 163 case WM_MDITILE: 164 ci->mdiFlags |= MDIF_NEEDUPDATE; 165 ShowScrollBar(hwnd,SB_BOTH,FALSE); 166 MDITile(w, ci, wParam); 167 ci->mdiFlags &= ~MDIF_NEEDUPDATE; 168 retvalue = 0; 169 goto END; 170 171 case WM_VSCROLL: 172 case WM_HSCROLL: 173 ci->mdiFlags |= MDIF_NEEDUPDATE; 156 sbRecalc = SB_BOTH+1; 157 SendMessageA(hwnd, WM_MDICALCCHILDSCROLL, 0, 0L); 158 retvalue = 0; 159 goto END; 160 #endif 161 162 case WM_MDIMAXIMIZE: 163 ::ShowWindow( (HWND)wParam, SW_MAXIMIZE ); 164 retvalue = 0; 165 goto END; 166 167 case WM_MDINEXT: /* lParam != 0 means previous window */ 168 // MDI_SwitchActiveChild(hwnd, (HWND)wParam, (lParam)? FALSE : TRUE ); 169 break; 170 171 case WM_MDIRESTORE: 172 ::SendMessageA( (HWND)wParam, WM_SYSCOMMAND, SC_RESTORE, 0); 173 retvalue = 0; 174 goto END; 175 #if 0 176 case WM_MDISETMENU: 177 retvalue = MDISetMenu( hwnd, (HMENU)wParam, (HMENU)lParam ); 178 goto END; 179 180 case WM_MDIREFRESHMENU: 181 retvalue = MDIRefreshMenu( hwnd, (HMENU)wParam, (HMENU)lParam ); 182 goto END; 183 184 case WM_MDITILE: 185 mdiFlags |= MDIF_NEEDUPDATE; 186 ShowScrollBar(hwnd,SB_BOTH,FALSE); 187 MDITile(w, ci, wParam); 188 mdiFlags &= ~MDIF_NEEDUPDATE; 189 retvalue = 0; 190 goto END; 191 192 case WM_VSCROLL: 193 case WM_HSCROLL: 194 mdiFlags |= MDIF_NEEDUPDATE; 174 195 ScrollChildren(hwnd, message, wParam, lParam); 175 ci->mdiFlags &= ~MDIF_NEEDUPDATE; 176 retvalue = 0; 177 goto END; 178 179 case WM_SETFOCUS: 180 if( ci->hwndActiveChild ) 181 { 182 WND* pw = WIN_FindWndPtr( ci->hwndActiveChild ); 183 if( !(pw->dwStyle & WS_MINIMIZE) ) 184 SetFocus( ci->hwndActiveChild ); 185 WIN_ReleaseWndPtr(pw); 186 } 187 retvalue = 0; 188 goto END; 189 190 case WM_NCACTIVATE: 191 if( ci->hwndActiveChild ) 192 SendMessageA(ci->hwndActiveChild, message, wParam, lParam); 193 break; 194 195 case WM_PARENTNOTIFY: 196 mdiFlags &= ~MDIF_NEEDUPDATE; 197 retvalue = 0; 198 goto END; 199 #endif 200 201 case WM_SETFOCUS: 202 if( activeChild ) 203 { 204 if( !(activeChild->getStyle() & WS_MINIMIZE) ) 205 ::SetFocus(activeChild->getWindowHandle()); 206 } 207 retvalue = 0; 208 goto END; 209 210 case WM_NCACTIVATE: 211 if( activeChild ) 212 activeChild->SendMessageA(message, wParam, lParam); 213 break; 214 215 case WM_PARENTNOTIFY: 196 216 if (LOWORD(wParam) == WM_LBUTTONDOWN) 197 217 { 198 POINT pt = MAKEPOINT(lParam); 199 HWND child = ChildWindowFromPoint(hwnd, pt); 200 201 if( child && child != hwnd && child != ci->hwndActiveChild ) 202 SetWindowPos(child, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE ); 203 } 204 retvalue = 0; 205 goto END; 206 207 case WM_SIZE: 208 if( IsWindow(ci->hwndChildMaximized) ) 209 { 210 WND* child = WIN_FindWndPtr(ci->hwndChildMaximized); 211 RECT rect; 212 213 rect.left = 0; 214 rect.top = 0; 215 rect.right = LOWORD(lParam); 216 rect.bottom = HIWORD(lParam); 217 218 AdjustWindowRectEx(&rect, child->dwStyle, 0, child->dwExStyle); 219 MoveWindow(ci->hwndChildMaximized, rect.left, rect.top, 220 rect.right - rect.left, rect.bottom - rect.top, 1); 221 WIN_ReleaseWndPtr(child); 222 } 223 else 224 MDI_PostUpdate(hwnd, ci, SB_BOTH+1); 225 226 break; 227 228 case WM_MDICALCCHILDSCROLL: 229 if( (ci->mdiFlags & MDIF_NEEDUPDATE) && ci->sbRecalc ) 230 { 231 CalcChildScroll(hwnd, ci->sbRecalc-1); 232 ci->sbRecalc = 0; 233 ci->mdiFlags &= ~MDIF_NEEDUPDATE; 234 } 235 retvalue = 0; 236 goto END; 237 } 238 #endif 218 POINTS pt = MAKEPOINTS(lParam); 219 POINT point; 220 221 point.x = pt.x; 222 point.y = pt.y; 223 224 HWND child = ChildWindowFromPoint(getWindowHandle(), point); 225 226 if( child && child != getWindowHandle() && (!activeChild || activeChild->getWindowHandle() != child) ) 227 ::SetWindowPos(child, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE ); 228 } 229 retvalue = 0; 230 goto END; 231 232 case WM_SIZE: 233 if( maximizedChild && maximizedChild->IsWindow() ) 234 { 235 RECT rect; 236 237 rect.left = 0; 238 rect.top = 0; 239 rect.right = LOWORD(lParam); 240 rect.bottom = HIWORD(lParam); 241 242 AdjustWindowRectEx(&rect, maximizedChild->getStyle(), 0, maximizedChild->getExStyle()); 243 ::MoveWindow(maximizedChild->getWindowHandle(), rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, 1); 244 } 245 #if 0 246 else 247 MDI_PostUpdate(hwnd, ci, SB_BOTH+1); 248 #endif 249 break; 250 251 #if 0 252 case WM_MDICALCCHILDSCROLL: 253 if( (mdiFlags & MDIF_NEEDUPDATE) && sbRecalc ) 254 { 255 CalcChildScroll(hwnd, sbRecalc-1); 256 sbRecalc = 0; 257 mdiFlags &= ~MDIF_NEEDUPDATE; 258 } 259 retvalue = 0; 260 goto END; 261 #endif 262 } 239 263 retvalue = DefWindowProcA(message, wParam, lParam ); 240 264 END: … … 242 266 } 243 267 /********************************************************************** 244 * 268 * MDIClientWndProc 245 269 * 246 270 * This function handles all MDI requests. … … 257 281 } 258 282 return window->MDIClientWndProc(message, wParam, lParam); 283 } 284 /********************************************************************** 285 * MDI_ChildActivate 286 * 287 * Note: hWndChild is NULL when last child is being destroyed 288 */ 289 LONG Win32MDIClientWindow::childActivate(Win32MDIChildWindow *child) 290 { 291 BOOL isActiveFrameWnd = 0; 292 LONG retvalue; 293 Win32MDIChildWindow *prevActive = activeChild; 294 295 if( child && child->getStyle() & WS_DISABLED ) 296 { 297 return 0; 298 } 299 300 if( GetActiveWindow() == getParent()->getWindowHandle()) 301 isActiveFrameWnd = TRUE; 302 303 /* deactivate prev. active child */ 304 if( prevActive ) 305 { 306 prevActive->setStyle(prevActive->getStyle() | WS_SYSMENU); 307 prevActive->SendMessageA( WM_NCACTIVATE, FALSE, 0L ); 308 prevActive->SendMessageA( WM_MDIACTIVATE, (WPARAM)prevActive->getWindowHandle(), (LPARAM)(child) ? child->getWindowHandle() : 0); 309 310 /* uncheck menu item */ 311 if( getMDIMenu() ) 312 CheckMenuItem(getMDIMenu(), prevActive->getWindowId(), 0); 313 } 314 315 /* set appearance */ 316 if( maximizedChild) 317 { 318 if( maximizedChild != child) { 319 if( child ) { 320 activeChild = child; 321 child->ShowWindow(SW_SHOWMAXIMIZED); 322 } 323 else 324 if(activeChild) activeChild->ShowWindow( SW_SHOWNORMAL ); 325 } 326 } 327 328 activeChild = child; 329 330 /* check if we have any children left */ 331 if( !activeChild ) 332 { 333 if( isActiveFrameWnd ) 334 SetFocus(getWindowHandle()); 335 336 return 0; 337 } 338 339 /* check menu item */ 340 if( getMDIMenu() ) 341 CheckMenuItem(getMDIMenu(), child->getWindowId(), MF_CHECKED); 342 343 /* bring active child to the top */ 344 child->SetWindowPos( 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); 345 346 if( isActiveFrameWnd ) 347 { 348 child->SendMessageA( WM_NCACTIVATE, TRUE, 0L); 349 if( GetFocus() == getWindowHandle()) 350 SendMessageA( WM_SETFOCUS, (WPARAM)getWindowHandle(), 0L ); 351 else 352 SetFocus( getWindowHandle() ); 353 } 354 child->SendMessageA( WM_MDIACTIVATE, (WPARAM)prevActive->getWindowHandle(), (LPARAM)child->getWindowHandle()); 355 356 return TRUE; 357 } 358 /********************************************************************** 359 * MDI_SwitchActiveChild 360 * 361 * Note: SetWindowPos sends WM_CHILDACTIVATE to the child window that is 362 * being activated 363 */ 364 void Win32MDIClientWindow::switchActiveChild(Win32MDIChildWindow *nextActiveChild, BOOL bNextWindow ) 365 { 366 Win32MDIChildWindow *prevActiveChild = 0; 367 368 if ( !nextActiveChild) return; /* no window to switch to */ 369 370 prevActiveChild = getActiveChild(); 371 372 if ( prevActiveChild != nextActiveChild) 373 { 374 BOOL bOptimize = 0; 375 376 if( getMaximizedChild() ) 377 { 378 bOptimize = 1; 379 nextActiveChild->setStyle(nextActiveChild->getStyle()& ~WS_VISIBLE); 380 } 381 382 nextActiveChild->SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE ); 383 384 if( bNextWindow && prevActiveChild ) 385 prevActiveChild->SetWindowPos(HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ); 386 387 if( bOptimize ) 388 ShowWindow(SW_SHOW ); 389 } 390 } 391 392 393 /********************************************************************** 394 * MDIDestroyChild 395 */ 396 LRESULT Win32MDIClientWindow::destroyChild(Win32MDIChildWindow *child, BOOL flagDestroy ) 397 { 398 if( child == getActiveChild()) 399 { 400 switchActiveChild(child, TRUE); 401 402 if( child == getActiveChild() ) 403 { 404 ShowWindow(SW_HIDE); 405 if( child == getMaximizedChild() ) 406 { 407 // MDI_RestoreFrameMenu(w_parent->parent, child); 408 setMaximizedChild(NULL); 409 // MDI_UpdateFrameText(w_parent->parent,parent,TRUE,NULL); 410 } 411 childActivate(0); 412 } 413 } 414 child->menuDeleteItem(); 415 416 decNrActiveChildren(); 417 418 dprintf(("child destroyed - %04x\n", child->getWindowHandle())); 419 420 if (flagDestroy) 421 { 422 // MDI_PostUpdate(GetParent(child), ci, SB_BOTH+1); 423 ::DestroyWindow(child->getWindowHandle()); 424 } 425 426 return 0; 427 } 428 /* -------- Miscellaneous service functions ---------- 429 * 430 * MDI_GetChildByID 431 */ 432 Win32MDIChildWindow *Win32MDIClientWindow::getChildByID(INT id) 433 { 434 Win32MDIChildWindow *child; 435 436 for (child = (Win32MDIChildWindow *)getFirstChild() ; child; child = (Win32MDIChildWindow *)child->getNextChild()) 437 if (child->getWindowId() == id) return child; 438 439 return 0; 259 440 } 260 441 //****************************************************************************** … … 282 463 { 283 464 if (GlobalFindAtomA(MDICLIENTCLASSNAME)) 284 return UnregisterClassA(MDICLIENTCLASSNAME,(HINSTANCE)NULL);285 else return FALSE;286 } 287 //****************************************************************************** 288 //****************************************************************************** 465 return UnregisterClassA(MDICLIENTCLASSNAME,(HINSTANCE)NULL); 466 else return FALSE; 467 } 468 //****************************************************************************** 469 //****************************************************************************** -
trunk/src/user32/new/win32wmdiclient.h
r743 r750 1 /* $Id: win32wmdiclient.h,v 1. 1 1999-08-30 14:21:50sandervl Exp $ */1 /* $Id: win32wmdiclient.h,v 1.2 1999-08-31 10:36:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 12 12 13 13 #include <win32wbase.h> 14 #include <win32wmdichild.h> 14 15 #include <mdi.h> 15 16 … … 24 25 virtual ~Win32MDIClientWindow(); 25 26 27 int incTotalCreated() { return ++nTotalCreated; }; 28 int getFirstChildId() { return idFirstChild; }; 29 30 HWND getMDIMenu() { return hWindowMenu; }; 31 32 Win32MDIChildWindow *getMaximizedChild() { return maximizedChild; }; 33 void setMaximizedChild(Win32MDIChildWindow *newchild) { maximizedChild = newchild; }; 34 35 Win32MDIChildWindow *getActiveChild() { return activeChild; }; 36 void setActiveChild(Win32MDIChildWindow *newchild) { activeChild = newchild; }; 37 38 Win32MDIChildWindow *getChildByID(INT id); 39 40 int getNrOfChildren() { return nActiveChildren; }; 41 int incNrActiveChildren() { return ++nActiveChildren; }; 42 int decNrActiveChildren() { return --nActiveChildren; }; 43 44 LONG childActivate(Win32MDIChildWindow *child); 45 void switchActiveChild(Win32MDIChildWindow *nextActiveChild, BOOL bNextWindow ); 46 LRESULT destroyChild(Win32MDIChildWindow *child, BOOL flagDestroy ); 47 26 48 LRESULT MDIClientWndProc(UINT message, WPARAM wParam, LPARAM lParam); 27 49 28 50 private: 29 MDICLIENTINFO ci; 51 Win32MDIChildWindow *maximizedChild; 52 Win32MDIChildWindow *activeChild; 53 54 HWND hWindowMenu; 55 int idFirstChild; 56 57 int nActiveChildren; 58 int nTotalCreated; 59 LPSTR frameTitle; 60 DWORD mdiFlags; 30 61 31 62 }; -
trunk/src/user32/new/win32wndchild.cpp
r724 r750 1 /* $Id: win32wndchild.cpp,v 1. 2 1999-08-28 14:09:30sandervl Exp $ */1 /* $Id: win32wndchild.cpp,v 1.3 1999-08-31 10:36:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Child/Parent window class for OS/2 … … 48 48 } 49 49 else { 50 while(curchild-> GetNextChild()) {51 curchild = curchild-> GetNextChild();50 while(curchild->getNextChild()) { 51 curchild = curchild->getNextChild(); 52 52 } 53 curchild-> SetNextChild(this);53 curchild->setNextChild(this); 54 54 } 55 child-> SetNextChild(NULL);55 child->setNextChild(NULL); 56 56 57 57 mutex.leave(); … … 68 68 69 69 if(curchild == child) { 70 children = child-> GetNextChild();70 children = child->getNextChild(); 71 71 } 72 72 else { … … 77 77 return FALSE; 78 78 } 79 while(curchild-> GetNextChild() != child) {80 curchild = curchild-> GetNextChild();79 while(curchild->getNextChild() != child) { 80 curchild = curchild->getNextChild(); 81 81 if(curchild == NULL) { 82 82 dprintf(("ChildWindow::RemoveChild, curchild == NULL")); … … 86 86 } 87 87 } 88 curchild-> SetNextChild(child->GetNextChild());88 curchild->setNextChild(child->getNextChild()); 89 89 } 90 90 mutex.leave(); -
trunk/src/user32/new/win32wndchild.h
r724 r750 1 /* $Id: win32wndchild.h,v 1. 2 1999-08-28 14:09:30sandervl Exp $ */1 /* $Id: win32wndchild.h,v 1.3 1999-08-31 10:36:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Child/Parent window class for OS/2 … … 37 37 BOOL RemoveChild(ChildWindow *child); 38 38 39 ChildWindow * GetFirstChild() { return children; };40 ChildWindow * GetNextChild() { return nextchild; };41 void SetNextChild(ChildWindow *child) { nextchild = child; };39 ChildWindow *getFirstChild() { return children; }; 40 ChildWindow *getNextChild() { return nextchild; }; 41 void setNextChild(ChildWindow *child) { nextchild = child; }; 42 42 43 43 BOOL DestroyChildren(); -
trunk/src/user32/new/window.cpp
r741 r750 1 /* $Id: window.cpp,v 1. 19 1999-08-30 11:59:54 sandervl Exp $ */1 /* $Id: window.cpp,v 1.20 1999-08-31 10:36:24 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 784 784 //****************************************************************************** 785 785 //****************************************************************************** 786 HWND WIN32API ChildWindowFromPointEx(HWND arg1, POINT arg2, UINT uFlags) 787 { 788 #ifdef DEBUG 789 WriteLog("USER32: ChildWindowFromPointEx, not completely supported!\n"); 790 #endif 791 return O32_ChildWindowFromPoint(arg1, arg2); 786 /***************************************************************************** 787 * Name : HWND WIN32API ChildWindowFromPointEx 788 * Purpose : The GetWindowRect function retrieves the dimensions of the 789 * bounding rectangle of the specified window. The dimensions are 790 * given in screen coordinates that are relative to the upper-left 791 * corner of the screen. 792 * Parameters: 793 * Variables : 794 * Result : If the function succeeds, the return value is the window handle. 795 * If the function fails, the return value is zero 796 * Remark : 797 * Status : FULLY IMPLEMENTED AND TESTED 798 * 799 * Author : Rene Pronk [Sun, 1999/08/08 23:30] 800 *****************************************************************************/ 801 802 HWND WIN32API ChildWindowFromPointEx (HWND hwndParent, POINT pt, UINT uFlags) 803 { 804 RECT rect; 805 HWND hWnd; 806 POINT absolutePt; 807 808 dprintf(("USER32: ChildWindowFromPointEx(%08xh,%08xh,%08xh).\n", 809 hwndParent, pt, uFlags)); 810 811 if (GetWindowRect (hwndParent, &rect) == 0) { 812 // oops, invalid handle 813 return NULL; 814 } 815 816 // absolutePt has its top in the upper-left corner of the screen 817 absolutePt = pt; 818 ClientToScreen (hwndParent, &absolutePt); 819 820 // make rect the size of the parent window 821 GetWindowRect (hwndParent, &rect); 822 rect.right = rect.right - rect.left; 823 rect.bottom = rect.bottom - rect.top; 824 rect.left = 0; 825 rect.top = 0; 826 827 if (PtInRect (&rect, pt) == 0) { 828 // point is outside window 829 return NULL; 830 } 831 832 // get first child 833 hWnd = GetWindow (hwndParent, GW_CHILD); 834 835 while (hWnd != NULL) { 836 837 // do I need to skip this window? 838 if (((uFlags & CWP_SKIPINVISIBLE) && 839 (IsWindowVisible (hWnd) == FALSE)) || 840 ((uFlags & CWP_SKIPDISABLED) && 841 (IsWindowEnabled (hWnd) == FALSE)) || 842 ((uFlags & CWP_SKIPTRANSPARENT) && 843 (GetWindowLongA (hWnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT))) 844 845 { 846 hWnd = GetWindow (hWnd, GW_HWNDNEXT); 847 continue; 848 } 849 850 // is the point in this window's rect? 851 GetWindowRect (hWnd, &rect); 852 if (PtInRect (&rect, absolutePt) == FALSE) { 853 hWnd = GetWindow (hWnd, GW_HWNDNEXT); 854 continue; 855 } 856 857 // found it! 858 return hWnd; 859 } 860 861 // the point is in the parentwindow but the parentwindow has no child 862 // at this coordinate 863 return hwndParent; 792 864 } 793 865 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.