Changeset 3462 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Apr 29, 2000, 8:28:41 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r3419 r3462 1 /* $Id: win32wbase.cpp,v 1.18 0 2000-04-18 11:13:00sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.181 2000-04-29 18:28:39 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 542 542 } 543 543 544 //SvL: This completely messes up MS Word 97 (no button bar, no menu) 545 #if 0 544 546 //adjust CW_USEDEFAULT position 545 547 if (fXDefault | fCXDefault) … … 547 549 RECT rect; 548 550 551 //SvL: Returns invalid rectangle (not the expected shell default size) 549 552 OSLibWinQueryWindowRect(OS2HwndFrame,&rect,RELATIVE_TO_SCREEN); 550 553 if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rect); … … 564 567 } 565 568 } 569 #endif 570 571 OSLibWinSetOwner(OS2Hwnd, OS2HwndFrame); 572 573 fakeWinBase.hwndThis = OS2Hwnd; 574 fakeWinBase.pWindowClass = windowClass; 575 576 //Set icon from window or class 577 if (hIcon) 578 OSLibWinSetIcon(OS2HwndFrame,hIcon); 579 else if (windowClass->getIcon()) 580 OSLibWinSetIcon(OS2HwndFrame,windowClass->getIcon()); 581 582 /* Get class or window DC if needed */ 583 if(windowClass->getStyle() & CS_OWNDC) { 584 dprintf(("Class with CS_OWNDC style")); 585 ownDC = GetDC(getWindowHandle()); //TODO: or GetWindowDC??? 586 } 587 else 588 if (windowClass->getStyle() & CS_PARENTDC) { 589 dprintf(("WARNING: Class with CS_PARENTDC style!")); 590 fParentDC = TRUE; 591 ownDC = 0; 592 } 593 else 594 if (windowClass->getStyle() & CS_CLASSDC) { 595 dprintf(("WARNING: Class with CS_CLASSDC style!")); 596 ownDC = 0; 597 } 598 /* Set the window menu */ 599 if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION ) 600 { 601 if (cs->hMenu) { 602 ::SetMenu(getWindowHandle(), cs->hMenu); 603 } 604 else { 605 if (windowClass->getMenuNameA()) { 606 cs->hMenu = LoadMenuA(windowClass->getInstance(),windowClass->getMenuNameA()); 607 #if 0 //CB: hack for treeview test cases bug 608 if (!cs->hMenu) cs->hMenu = LoadMenuA(windowClass->getInstance(),"MYAPP"); 609 #endif 610 if (cs->hMenu) ::SetMenu(getWindowHandle(), cs->hMenu ); 611 } 612 } 613 } 614 else 615 { 616 setWindowId((DWORD)cs->hMenu); 617 } 618 hSysMenu = (dwStyle & WS_SYSMENU) ? MENU_GetSysMenu(Win32Hwnd,0):0; 619 620 // Subclass frame 621 pOldFrameProc = FrameSubclassFrameWindow(this); 566 622 567 623 /* Send the WM_GETMINMAXINFO message and fix the size if needed */ … … 585 641 if (cs->cy <= 0) cs->cy = 1; 586 642 } 587 588 OSLibWinSetOwner(OS2Hwnd, OS2HwndFrame);589 590 fakeWinBase.hwndThis = OS2Hwnd;591 fakeWinBase.pWindowClass = windowClass;592 593 //Set icon from window or class594 if (hIcon)595 OSLibWinSetIcon(OS2HwndFrame,hIcon);596 else if (windowClass->getIcon())597 OSLibWinSetIcon(OS2HwndFrame,windowClass->getIcon());598 599 /* Get class or window DC if needed */600 if(windowClass->getStyle() & CS_OWNDC) {601 dprintf(("Class with CS_OWNDC style"));602 ownDC = GetDC(getWindowHandle()); //TODO: or GetWindowDC???603 }604 else605 if (windowClass->getStyle() & CS_PARENTDC) {606 dprintf(("WARNING: Class with CS_PARENTDC style!"));607 fParentDC = TRUE;608 ownDC = 0;609 }610 else611 if (windowClass->getStyle() & CS_CLASSDC) {612 dprintf(("WARNING: Class with CS_CLASSDC style!"));613 ownDC = 0;614 }615 /* Set the window menu */616 if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )617 {618 if (cs->hMenu) {619 ::SetMenu(getWindowHandle(), cs->hMenu);620 }621 else {622 if (windowClass->getMenuNameA()) {623 cs->hMenu = LoadMenuA(windowClass->getInstance(),windowClass->getMenuNameA());624 #if 0 //CB: hack for treeview test cases bug625 if (!cs->hMenu) cs->hMenu = LoadMenuA(windowClass->getInstance(),"MYAPP");626 #endif627 if (cs->hMenu) ::SetMenu(getWindowHandle(), cs->hMenu );628 }629 }630 }631 else632 {633 setWindowId((DWORD)cs->hMenu);634 }635 hSysMenu = (dwStyle & WS_SYSMENU) ? MENU_GetSysMenu(Win32Hwnd,0):0;636 637 // Subclass frame638 pOldFrameProc = FrameSubclassFrameWindow(this);639 643 640 644 //preset rects … … 1608 1612 case WM_SYSCHAR: 1609 1613 { 1610 1611 1614 int iMenuSysKey = 0; 1615 if (wParam == VK_RETURN && (getStyle() & WS_MINIMIZE)) 1612 1616 { 1613 1617 PostMessageA(getWindowHandle(), WM_SYSCOMMAND, … … 1615 1619 break; 1616 1620 } 1617 if ((HIWORD(lParam) & KEYDATA_ALT) && wParam) 1618 { 1619 if (wParam == VK_TAB || wParam == VK_ESCAPE) break; 1620 if (wParam == VK_SPACE && (getStyle() & WS_CHILD)) 1621 getParent()->SendMessageA(Msg, wParam, lParam ); 1622 else 1623 SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam ); 1624 } 1625 else /* check for Ctrl-Esc */ 1626 if (wParam != VK_ESCAPE) MessageBeep(0); 1627 break; 1621 if((HIWORD(lParam) & KEYDATA_ALT) && wParam) 1622 { 1623 if (wParam == VK_TAB || wParam == VK_ESCAPE) 1624 break; 1625 if (wParam == VK_SPACE && (getStyle() & WS_CHILD)) { 1626 getParent()->SendMessageA(Msg, wParam, lParam ); 1627 } 1628 else SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam ); 1629 } 1630 else /* check for Ctrl-Esc */ 1631 if (wParam != VK_ESCAPE) MessageBeep(0); 1632 break; 1628 1633 } 1629 1634 … … 2081 2086 BOOL rc = OSLibWinShowWindow(OS2HwndFrame, showstate); 2082 2087 2088 SendInternalMessageA(WM_SHOWWINDOW, (showstate & SWPOS_SHOW) ? 1 : 0, 0); 2089 2083 2090 return rc; 2084 2091 }
Note:
See TracChangeset
for help on using the changeset viewer.