Changeset 2852 for trunk/src/user32/static.cpp
- Timestamp:
- Feb 21, 2000, 6:25:33 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/static.cpp
r2804 r2852 1 /* $Id: static.cpp,v 1.1 7 2000-02-16 14:34:34 sandervlExp $ */1 /* $Id: static.cpp,v 1.18 2000-02-21 17:25:29 cbratschi Exp $ */ 2 2 /* 3 3 * Static control … … 7 7 * Copyright David W. Metcalfe, 1993 8 8 * 9 * Corel version: 20000212 9 10 * WINE version: 990923 10 11 * … … 19 20 #include "static.h" 20 21 21 #define DBG_LOCALLOG 22 #define DBG_LOCALLOG DBG_static 22 23 #include "dbglocal.h" 23 24 … … 718 719 FillRect( hdc, &rc, hbrush ); 719 720 720 if (infoPtr->hIcon) { 721 if (infoPtr->hIcon) 722 { 721 723 BITMAP bm; 722 SIZE sz; 723 724 if(GetObjectType(infoPtr->hIcon) != OBJ_BITMAP) 725 return; 724 725 if(GetObjectType(infoPtr->hIcon) != OBJ_BITMAP) return; 726 726 if (!(hMemDC = CreateCompatibleDC( hdc ))) return; 727 GetObjectA(infoPtr->hIcon, sizeof(bm), &bm); 728 GetBitmapDimensionEx(infoPtr->hIcon, &sz); 729 oldbitmap = SelectObject(hMemDC, infoPtr->hIcon); 730 if (dwStyle & SS_CENTERIMAGE) 731 BitBlt(hdc,sz.cx,sz.cy,bm.bmWidth,bm.bmHeight,hMemDC,(rc.right-bm.bmWidth)/2,(rc.bottom-bm.bmHeight)/2,SRCCOPY); 727 728 GetObjectA(infoPtr->hIcon, sizeof(bm), &bm); 729 oldbitmap = SelectObject(hMemDC, infoPtr->hIcon); 730 731 // Paint the image in center area 732 if(dwStyle & SS_CENTERIMAGE) 733 { 734 SIZE szbm; 735 SIZE szdc; 736 737 if(bm.bmWidth > rc.right - rc.left) 738 { 739 szdc.cx = 0; 740 szbm.cx = (bm.bmWidth - (rc.right - rc.left)) / 2; 741 bm.bmWidth = rc.right - rc.left; 742 } 743 else 744 { 745 szbm.cx = 0; 746 szdc.cx = ((rc.right - rc.left) - bm.bmWidth) / 2; 747 } 748 if(bm.bmHeight > rc.bottom - rc.top) 749 { 750 szdc.cy = 0; 751 szbm.cy = (bm.bmHeight - (rc.bottom - rc.top)) / 2; 752 bm.bmWidth = rc.bottom - rc.top; 753 } 754 else 755 { 756 szbm.cy = 0; 757 szdc.cy = ((rc.bottom - rc.top) - bm.bmHeight) / 2; 758 } 759 BitBlt(hdc, szdc.cx, szdc.cy, bm.bmWidth, bm.bmHeight, hMemDC, 760 szbm.cx, szbm.cy, SRCCOPY); 761 } 732 762 else 733 BitBlt(hdc,sz.cx,sz.cy,bm.bmWidth,bm.bmHeight,hMemDC,0,0,SRCCOPY); 734 SelectObject(hMemDC, oldbitmap); 735 DeleteDC(hMemDC); 763 { 764 BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY); 765 } 766 767 SelectObject(hMemDC, oldbitmap); 768 DeleteDC(hMemDC); 736 769 } 737 770 } … … 764 797 di.itemData = 0; 765 798 766 SendMessageA(GetParent(hwnd),WM_DRAWITEM,GetWindowLongA(hwnd,GWL_ID),(LPARAM)&di); 799 SendMessageA(GetParent(hwnd),WM_CTLCOLORSTATIC,hdc,hwnd); 800 SendMessageA(GetParent(hwnd),WM_DRAWITEM,di.CtlID,(LPARAM)&di); 767 801 } 768 802
Note:
See TracChangeset
for help on using the changeset viewer.