Changeset 2852 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Feb 21, 2000, 6:25:33 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r2834 r2852 1 /* $Id: win32wbase.cpp,v 1.16 5 2000-02-20 18:28:34cbratschi Exp $ */1 /* $Id: win32wbase.cpp,v 1.166 2000-02-21 17:25:31 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 8 8 * 9 9 * Parts based on Wine Windows code (windows\win.c) 10 * Corel version: corel20000212 10 11 * 11 12 * Copyright 1993, 1994, 1996 Alexandre Julliard … … 53 54 #include "dbglocal.h" 54 55 55 #define SC_ABOUTWINE (SC_SCREENSAVE+1)56 #define SC_PUTMARK (SC_SCREENSAVE+2)57 58 56 /* bits in the dwKeyData */ 59 57 #define KEYDATA_ALT 0x2000 … … 138 136 windowClass = 0; 139 137 140 iconResource = NULL; 138 hIcon = 0; 139 hIconSm = 0; 141 140 142 141 EraseBkgndFlag = TRUE; … … 581 580 fakeWinBase.pWindowClass = windowClass; 582 581 583 //Set icon from class 584 if(windowClass->getIcon()) 585 SetIcon(windowClass->getIcon()); 582 //Set icon from window or class 583 if (hIcon) 584 OSLibWinSetIcon(OS2HwndFrame,hIcon); 585 else if (windowClass->getIcon()) 586 OSLibWinSetIcon(OS2HwndFrame,windowClass->getIcon()); 587 586 588 /* Get class or window DC if needed */ 587 589 if(windowClass->getStyle() & CS_OWNDC) { … … 1479 1481 if( hdc ) 1480 1482 { 1481 if( (getStyle() & WS_MINIMIZE) && getWindowClass()->getIcon())1483 if( (getStyle() & WS_MINIMIZE) && (getWindowClass()->getIcon() && hIcon)) 1482 1484 { 1483 1485 int x = (rectWindow.right - rectWindow.left - GetSystemMetrics(SM_CXICON))/2; 1484 1486 int y = (rectWindow.bottom - rectWindow.top - GetSystemMetrics(SM_CYICON))/2; 1485 1487 dprintf(("Painting class icon: vis rect=(%i,%i - %i,%i)\n", ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom )); 1486 DrawIcon(hdc, x, y, getWindowClass()->getIcon() );1488 DrawIcon(hdc, x, y, hIcon ? hIcon:getWindowClass()->getIcon() ); 1487 1489 } 1488 1490 EndPaint(getWindowHandle(), &ps ); … … 1532 1534 { 1533 1535 POINT point; 1536 LRESULT retvalue; 1534 1537 1535 1538 point.x = (SHORT)LOWORD(lParam); 1536 1539 point.y = (SHORT)HIWORD(lParam); 1537 1540 1538 return HandleNCHitTest(point); 1541 retvalue = HandleNCHitTest(point); 1542 #if 0 //CB: let the Corel people fix the bugs first 1543 if(retvalue == HTMENU) 1544 MENU_TrackMouseMenuBar_MouseMove(Win32Hwnd,point,TRUE); 1545 else 1546 MENU_TrackMouseMenuBar_MouseMove(Win32Hwnd,point,FALSE); 1547 #endif 1548 return retvalue; 1539 1549 } 1540 1550 … … 1636 1646 if ((dwStyle & WS_VISIBLE) && wParam) return 0; 1637 1647 else if (!(dwStyle & WS_VISIBLE) && !wParam) return 0; 1638 ShowWindow(wParam ? SW_SHOW NOACTIVATE :SW_HIDE);1648 ShowWindow(wParam ? SW_SHOW:SW_HIDE); 1639 1649 return 0; 1640 1650 … … 1652 1662 case WM_QUERYDRAGICON: 1653 1663 { 1654 HICON h Icon = windowClass->getCursor();1664 HICON hDragIcon = windowClass->getCursor(); 1655 1665 UINT len; 1656 1666 1657 if(h Icon) return (LRESULT)hIcon;1667 if(hDragIcon) return (LRESULT)hDragIcon; 1658 1668 for(len = 1; len < 64; len++) 1659 1669 { 1660 h Icon = LoadIconA(hInstance,MAKEINTRESOURCEA(len));1661 if(h Icon)1662 return (LRESULT)h Icon;1670 hDragIcon = LoadIconA(hInstance,MAKEINTRESOURCEA(len)); 1671 if(hDragIcon) 1672 return (LRESULT)hDragIcon; 1663 1673 } 1664 1674 return (LRESULT)LoadIconA(0,IDI_APPLICATIONA); … … 1674 1684 case WM_SETICON: 1675 1685 case WM_GETICON: 1676 { 1677 LRESULT result = 0; 1678 if (!windowClass) return result; 1679 int index = GCL_HICON; 1680 1681 if (wParam == ICON_SMALL) 1682 index = GCL_HICONSM; 1683 1684 result = windowClass->getClassLongA(index); 1685 1686 { 1687 LRESULT result = 0; 1688 if (!windowClass) return result; 1689 /* Set the appropriate icon members in the window structure. */ 1690 if (wParam == ICON_SMALL) 1691 { 1692 result = hIconSm; 1686 1693 if (Msg == WM_SETICON) 1687 windowClass->setClassLongA(index, lParam); 1688 1689 return result; 1690 } 1694 hIconSm = (HICON)lParam; 1695 } 1696 else 1697 { 1698 result = hIcon; 1699 if (Msg == WM_SETICON) 1700 { 1701 hIcon = (HICON)lParam; 1702 OSLibWinSetIcon(OS2HwndFrame,hIcon); 1703 } 1704 } 1705 return result; 1706 } 1707 1708 case WM_HELP: 1709 if (getParent()) getParent()->SendInternalMessageA(Msg,wParam,lParam); 1710 break; 1691 1711 1692 1712 case WM_NOTIFY: … … 1957 1977 window = parentwindow; 1958 1978 } 1959 }1960 //******************************************************************************1961 //******************************************************************************1962 BOOL Win32BaseWindow::SetIcon(HICON hIcon)1963 {1964 dprintf(("Win32BaseWindow::SetIcon %x", hIcon));1965 if(OSLibWinSetIcon(OS2HwndFrame, hIcon) == TRUE) {1966 //TODO: Wine does't send these. Correct?1967 // SendInternalMessageA(WM_SETICON, ICON_BIG, hIcon);1968 return TRUE;1969 }1970 return FALSE;1971 1979 } 1972 1980 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.