Changeset 3773 for trunk/src/user32/pmwindow.cpp
- Timestamp:
- Jun 29, 2000, 2:26:01 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/pmwindow.cpp
r3708 r3773 1 /* $Id: pmwindow.cpp,v 1.9 5 2000-06-14 14:25:57sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.96 2000-06-29 12:26:00 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 53 53 MRESULT EXPENTRY Win32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 54 54 55 PFNWP PMFrameWindowProc = 0;56 57 55 //****************************************************************************** 58 56 //Initialize PM; create hab, message queue and register special Win32 window classes … … 111 109 dprintf(("WC_FRAME style %x", FrameClassInfo.flClassStyle)); 112 110 113 PMFrameWindowProc = FrameClassInfo.pfnWindowProc;114 111 if(!WinRegisterClass( /* Register window class */ 115 112 hab, /* Anchor block handle */ … … 200 197 case WM_CREATE: 201 198 { 202 RestoreOS2TIB();203 PMFrameWindowProc(hwnd, msg, mp1, mp2);204 SetWin32TIB();205 206 199 if(thdb->newWindow == 0) 207 200 goto createfail; … … 235 228 win32wnd->MsgDestroy(); 236 229 WinSetVisibleRegionNotify(hwnd, FALSE); 237 goto RunDef FrameProc;230 goto RunDefWndProc; 238 231 239 232 case WM_ENABLE: … … 344 337 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) 345 338 { 339 if(pswp->fl & SWP_ACTIVATE) 340 { 341 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 342 } 346 343 goto RunDefWndProc; 347 344 } … … 364 361 } 365 362 else OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, OSLibQueryScreenHeight(), 0, 0, hwnd); 363 364 if(pswp->fl & SWP_ACTIVATE) 365 { 366 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 367 } 366 368 367 369 if((pswp->fl & (SWP_MOVE | SWP_SIZE)) && !(win32wnd->getStyle() & WS_MINIMIZE_W)) … … 477 479 PSWP swp = (PSWP)mp1; 478 480 479 if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc; 481 if (!win32wnd->IsWindowCreated()) goto RunDefWndProc; 482 480 483 dprintf(("OS2: WM_MINMAXFRAME %x",hwnd)); 481 484 if ((swp->fl & SWP_MAXIMIZE) == SWP_MAXIMIZE) … … 500 503 win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W)); 501 504 } 502 goto RunDefFrameProc; 503 } 504 505 case WM_OWNERPOSCHANGE: 506 { 507 dprintf(("OS2: WM_OWNERPOSCHANGE")); 508 goto RunDefWndProc; 505 goto RunDefWndProc; 509 506 } 510 507 … … 536 533 537 534 case WM_VRNENABLED: 535 dprintf(("OS2: WM_VRNENABLED %x", win32wnd->getWindowHandle())); 538 536 if(!win32wnd->isComingToTop() && ((win32wnd->getExStyle() & WS_EX_TOPMOST_W) == WS_EX_TOPMOST_W)) 539 537 { … … 740 738 741 739 case WM_FOCUSCHANGE: 742 dprintf(("OS2: WM_FOCUSCHANGE %x %x %x", win32wnd->getWindowHandle(), mp1, mp2)); 743 goto RunDefFrameProc; //partly responsible for activation of frame windows 740 { 741 HWND hwndFocus = (HWND)mp1; 742 HWND hwndLoseFocus, hwndGainFocus; 743 USHORT usSetFocus = SHORT1FROMMP(mp2); 744 USHORT fsFocusChange = SHORT2FROMMP(mp2); 745 746 dprintf(("OS2: WM_FOCUSCHANGE (start) %x %x %x %x", win32wnd->getWindowHandle(), hwndFocus, usSetFocus, fsFocusChange)); 747 RestoreOS2TIB(); 748 if(usSetFocus) { 749 hwndGainFocus = hwnd; 750 hwndLoseFocus = hwndFocus; 751 } 752 else { 753 hwndGainFocus = hwndFocus; 754 hwndLoseFocus = hwnd; 755 } 756 if(!(fsFocusChange & FC_NOLOSEFOCUS)) { 757 WinSendMsg(hwndLoseFocus, WM_SETFOCUS, (MPARAM)hwndGainFocus, (MPARAM)0); 758 } 759 //TODO: Don't send WM_SETSELECTION to child window if frame already has selection 760 if(!(fsFocusChange & FC_NOLOSESELECTION)) { 761 WinSendMsg(hwndLoseFocus, WM_SETSELECTION, (MPARAM)0, (MPARAM)0); 762 } 763 if(usSetFocus) 764 { 765 Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndLoseFocus); 766 if(!(fsFocusChange & FC_NOLOSEACTIVE)) { 767 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) { 768 if(winfocus) { 769 WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus); 770 } 771 else WinSendMsg(hwndLoseFocus, WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus); 772 } 773 } 774 if(!(fsFocusChange & FC_NOSETACTIVE)) 775 { 776 Win32BaseWindow *topparent = win32wnd->GetTopParent(); 777 if(!winfocus || (winfocus->GetTopParent() != topparent)) 778 { 779 if(!(fsFocusChange & FC_NOBRINGTOTOP)) 780 { 781 if(topparent) { 782 //put window at the top of z order 783 WinSetWindowPos(topparent->getOS2WindowHandle(), HWND_TOP, 0, 0, 0, 0, SWP_ZORDER); 784 } 785 } 786 WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus); 787 } 788 } 789 } 790 else 791 { 792 Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndGainFocus); 793 if(!(fsFocusChange & FC_NOLOSEACTIVE)) { 794 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) { 795 WinSendMsg(win32wnd->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus); 796 } 797 } 798 if(!(fsFocusChange & FC_NOSETACTIVE)) { 799 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) { 800 if(winfocus) { 801 WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus); 802 } 803 else WinSendMsg(hwndGainFocus, WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus); 804 } 805 } 806 } 807 //TODO: Don't send WM_SETSELECTION to child window if frame already has selection 808 if(!(fsFocusChange & FC_NOSETSELECTION)) { 809 WinSendMsg(hwndGainFocus, WM_SETSELECTION, (MPARAM)1, (MPARAM)0); 810 } 811 812 if(!(fsFocusChange & FC_NOSETFOCUS)) { 813 WinSendMsg(hwndGainFocus, WM_SETFOCUS, (MPARAM)hwndLoseFocus, (MPARAM)1); 814 } 815 #ifdef DEBUG 816 SetWin32TIB(); 817 dprintf(("OS2: WM_FOCUSCHANGE (end) %x %x %x", win32wnd->getWindowHandle(), mp1, mp2)); 818 RestoreOS2TIB(); 819 #endif 820 return (MRESULT)rc; 821 } 744 822 745 823 case WM_QUERYTRACKINFO: … … 748 826 749 827 dprintf(("OS2: WM_QUERYTRACKINFO %x", win32wnd->getWindowHandle())); 750 RestoreOS2TIB();751 PMFrameWindowProc(hwnd,msg,mp1,mp2);752 SetWin32TIB();753 828 trackInfo->cxBorder = 4; 754 829 trackInfo->cyBorder = 4; … … 770 845 } 771 846 847 case WM_OWNERPOSCHANGE: 848 { 849 dprintf(("OS2: WM_OWNERPOSCHANGE")); 850 goto RunDefWndProc; 851 } 852 772 853 case WM_FORMATFRAME: 773 854 dprintf(("OS2: WM_FORMATFRAME %x", win32wnd->getWindowHandle())); 774 break;775 776 #if 0 855 // goto RunDefWndProc; 856 break; 857 777 858 case WM_ADJUSTFRAMEPOS: 778 dprintf(("OS2: WM_ADJUSTFRAMEPOS %x", win32wnd->getWindowHandle())); 779 break; 859 { 860 PSWP pswp = (PSWP)mp1; 861 862 dprintf(("OS2: WM_ADJUSTFRAMEPOS %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 863 break; 864 } 780 865 781 866 case WM_QUERYFRAMEINFO: … … 788 873 789 874 dprintf(("OS2: WM_QUERYFOCUSCHAIN %x %x %x", win32wnd->getWindowHandle(), mp1, mp2)); 875 #if 1 876 goto RunDefWndProc; 877 #else 790 878 switch(fsCmd) { 791 879 case QFC_NEXTINCHAIN: … … 804 892 } 805 893 break; 806 }807 894 #endif 895 } 808 896 809 897 case WM_INITMENU: … … 834 922 // dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd)); 835 923 RestoreOS2TIB(); 836 return PMFrameWindowProc(hwnd, msg, mp1, mp2); 837 // return WinDefWindowProc( hwnd, msg, mp1, mp2 ); 924 return WinDefWindowProc( hwnd, msg, mp1, mp2 ); 838 925 } 839 926 RestoreOS2TIB(); 840 927 return (MRESULT)rc; 841 928 842 RunDefFrameProc:843 RestoreOS2TIB();844 return PMFrameWindowProc(hwnd, msg, mp1, mp2);845 846 929 RunDefWndProc: 847 930 // dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd)); 848 931 RestoreOS2TIB(); 849 return PMFrameWindowProc(hwnd, msg, mp1, mp2); 850 // return WinDefWindowProc( hwnd, msg, mp1, mp2 ); 932 return WinDefWindowProc( hwnd, msg, mp1, mp2 ); 851 933 } /* End of Win32WindowProc */ 852 934 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.