Changeset 1429
- Timestamp:
- Oct 24, 1999, 2:30:29 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
-
pmwindow.cpp (modified) (4 diffs)
-
win32wmdichild.cpp (modified) (4 diffs)
-
win32wmdiclient.cpp (modified) (21 diffs)
-
win32wmdiclient.h (modified) (2 diffs)
-
winaccel.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/pmwindow.cpp
r1425 r1429 1 /* $Id: pmwindow.cpp,v 1.4 3 1999-10-23 23:04:37sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.44 1999-10-24 12:30:28 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 441 441 442 442 case WM_FOCUSCHANGE: 443 dprintf(("OS2: WM_FOCUSCHANGE %x", hwnd));443 dprintf(("OS2: WM_FOCUSCHANGE %x", win32wnd->getWindowHandle())); 444 444 goto RunDefWndProc; 445 445 … … 448 448 HWND hwndFocus = (HWND)mp1; 449 449 450 dprintf(("OS2: WM_SETFOCUS %x %d", hwnd, mp2));450 dprintf(("OS2: WM_SETFOCUS %x %d", win32wnd->getWindowHandle(), mp2)); 451 451 if(WinQueryWindowULong(hwndFocus, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) { 452 452 //another (non-win32) application's window … … 465 465 break; 466 466 } 467 467 468 //************************************************************************** 468 469 //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen -
trunk/src/user32/win32wmdichild.cpp
r1322 r1429 1 /* $Id: win32wmdichild.cpp,v 1. 5 1999-10-16 14:51:43sandervl Exp $ */1 /* $Id: win32wmdichild.cpp,v 1.6 1999-10-24 12:30:28 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Child Window Class for OS/2 … … 45 45 //****************************************************************************** 46 46 Win32MDIChildWindow::Win32MDIChildWindow(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode) 47 : Win32BaseWindow(lpCreateStructA, classAtom, isUnicode) 48 { 47 : Win32BaseWindow(OBJTYPE_WINDOW) 48 { 49 this->isUnicode = isUnicode; 50 CreateWindowExA(lpCreateStructA, classAtom); 49 51 } 50 52 //****************************************************************************** … … 172 174 if( client->getActiveChild() == this && wParam != SIZE_MAXIMIZED ) 173 175 { 174 client->setActiveChild(NULL); 175 #if 0 176 MDI_RestoreFrameMenu( clientWnd->parent, hwnd); 177 #endif 176 client->setMaximizedChild(NULL); 177 client->restoreFrameMenu(this); 178 178 client->updateFrameText(MDI_REPAINTFRAME, NULL ); 179 179 } … … 188 188 { 189 189 maxChild->SendMessageA(WM_SETREDRAW, FALSE, 0L ); 190 #if 0 191 MDI_RestoreFrameMenu( clientWnd->parent, hMaxChild); 192 #endif 190 client->restoreFrameMenu(maxChild); 193 191 maxChild->ShowWindow(SW_SHOWNOACTIVATE); 194 192 -
trunk/src/user32/win32wmdiclient.cpp
r1361 r1429 1 /* $Id: win32wmdiclient.cpp,v 1. 8 1999-10-19 18:02:08sandervl Exp $ */1 /* $Id: win32wmdiclient.cpp,v 1.9 1999-10-24 12:30:29 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 42 42 Win32MDIClientWindow::Win32MDIClientWindow(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode) 43 43 : maximizedChild(0), activeChild(0), nActiveChildren(0), nTotalCreated(0), 44 frameTitle(NULL), mdiFlags(0), idFirstChild(0), hWindowMenu(0), 44 frameTitle(NULL), mdiFlags(0), idFirstChild(0), hWindowMenu(0), 45 45 sbRecalc(0), 46 46 Win32BaseWindow(OBJTYPE_WINDOW) … … 110 110 111 111 case WM_DESTROY: 112 // if( maximizedChild ) MDI_RestoreFrameMenu(w, frameWnd->hwndSelf);112 if( maximizedChild ) restoreFrameMenu(getParent()); 113 113 114 114 if((nItems = GetMenuItemCount(hWindowMenu)) > 0) … … 124 124 case WM_MDIACTIVATE: 125 125 if( activeChild && activeChild->getWindowHandle() != (HWND)wParam ) 126 {127 mdichild = (Win32MDIChildWindow *)GetWindowFromHandle((HWND)wParam);128 if(mdichild) {129 mdichild->SetWindowPos(0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE);130 }131 }126 { 127 mdichild = (Win32MDIChildWindow *)GetWindowFromHandle((HWND)wParam); 128 if(mdichild) { 129 mdichild->SetWindowPos(0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE); 130 } 131 } 132 132 retvalue = 0; 133 133 goto END; … … 154 154 155 155 case WM_MDIGETACTIVE: 156 dprintf(("WM_MDIGETACTIVE: %x %x", this, (activeChild) ? activeChild->getWindowHandle() : 0)); 156 157 if (lParam) 157 158 *(BOOL *)lParam = (maximizedChild != 0); … … 182 183 break; 183 184 184 185 185 case WM_MDIRESTORE: 186 186 ::SendMessageA( (HWND)wParam, WM_SYSCOMMAND, SC_RESTORE, 0); 187 187 retvalue = 0; 188 188 goto END; 189 case WM_MDISETMENU: 190 retvalue = setMDIMenu((HMENU)wParam, (HMENU)lParam ); 191 goto END; 192 193 case WM_MDIREFRESHMENU: 194 retvalue = refreshMDIMenu((HMENU)wParam, (HMENU)lParam ); 195 goto END; 196 189 197 #if 0 190 case WM_MDISETMENU:191 retvalue = MDISetMenu( hwnd, (HMENU)wParam, (HMENU)lParam );192 goto END;193 194 case WM_MDIREFRESHMENU:195 retvalue = MDIRefreshMenu( hwnd, (HMENU)wParam, (HMENU)lParam );196 goto END;197 198 198 case WM_MDITILE: 199 199 mdiFlags |= MDIF_NEEDUPDATE; … … 294 294 } 295 295 /********************************************************************** 296 * MDI_GetWindow296 * MDI_GetWindow 297 297 * 298 298 * returns "activateable" child different from the current or zero … … 316 316 if (!curchild->getOwner() && (curchild->getStyle() & dwStyleMask) == WS_VISIBLE ) 317 317 { 318 lastchild = curchild;319 if ( bNext ) break;318 lastchild = curchild; 319 if ( bNext ) break; 320 320 } 321 321 } … … 366 366 } 367 367 368 dprintf(("childActivate: %x %x", this, child->getWindowHandle())); 368 369 activeChild = child; 369 370 … … 448 449 if( child == getMaximizedChild() ) 449 450 { 450 // MDI_RestoreFrameMenu(w_parent->parent,child);451 restoreFrameMenu(child); 451 452 setMaximizedChild(NULL); 452 453 updateFrameText(TRUE,NULL); … … 531 532 getParent()->SetWindowPos(0,0,0,0,0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); 532 533 } 534 /********************************************************************** 535 * MDISetMenu 536 */ 537 LRESULT Win32MDIClientWindow::setMDIMenu(HMENU hmenuFrame, HMENU hmenuWindow) 538 { 539 HWND hwndFrame = ::GetParent(getWindowHandle()); 540 HMENU oldFrameMenu = ::GetMenu(hwndFrame); 541 542 if( maximizedChild && hmenuFrame && hmenuFrame!=oldFrameMenu ) 543 restoreFrameMenu(maximizedChild); 544 545 if( hmenuWindow && hmenuWindow != hWindowMenu ) 546 { 547 /* delete menu items from ci->hWindowMenu 548 * and add them to hmenuWindow */ 549 550 INT i = GetMenuItemCount(hWindowMenu) - 1; 551 INT pos = GetMenuItemCount(hmenuWindow) + 1; 552 553 AppendMenuA( hmenuWindow, MF_SEPARATOR, 0, NULL); 554 555 if( nActiveChildren ) 556 { 557 INT j = i - nActiveChildren + 1; 558 char buffer[100]; 559 UINT id,state; 560 561 for( ; i >= j ; i-- ) 562 { 563 id = GetMenuItemID(hWindowMenu,i ); 564 state = GetMenuState(hWindowMenu,i,MF_BYPOSITION); 565 566 GetMenuStringA(hWindowMenu, i, buffer, 100, MF_BYPOSITION); 567 568 DeleteMenu(hWindowMenu, i , MF_BYPOSITION); 569 InsertMenuA(hmenuWindow, pos, MF_BYPOSITION | MF_STRING, 570 id, buffer); 571 CheckMenuItem(hmenuWindow ,pos , MF_BYPOSITION | (state & MF_CHECKED)); 572 } 573 } 574 575 /* remove separator */ 576 DeleteMenu(hWindowMenu, i, MF_BYPOSITION); 577 578 hWindowMenu = hmenuWindow; 579 } 580 581 if( hmenuFrame && hmenuFrame!=oldFrameMenu) 582 { 583 ::SetMenu(hwndFrame, hmenuFrame); 533 584 #if 0 534 /********************************************************************** 535 * MDICascade 585 if( ci->hwndChildMaximized ) 586 MDI_AugmentFrameMenu(ci, w->parent, ci->hwndChildMaximized ); 587 #endif 588 return oldFrameMenu; 589 } 590 return 0; 591 } 592 593 /********************************************************************** 594 * MDIRefreshMenu 595 */ 596 LRESULT Win32MDIClientWindow::refreshMDIMenu(HMENU hmenuFrame, HMENU hmenuWindow) 597 { 598 HMENU oldFrameMenu = getParent()->GetMenu(); 599 600 // FIXME("partially function stub\n"); 601 602 return oldFrameMenu; 603 } 604 /********************************************************************** 605 * MDI_RestoreFrameMenu 606 */ 607 BOOL Win32MDIClientWindow::restoreFrameMenu(Win32BaseWindow *child) 608 { 609 MENUITEMINFOA menuInfo; 610 INT nItems = GetMenuItemCount(getParent()->GetMenu()) - 1; 611 UINT iId = GetMenuItemID(getParent()->GetMenu(),nItems) ; 612 613 if(!(iId == SC_RESTORE || iId == SC_CLOSE) ) 614 return 0; 615 616 /* 617 * Remove the system menu, If that menu is the icon of the window 618 * as it is in win95, we have to delete the bitmap. 619 */ 620 menuInfo.cbSize = sizeof(MENUITEMINFOA); 621 menuInfo.fMask = MIIM_DATA | MIIM_TYPE; 622 623 GetMenuItemInfoA(getParent()->GetMenu(), 624 0, 625 TRUE, 626 &menuInfo); 627 628 RemoveMenu(getParent()->GetMenu(),0,MF_BYPOSITION); 629 630 //TODO: See augmentframemenu 631 #if 0 632 if ((menuInfo.fType & MFT_BITMAP) && 633 (LOWORD(menuInfo.dwTypeData)!=0) && 634 (LOWORD(menuInfo.dwTypeData)!=hBmpClose) ) 635 { 636 DeleteObject((HBITMAP)LOWORD(menuInfo.dwTypeData)); 637 } 638 #endif 639 640 /* close */ 641 DeleteMenu(getParent()->GetMenu(),GetMenuItemCount(getParent()->GetMenu()) - 1,MF_BYPOSITION); 642 643 /* restore */ 644 DeleteMenu(getParent()->GetMenu(),GetMenuItemCount(getParent()->GetMenu()) - 1,MF_BYPOSITION); 645 /* minimize */ 646 DeleteMenu(getParent()->GetMenu(),GetMenuItemCount(getParent()->GetMenu()) - 1,MF_BYPOSITION); 647 648 DrawMenuBar(getParent()->getWindowHandle()); 649 650 return 1; 651 } 652 653 #if 0 654 /********************************************************************** 655 * MDICascade 536 656 */ 537 657 LONG Win32MDIClientWindow::cascade() 538 658 { 539 WND** ppWnd;540 UINT total;659 WND** ppWnd; 660 UINT total; 541 661 542 662 if (getMaximizedChild()) … … 546 666 547 667 if ((ppWnd = WIN_BuildWinArray(clientWnd, BWA_SKIPHIDDEN | BWA_SKIPOWNED | 548 BWA_SKIPICONIC, &total)))549 { 550 WND**heapPtr = ppWnd;551 if( total )552 {553 INTdelta = 0, n = 0;554 POINTpos[2];555 if( total < ci->nActiveChildren )556 delta = GetSystemMetrics(SM_CYICONSPACING) +557 GetSystemMetrics(SM_CYICON);558 559 /* walk the list (backwards) and move windows */668 BWA_SKIPICONIC, &total))) 669 { 670 WND** heapPtr = ppWnd; 671 if( total ) 672 { 673 INT delta = 0, n = 0; 674 POINT pos[2]; 675 if( total < ci->nActiveChildren ) 676 delta = GetSystemMetrics(SM_CYICONSPACING) + 677 GetSystemMetrics(SM_CYICON); 678 679 /* walk the list (backwards) and move windows */ 560 680 while (*ppWnd) ppWnd++; 561 while (ppWnd != heapPtr)562 {681 while (ppWnd != heapPtr) 682 { 563 683 ppWnd--; 564 684 565 MDI_CalcDefaultChildPos(clientWnd, n++, pos, delta);566 SetWindowPos( (*ppWnd)->hwndSelf, 0, pos[0].x, pos[0].y,685 MDI_CalcDefaultChildPos(clientWnd, n++, pos, delta); 686 SetWindowPos( (*ppWnd)->hwndSelf, 0, pos[0].x, pos[0].y, 567 687 pos[1].x, pos[1].y, 568 688 SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER); 569 }570 }571 WIN_ReleaseWinArray(heapPtr);689 } 690 } 691 WIN_ReleaseWinArray(heapPtr); 572 692 } 573 693 … … 579 699 580 700 /********************************************************************** 581 * MDITile701 * MDITile 582 702 */ 583 703 void Win32MDIClientWindow::MDITile(WPARAM wParam ) 584 704 { 585 WND** ppWnd;586 UINT total = 0;705 WND** ppWnd; 706 UINT total = 0; 587 707 588 708 if (getMaximizedChild()) … … 592 712 593 713 ppWnd = WIN_BuildWinArray(wndClient, BWA_SKIPHIDDEN | BWA_SKIPOWNED | BWA_SKIPICONIC | 594 ((wParam & MDITILE_SKIPDISABLED)? BWA_SKIPDISABLED : 0), &total );714 ((wParam & MDITILE_SKIPDISABLED)? BWA_SKIPDISABLED : 0), &total ); 595 715 596 716 TRACE("%u windows to tile\n", total); … … 598 718 if( ppWnd ) 599 719 { 600 WND**heapPtr = ppWnd;601 602 if( total )603 {604 RECTrect;605 intx, y, xsize, ysize;606 introws, columns, r, c, i;607 608 GetClientRect(wndClient->hwndSelf,&rect);609 rows = (int) sqrt((double)total);610 columns = total / rows;611 612 if( wParam & MDITILE_HORIZONTAL ) /* version >= 3.1 */613 {614 i = rows;615 rows = columns; /* exchange r and c */616 columns = i;617 }618 619 if( total != ci->nActiveChildren)620 {621 y = rect.bottom - 2 * GetSystemMetrics(SM_CYICONSPACING) - GetSystemMetrics(SM_CYICON);622 rect.bottom = ( y - GetSystemMetrics(SM_CYICON) < rect.top )? rect.bottom: y;623 }624 625 ysize = rect.bottom / rows;626 xsize = rect.right / columns;627 628 for (x = i = 0, c = 1; c <= columns && *ppWnd; c++)629 {630 if (c == columns)631 {632 rows = total - i;633 ysize = rect.bottom / rows;634 }635 636 y = 0;637 for (r = 1; r <= rows && *ppWnd; r++, i++)638 {639 SetWindowPos((*ppWnd)->hwndSelf, 0, x, y, xsize, ysize,640 SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER);720 WND** heapPtr = ppWnd; 721 722 if( total ) 723 { 724 RECT rect; 725 int x, y, xsize, ysize; 726 int rows, columns, r, c, i; 727 728 GetClientRect(wndClient->hwndSelf,&rect); 729 rows = (int) sqrt((double)total); 730 columns = total / rows; 731 732 if( wParam & MDITILE_HORIZONTAL ) /* version >= 3.1 */ 733 { 734 i = rows; 735 rows = columns; /* exchange r and c */ 736 columns = i; 737 } 738 739 if( total != ci->nActiveChildren) 740 { 741 y = rect.bottom - 2 * GetSystemMetrics(SM_CYICONSPACING) - GetSystemMetrics(SM_CYICON); 742 rect.bottom = ( y - GetSystemMetrics(SM_CYICON) < rect.top )? rect.bottom: y; 743 } 744 745 ysize = rect.bottom / rows; 746 xsize = rect.right / columns; 747 748 for (x = i = 0, c = 1; c <= columns && *ppWnd; c++) 749 { 750 if (c == columns) 751 { 752 rows = total - i; 753 ysize = rect.bottom / rows; 754 } 755 756 y = 0; 757 for (r = 1; r <= rows && *ppWnd; r++, i++) 758 { 759 SetWindowPos((*ppWnd)->hwndSelf, 0, x, y, xsize, ysize, 760 SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER); 641 761 y += ysize; 642 ppWnd++;643 }644 x += xsize;645 }646 }647 WIN_ReleaseWinArray(heapPtr);762 ppWnd++; 763 } 764 x += xsize; 765 } 766 } 767 WIN_ReleaseWinArray(heapPtr); 648 768 } 649 769 … … 654 774 655 775 /********************************************************************** 656 * MDI_AugmentFrameMenu776 * MDI_AugmentFrameMenu 657 777 */ 658 778 BOOL Win32MDIClientWindow::augmentFrameMenu(HWND hChild ) 659 779 { 660 WND* child = WIN_FindWndPtr(hChild);661 HMENU hSysPopup = 0;780 WND* child = WIN_FindWndPtr(hChild); 781 HMENU hSysPopup = 0; 662 782 HBITMAP hSysMenuBitmap = 0; 663 783 … … 672 792 673 793 if (!(hSysPopup = LoadMenuA(GetModuleHandleA("USER32"), "SYSMENU"))) 674 return 0;794 return 0; 675 795 676 796 TRACE("\tgot popup %04x in sysmenu %04x\n", 677 hSysPopup, child->hSysMenu);797 hSysPopup, child->hSysMenu); 678 798 679 799 AppendMenuA(frame->wIDmenu,MF_HELP | MF_BITMAP, … … 722 842 { 723 843 TRACE("not inserted\n"); 724 DestroyMenu(hSysPopup);725 return 0;844 DestroyMenu(hSysPopup); 845 return 0; 726 846 } 727 847 … … 745 865 746 866 /********************************************************************** 747 * MDI_RestoreFrameMenu867 * MDI_RestoreFrameMenu 748 868 */ 749 869 static BOOL MDI_RestoreFrameMenu( WND *frameWnd, HWND hChild ) … … 756 876 757 877 if(!(iId == SC_RESTORE || iId == SC_CLOSE) ) 758 return 0;878 return 0; 759 879 760 880 /* … … 766 886 767 887 GetMenuItemInfoA(frameWnd->wIDmenu, 768 0,769 TRUE,770 &menuInfo);888 0, 889 TRUE, 890 &menuInfo); 771 891 772 892 RemoveMenu(frameWnd->wIDmenu,0,MF_BYPOSITION); 773 893 774 894 if ( (menuInfo.fType & MFT_BITMAP) && 775 (LOWORD(menuInfo.dwTypeData)!=0) &&776 (LOWORD(menuInfo.dwTypeData)!=hBmpClose) )895 (LOWORD(menuInfo.dwTypeData)!=0) && 896 (LOWORD(menuInfo.dwTypeData)!=hBmpClose) ) 777 897 { 778 898 DeleteObject((HBITMAP)LOWORD(menuInfo.dwTypeData)); -
trunk/src/user32/win32wmdiclient.h
r1361 r1429 1 /* $Id: win32wmdiclient.h,v 1. 3 1999-10-19 18:02:08sandervl Exp $ */1 /* $Id: win32wmdiclient.h,v 1.4 1999-10-24 12:30:29 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 60 60 61 61 LRESULT setMDIMenu(HMENU hmenuFrame, HMENU hmenuWindow); 62 LRESULT refreshMDIMenu(HMENU hmenuFrame, HMENU hmenuWindow); 63 BOOL restoreFrameMenu(Win32BaseWindow *child); 62 64 63 65 LRESULT MDIClientWndProc(UINT message, WPARAM wParam, LPARAM lParam); -
trunk/src/user32/winaccel.cpp
r949 r1429 1 /* $Id: winaccel.cpp,v 1. 1 1999-09-15 23:19:02sandervl Exp $ */1 /* $Id: winaccel.cpp,v 1.2 1999-10-24 12:30:29 sandervl Exp $ */ 2 2 /* 3 3 * Win32 accelartor key functions for OS/2 … … 42 42 43 43 if(HIWORD(haccel) == 0) { 44 dprintf(("DestroyAcceleratorTable: invalid haccel %x", haccel));45 SetLastError(ERROR_INVALID_PARAMETER);46 return FALSE;44 dprintf(("DestroyAcceleratorTable: invalid haccel %x", haccel)); 45 SetLastError(ERROR_INVALID_PARAMETER); 46 return FALSE; 47 47 } 48 48 dprintf(("DestroyAcceleratorTable %x\n", haccel)); … … 65 65 } 66 66 if(window->GetAccelTable() != haccel) { 67 dprintf(("TranslateAcceleratorA %X %X %X", hwnd, haccel, lpmsg->hwnd));68 window->SetAccelTable(haccel);67 dprintf(("TranslateAcceleratorA %X %X %X", hwnd, haccel, lpmsg->hwnd)); 68 window->SetAccelTable(haccel); 69 69 } 70 70
Note:
See TracChangeset
for help on using the changeset viewer.
