- Timestamp:
- Oct 17, 1999, 9:32:05 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/button.cpp
r1320 r1343 1 /* $Id: button.cpp,v 1.1 1 1999-10-16 11:05:37 sandervlExp $ */1 /* $Id: button.cpp,v 1.12 1999-10-17 19:32:04 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 114 114 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 115 115 116 //PAINT_BUTTON(hwnd,dwStyle & 0x0f,ODA_DRAWENTIRE);116 //PAINT_BUTTON(hwnd,dwStyle & 0x0f,ODA_DRAWENTIRE); 117 117 //SvL: 09/10/99 Force it to redraw properly 118 118 InvalidateRect( hwnd, NULL, FALSE ); … … 167 167 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0f; 168 168 // if(style == BS_GROUPBOX) { 169 169 return DefWindowProcA(hwnd, WM_ERASEBKGND, wParam, lParam); 170 170 // } 171 171 // return 1; … … 947 947 /* assure that starting control is not disabled or invisible */ 948 948 // start = sibling = GetNextDlgGroupItem( parent, hwnd, TRUE ); 949 //@YD: bugfix 949 //@YD: bugfix 950 950 start = sibling = GetNextDlgGroupItem( parent, hwnd, FALSE ); 951 951 do -
trunk/src/user32/pmframe.cpp
r1333 r1343 1 /* $Id: pmframe.cpp,v 1. 7 1999-10-17 12:17:44 cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.8 1999-10-17 19:32:04 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 92 92 BOOL CanDrawSizeBox(Win32BaseWindow *win32wnd) 93 93 { 94 return ( !win32wnd->isChild()&& WinQueryWindowULong(win32wnd->getOS2FrameWindowHandle(),QWL_STYLE) & FS_SIZEBORDER94 return (win32wnd->getStyle() & WS_SIZEBOX_W && WinQueryWindowULong(win32wnd->getOS2FrameWindowHandle(),QWL_STYLE) & FS_SIZEBORDER 95 95 && win32wnd->getVertScrollHandle() && WinQueryWindow(win32wnd->getVertScrollHandle(),QW_PARENT) == win32wnd->getOS2FrameWindowHandle() 96 96 && win32wnd->getHorzScrollHandle() && WinQueryWindow(win32wnd->getHorzScrollHandle(),QW_PARENT) == win32wnd->getOS2FrameWindowHandle()); … … 272 272 273 273 GetSizeBox(win32wnd,&rect); 274 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN );274 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN | PSF_CLIPSIBLINGS); 275 275 DrawSizeBox(hps,rect); 276 276 WinReleasePS(hps); … … 293 293 rect.yTop = rect.yTop-rect.yBottom; 294 294 rect.xLeft = rect.yBottom = 0; 295 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN );295 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN | PSF_CLIPSIBLINGS); 296 296 DrawFrame(hps,&rect,win32wnd); 297 297 WinReleasePS(hps); … … 318 318 319 319 GetSizeBox(win32wnd,&rect); 320 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN );320 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN | PSF_CLIPSIBLINGS); 321 321 DrawSizeBox(hps,rect); 322 322 WinReleasePS(hps); … … 338 338 rect.yTop = rect.yTop-rect.yBottom; 339 339 rect.xLeft = rect.yBottom = 0; 340 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN );340 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN | PSF_CLIPSIBLINGS); 341 341 DrawFrame(hps,&rect,win32wnd); 342 342 WinReleasePS(hps); -
trunk/src/user32/static.cpp
r1203 r1343 1 /* $Id: static.cpp,v 1. 4 1999-10-08 21:26:08cbratschi Exp $ */1 /* $Id: static.cpp,v 1.5 1999-10-17 19:32:04 cbratschi Exp $ */ 2 2 /* 3 3 * Static control … … 63 63 STATICINFO *infoPtr = (STATICINFO *)GetInfoPtr(hwnd); 64 64 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 65 INT cx,cy; 65 ICONINFO ii; 66 BITMAP bmp; 66 67 67 68 if ((dwStyle & SS_TYPEMASK) != SS_ICON) return 0; … … 71 72 infoPtr->hIcon = hicon; 72 73 73 cx = GetSystemMetrics(SM_CXICON);74 cy = GetSystemMetrics(SM_CYICON);75 76 SetWindowPos(hwnd,0,0,0, cx,cy,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );74 GetIconInfo(hicon,&ii); 75 GetObjectA(ii.hbmColor,sizeof(BITMAP),(LPVOID)&bmp); 76 77 SetWindowPos(hwnd,0,0,0,bmp.bmWidth,bmp.bmHeight,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER ); 77 78 78 79 return prevIcon; … … 104 105 SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight, 105 106 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER ); 106 /* CB: alternative code, if necessary107 HDC hdc = GetDC(hwnd);108 BITMAPINFO info;109 110 ZeroMemory(&info,sizeof(info));111 if (GetDIBits(hdc,hbitmap,0,0,NULL,&info,0) != 0)112 {113 SetWindowPos(hwnd,0,0,0,info.bmiHeader.biWidth,info.bmiHeader.biHeight,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);114 }115 ReleaseDC(hwnd,hdc);116 */117 118 107 } 119 108 return hOldBitmap; -
trunk/src/user32/uitools.cpp
r1256 r1343 1 /* $Id: uitools.cpp,v 1.1 3 1999-10-12 14:47:22 sandervlExp $ */1 /* $Id: uitools.cpp,v 1.14 1999-10-17 19:32:05 cbratschi Exp $ */ 2 2 /* 3 3 * User Interface Functions … … 1762 1762 //****************************************************************************** 1763 1763 //****************************************************************************** 1764 BOOL WIN32API DrawIcon( HDC arg1, int arg2, int arg3, HICON arg4) 1765 { 1764 BOOL WIN32API DrawIcon( HDC hDC, int X, int Y, HICON hIcon) 1765 { 1766 ICONINFO ii; 1767 HDC hMemDC; 1768 BITMAP bmp; 1769 HBITMAP oldBmp; 1770 COLORREF oldFg,oldBg; 1771 1766 1772 #ifdef DEBUG 1767 1773 WriteLog("USER32: DrawIcon\n"); 1768 1774 #endif 1769 return O32_DrawIcon(arg1, arg2, arg3, arg4); 1775 1776 if (!hDC || !hIcon) 1777 { 1778 SetLastError(ERROR_INVALID_PARAMETER); 1779 1780 return FALSE; 1781 } 1782 1783 if (!GetIconInfo(hIcon,&ii)) return FALSE; 1784 GetObjectA(ii.hbmColor,sizeof(BITMAP),(LPVOID)&bmp); 1785 oldFg = SetTextColor(hDC,RGB(0,0,0)); 1786 oldBg = SetBkColor(hDC,RGB(255,255,255)); 1787 hMemDC = CreateCompatibleDC(hDC); 1788 oldBmp = SelectObject(hMemDC,ii.hbmMask); 1789 BitBlt(hDC,X,Y,bmp.bmWidth,bmp.bmHeight,hMemDC,0,0,SRCAND); 1790 SelectObject(hMemDC,ii.hbmColor); 1791 BitBlt(hDC,X,Y,bmp.bmWidth,bmp.bmHeight,hMemDC,0,0,SRCPAINT); 1792 SelectObject(hMemDC,ii.hbmMask); 1793 BitBlt(hDC,X,Y,bmp.bmWidth,bmp.bmHeight,hMemDC,0,bmp.bmHeight,SRCINVERT); 1794 SelectObject(hMemDC,oldBmp); 1795 DeleteObject(hMemDC); 1796 SetTextColor(hDC,oldFg); 1797 SetBkColor(hDC,oldBg); 1798 1799 return TRUE; 1770 1800 } 1771 1801 //****************************************************************************** 1772 1802 //****************************************************************************** 1773 BOOL WIN32API DrawIconEx(HDC hdc, int xLeft, int xRight, HICON hIcon,1803 BOOL WIN32API DrawIconEx(HDC hdc, int xLeft, int yTop, HICON hIcon, 1774 1804 int cxWidth, int cyWidth, UINT istepIfAniCur, 1775 1805 HBRUSH hbrFlickerFreeDraw, UINT diFlags) 1776 1806 { 1807 ICONINFO ii; 1808 HDC hMemDC; 1809 BITMAP bmp; 1810 HBITMAP oldBmp; 1811 COLORREF oldFg,oldBg; 1812 INT oldStretchMode; 1813 1777 1814 #ifdef DEBUG 1778 WriteLog("USER32: DrawIcon, partially implemented\n");1815 WriteLog("USER32: DrawIconEx\n"); 1779 1816 #endif 1780 return O32_DrawIcon(hdc, xLeft, xRight, hIcon); 1817 1818 //CB: istepIfAniCur, DI_COMPAT ignored 1819 1820 if (!hdc || !hIcon) 1821 { 1822 SetLastError(ERROR_INVALID_PARAMETER); 1823 1824 return FALSE; 1825 } 1826 1827 if (!GetIconInfo(hIcon,&ii)) return FALSE; 1828 GetObjectA(ii.hbmColor,sizeof(BITMAP),(LPVOID)&bmp); 1829 1830 /* Calculate the size of the destination image. */ 1831 if (cxWidth == 0) 1832 { 1833 if (diFlags & DI_DEFAULTSIZE) 1834 cxWidth = GetSystemMetrics(SM_CXICON); 1835 else 1836 cxWidth = bmp.bmWidth; 1837 } 1838 if (cyWidth == 0) 1839 { 1840 if (diFlags & DI_DEFAULTSIZE) 1841 cyWidth = GetSystemMetrics(SM_CYICON); 1842 else 1843 cyWidth = bmp.bmHeight; 1844 } 1845 1846 if (hbrFlickerFreeDraw) 1847 { 1848 HDC hBmpDC = CreateCompatibleDC(hdc); 1849 HBITMAP memBmp,oldMemBmp = CreateCompatibleBitmap(hdc,cxWidth,cyWidth); 1850 RECT rect; 1851 1852 oldMemBmp = SelectObject(hBmpDC,memBmp); 1853 rect.left = 0; 1854 rect.top = 0; 1855 rect.right = cxWidth; 1856 rect.bottom = cyWidth; 1857 FillRect(hBmpDC,&rect,hbrFlickerFreeDraw); 1858 oldFg = SetTextColor(hBmpDC,RGB(0,0,0)); 1859 oldBg = SetBkColor(hBmpDC,RGB(255,255,255)); 1860 hMemDC = CreateCompatibleDC(hdc); 1861 oldBmp = SelectObject(hMemDC,ii.hbmMask); 1862 oldStretchMode = SetStretchBltMode(hBmpDC,STRETCH_DELETESCANS); 1863 StretchBlt(hBmpDC,0,0,cxWidth,cyWidth,hMemDC,0,0,bmp.bmWidth,bmp.bmHeight,SRCAND); 1864 SelectObject(hMemDC,ii.hbmColor); 1865 StretchBlt(hBmpDC,0,0,cxWidth,cyWidth,hMemDC,0,0,bmp.bmWidth,bmp.bmHeight,SRCPAINT); 1866 SelectObject(hMemDC,ii.hbmMask); 1867 StretchBlt(hBmpDC,0,0,cxWidth,cyWidth,hMemDC,0,bmp.bmHeight,bmp.bmWidth,bmp.bmHeight,SRCINVERT); 1868 BitBlt(hdc,xLeft,yTop,cxWidth,cyWidth,hBmpDC,0,0,SRCCOPY); 1869 SelectObject(hMemDC,oldBmp); 1870 DeleteObject(hMemDC); 1871 SetTextColor(hdc,oldFg); 1872 SetBkColor(hdc,oldBg); 1873 SetStretchBltMode(hBmpDC,oldStretchMode); 1874 SelectObject(hBmpDC,oldMemBmp); 1875 DeleteObject(hBmpDC); 1876 DeleteObject(memBmp); 1877 } else 1878 { 1879 oldFg = SetTextColor(hdc,RGB(0,0,0)); 1880 oldBg = SetBkColor(hdc,RGB(255,255,255)); 1881 hMemDC = CreateCompatibleDC(hdc); 1882 oldBmp = SelectObject(hMemDC,ii.hbmMask); 1883 oldStretchMode = SetStretchBltMode(hdc,STRETCH_DELETESCANS); 1884 StretchBlt(hdc,xLeft,yTop,cxWidth,cyWidth,hMemDC,0,0,bmp.bmWidth,bmp.bmHeight,SRCAND); 1885 SelectObject(hMemDC,ii.hbmColor); 1886 StretchBlt(hdc,xLeft,yTop,cxWidth,cyWidth,hMemDC,0,0,bmp.bmWidth,bmp.bmHeight,SRCPAINT); 1887 SelectObject(hMemDC,ii.hbmMask); 1888 StretchBlt(hdc,xLeft,yTop,cxWidth,cyWidth,hMemDC,0,bmp.bmHeight,bmp.bmWidth,bmp.bmHeight,SRCINVERT); 1889 SelectObject(hMemDC,oldBmp); 1890 DeleteObject(hMemDC); 1891 SetTextColor(hdc,oldFg); 1892 SetBkColor(hdc,oldBg); 1893 SetStretchBltMode(hdc,oldStretchMode); 1894 } 1895 1896 return TRUE; 1781 1897 } 1782 1898 //****************************************************************************** … … 1789 1905 if(!window) { 1790 1906 dprintf(("DrawMenuBar, window %x not found", hwnd)); 1791 1907 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 1792 1908 return 0; 1793 1909 }
Note:
See TracChangeset
for help on using the changeset viewer.