- Timestamp:
- Nov 9, 1999, 6:09:27 PM (26 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/imagelist.c
r1058 r1668 1 /* $Id: imagelist.c,v 1. 7 1999-09-26 11:01:09 achimhaExp $ */1 /* $Id: imagelist.c,v 1.8 1999-11-09 17:09:26 cbratschi Exp $ */ 2 2 /* 3 3 * ImageList implementation … … 242 242 { 243 243 /* to obtain a transparent look, background color should be set 244 to white and foreground color to black when blting the 244 to white and foreground color to black when blting the 245 245 monochrome mask. */ 246 oldBkColor = SetBkColor(pimldp->hdcDst, RGB(0xff, 0xff, 0xff)); 246 oldBkColor = SetBkColor(pimldp->hdcDst, RGB(0xff, 0xff, 0xff)); 247 247 oldFgColor = SetTextColor(pimldp->hdcDst, RGB(0, 0, 0)); 248 248 … … 259 259 SRCPAINT); 260 260 261 SetBkColor(pimldp->hdcDst, oldBkColor); 262 261 SetBkColor(pimldp->hdcDst, oldBkColor); 262 SetTextColor(pimldp->hdcDst, oldFgColor); 263 263 } 264 264 /* Draw the image when no Background is specified … … 903 903 if (himl->cMaxImage > 0) { 904 904 himl->hbmImage = 905 905 CreateBitmap (himl->cx * himl->cMaxImage, himl->cy, 906 906 1, himl->uBitsPixel, NULL); 907 908 // 909 910 907 if (himl->hbmImage == 0) { 908 // ERR("Error creating image bitmap!\n"); 909 return NULL; 910 } 911 911 } 912 912 else 913 913 himl->hbmImage = 0; 914 914 915 915 if ( (himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) { 916 916 himl->hbmMask = CreateBitmap (himl->cx * himl->cMaxImage, himl->cy, … … 1456 1456 1457 1457 if ((himl == NULL) || (i < 0) || (i >= himl->cCurImage)) 1458 1458 return 0; 1459 1459 1460 1460 hdcSrc = CreateCompatibleDC(0); … … 1467 1467 hOldDstBitmap = (HBITMAP)SelectObject (hdcDst, ii.hbmMask); 1468 1468 if (himl->hbmMask) { 1469 1470 1471 1469 SelectObject (hdcSrc, himl->hbmMask); 1470 BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, 1471 hdcSrc, i * himl->cx, 0, SRCCOPY); 1472 1472 } 1473 1473 else 1474 1474 PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS); 1475 1475 1476 1476 /* draw image*/ … … 1479 1479 SelectObject (hdcDst, ii.hbmColor); 1480 1480 BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, 1481 1481 hdcSrc, i * himl->cx, 0, SRCCOPY); 1482 1482 1483 1483 /* … … 2136 2136 2137 2137 hBestFitIcon = CopyImage( 2138 hIcon, IMAGE_ICON, 2139 himl->cx, himl->cy, 2138 hIcon, IMAGE_ICON, 2139 himl->cx, himl->cy, 2140 2140 LR_COPYFROMRESOURCE); 2141 2141 … … 2185 2185 2186 2186 if(hBestFitIcon) 2187 2187 DestroyIcon(hBestFitIcon); 2188 2188 if (hdcImageList) 2189 2189 DeleteDC (hdcImageList); -
trunk/src/comctl32/resource.asm
r1584 r1668 2 2 ;/* Source : rsrc.rc */ 3 3 ;/* Cmdline: wrc -s -I. -IE:\IBMCPP\include -I..\..\include -I..\..\include\win -o resource.asm rsrc.rc */ 4 ;/* Date : Wed Nov 3 19:18:591999 */4 ;/* Date : Wed Nov 3 23:21:54 1999 */ 5 5 6 6 .386p … … 12 12 public _Resource_PEResTab 13 13 dd 0 14 dd 03820 7c93h14 dd 03820b582h 15 15 dd 0 16 16 dw 0, 4 … … 25 25 L2: 26 26 dd 0 27 dd 03820 7c93h27 dd 03820b582h 28 28 dd 0 29 29 dw 0, 6 … … 42 42 L4: 43 43 dd 0 44 dd 03820 7c93h44 dd 03820b582h 45 45 dd 0 46 46 dw 0, 1 … … 49 49 L5: 50 50 dd 0 51 dd 03820 7c93h51 dd 03820b582h 52 52 dd 0 53 53 dw 0, 3 … … 60 60 L16: 61 61 dd 0 62 dd 03820 7c93h62 dd 03820b582h 63 63 dd 0 64 64 dw 0, 1 … … 67 67 L2_120: 68 68 dd 0 69 dd 03820 7c93h69 dd 03820b582h 70 70 dd 0 71 71 dw 0, 1 … … 74 74 L2_121: 75 75 dd 0 76 dd 03820 7c93h76 dd 03820b582h 77 77 dd 0 78 78 dw 0, 1 … … 81 81 L2_124: 82 82 dd 0 83 dd 03820 7c93h83 dd 03820b582h 84 84 dd 0 85 85 dw 0, 1 … … 88 88 L2_125: 89 89 dd 0 90 dd 03820 7c93h90 dd 03820b582h 91 91 dd 0 92 92 dw 0, 1 … … 95 95 L2_130: 96 96 dd 0 97 dd 03820 7c93h97 dd 03820b582h 98 98 dd 0 99 99 dw 0, 1 … … 102 102 L2_131: 103 103 dd 0 104 dd 03820 7c93h104 dd 03820b582h 105 105 dd 0 106 106 dw 0, 1 … … 109 109 L4_300: 110 110 dd 0 111 dd 03820 7c93h111 dd 03820b582h 112 112 dd 0 113 113 dw 0, 1 … … 116 116 L5_200: 117 117 dd 0 118 dd 03820 7c93h118 dd 03820b582h 119 119 dd 0 120 120 dw 0, 1 … … 123 123 L5_1006: 124 124 dd 0 125 dd 03820 7c93h125 dd 03820b582h 126 126 dd 0 127 127 dw 0, 1 … … 130 130 L5_1020: 131 131 dd 0 132 dd 03820 7c93h132 dd 03820b582h 133 133 dd 0 134 134 dw 0, 1 … … 137 137 L16_1: 138 138 dd 0 139 dd 03820 7c93h139 dd 03820b582h 140 140 dd 0 141 141 dw 0, 1 -
trunk/src/comctl32/trackbar.c
r1431 r1668 1 /* $Id: trackbar.c,v 1.2 1 1999-10-24 22:49:49 sandervlExp $ */1 /* $Id: trackbar.c,v 1.22 1999-11-09 17:09:27 cbratschi Exp $ */ 2 2 /* 3 3 * Trackbar control … … 588 588 oldPen = SelectObject(hdc,pen); 589 589 MoveToEx(hdc,points[4].x,points[4].y,NULL); 590 LineTo(hdc,points[3].x -1,points[3].y-1);590 LineTo(hdc,points[3].x,points[3].y); 591 591 pen = GetSysColorPen(COLOR_BTNHIGHLIGHT); 592 592 SelectObject(hdc,pen); 593 593 MoveToEx(hdc,points[4].x,points[4].y+1,NULL); 594 LineTo(hdc,points[3].x- 2,points[3].y-1);594 LineTo(hdc,points[3].x-1,points[3].y); 595 595 SelectObject(hdc,oldPen); 596 596 -
trunk/src/comctl32/treeview.c
r1614 r1668 1 /* $Id: treeview.c,v 1.1 4 1999-11-05 12:53:06 phallerExp $ */1 /* $Id: treeview.c,v 1.15 1999-11-09 17:09:27 cbratschi Exp $ */ 2 2 /* Treeview control 3 3 * … … 496 496 { 497 497 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 498 499 TRACE("\n");498 499 //TRACE("\n"); 500 500 return (LRESULT) infoPtr->clrBk; 501 501 } … … 507 507 COLORREF prevColor=infoPtr->clrBk; 508 508 509 TRACE("\n");509 //TRACE("\n"); 510 510 infoPtr->clrBk=(COLORREF) lParam; 511 511 return (LRESULT) prevColor; … … 516 516 { 517 517 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 518 519 TRACE("\n");518 519 //TRACE("\n"); 520 520 return (LRESULT) infoPtr->clrText; 521 521 } … … 948 948 { 949 949 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 950 951 950 TEXTMETRICA tm; 951 HBRUSH hbrBk; 952 952 RECT rect; 953 953 HDC hdc; 954 954 INT iItem, indent, x, y, cx, height, itemHeight; 955 955 INT viewtop,viewbottom,viewleft,viewright; 956 956 TREEVIEW_ITEM *wineItem, *prevItem; 957 957 958 TRACE("\n");959 960 958 //TRACE("\n"); 959 960 hdc=GetDC (hwnd); 961 961 962 962 if (infoPtr->Timer & TV_REFRESH_TIMER_SET) { 963 964 963 KillTimer (hwnd, TV_REFRESH_TIMER); 964 infoPtr->Timer &= ~TV_REFRESH_TIMER_SET; 965 965 } 966 966 … … 970 970 971 971 infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify 972 973 974 975 976 977 978 979 980 972 (hwnd, CDDS_PREPAINT, hdc, rect); 973 974 if (infoPtr->cdmode==CDRF_SKIPDEFAULT) { 975 ReleaseDC (hwnd, hdc); 976 return; 977 } 978 979 infoPtr->uVisibleHeight= rect.bottom-rect.top; 980 infoPtr->uVisibleWidth= rect.right-rect.left; 981 981 982 982 viewtop=infoPtr->cy; … … 996 996 indent=0; 997 997 x=y=0; 998 TRACE("[%d %d %d %d]\n",viewtop,viewbottom,viewleft,viewright);998 //TRACE("[%d %d %d %d]\n",viewtop,viewbottom,viewleft,viewright); 999 999 1000 1000 while (iItem) { 1001 1001 prevItem=wineItem; 1002 1002 wineItem= & infoPtr->items[iItem]; 1003 1003 wineItem->iLevel=indent; 1004 1004 1005 1005 ImageList_GetIconSize (infoPtr->himlNormal, &cx, &itemHeight); 1006 1006 if (infoPtr->uItemHeight>itemHeight) 1007 1008 1009 1010 1011 1012 1013 infoPtr->uRealItemHeight=itemHeight; 1007 itemHeight=infoPtr->uItemHeight; 1008 1009 GetTextMetricsA (hdc, &tm); 1010 if ((tm.tmHeight + tm.tmExternalLeading) > itemHeight) 1011 itemHeight=tm.tmHeight + tm.tmExternalLeading; 1012 1013 infoPtr->uRealItemHeight=itemHeight; 1014 1014 1015 1015 1016 1016 /* FIXME: remove this in later stage */ 1017 1017 /* 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1018 if (wineItem->pszText!=LPSTR_TEXTCALLBACK32A) 1019 TRACE (treeview, "%d %d [%d %d %d %d] (%s)\n",y,x, 1020 wineItem->rect.top, wineItem->rect.bottom, 1021 wineItem->rect.left, wineItem->rect.right, 1022 wineItem->pszText); 1023 else 1024 TRACE (treeview, "%d [%d %d %d %d] (CALLBACK)\n", 1025 wineItem->hItem, 1026 wineItem->rect.top, wineItem->rect.bottom, 1027 wineItem->rect.left, wineItem->rect.right); 1028 1028 */ 1029 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 if (x>infoPtr->uTotalWidth) 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1030 height=itemHeight * wineItem->iIntegral +1; 1031 if ((y >= viewtop) && (y <= viewbottom) && 1032 (x >= viewleft ) && (x <= viewright)) { 1033 wineItem->visible = TRUE; 1034 wineItem->rect.top = y - infoPtr->cy + rect.top; 1035 wineItem->rect.bottom = wineItem->rect.top + height ; 1036 wineItem->rect.left = x - infoPtr->cx + rect.left; 1037 wineItem->rect.right = rect.right; 1038 if (!infoPtr->firstVisible) 1039 infoPtr->firstVisible=wineItem->hItem; 1040 TREEVIEW_DrawItem (hwnd, hdc, wineItem); 1041 } 1042 else { 1043 wineItem->visible = FALSE; 1044 wineItem->rect.left = wineItem->rect.top = 0; 1045 wineItem->rect.right= wineItem->rect.bottom = 0; 1046 wineItem->text.left = wineItem->text.top = 0; 1047 wineItem->text.right= wineItem->text.bottom = 0; 1048 } 1049 1050 /* look up next item */ 1051 1052 if ((wineItem->firstChild) && (wineItem->state & TVIS_EXPANDED)) { 1053 iItem=(INT)wineItem->firstChild; 1054 indent++; 1055 x+=infoPtr->uIndent; 1056 if (x>infoPtr->uTotalWidth) 1057 infoPtr->uTotalWidth=x; 1058 } 1059 else { 1060 iItem=(INT)wineItem->sibling; 1061 while ((!iItem) && (indent>0)) { 1062 indent--; 1063 x-=infoPtr->uIndent; 1064 prevItem=wineItem; 1065 wineItem=&infoPtr->items[(INT)wineItem->parent]; 1066 iItem=(INT)wineItem->sibling; 1067 } 1068 } 1069 1069 y +=height; 1070 } 1070 } /* while */ 1071 1071 1072 1072 /* FIXME: infoPtr->uTotalWidth should also take item label into account */ … … 1075 1075 infoPtr->uTotalHeight=y; 1076 1076 if (y >= (viewbottom-viewtop)) { 1077 1078 1079 1080 1081 1082 1083 1077 if (!(infoPtr->uInternalStatus & TV_VSCROLL)) 1078 ShowScrollBar (hwnd, SB_VERT, TRUE); 1079 infoPtr->uInternalStatus |=TV_VSCROLL; 1080 SetScrollRange (hwnd, SB_VERT, 0, 1081 y - infoPtr->uVisibleHeight, FALSE); 1082 SetScrollPos (hwnd, SB_VERT, infoPtr->cy, TRUE); 1083 } 1084 1084 else { 1085 1086 1087 1088 1089 1090 1091 1092 1093 1085 if (infoPtr->uInternalStatus & TV_VSCROLL) 1086 ShowScrollBar (hwnd, SB_VERT, FALSE); 1087 infoPtr->uInternalStatus &= ~TV_VSCROLL; 1088 } 1089 1090 1091 if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT) 1092 infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify 1093 (hwnd, CDDS_POSTPAINT, hdc, rect); 1094 1094 1095 1095 ReleaseDC (hwnd, hdc); 1096 TRACE("done\n");1096 //TRACE("done\n"); 1097 1097 } 1098 1098 … … 1468 1468 if (!TREEVIEW_ValidItem(infoPtr, parent)) 1469 1469 { 1470 ERR ("invalid item hParent=%x\n", (INT)parent);1470 //ERR ("invalid item hParent=%x\n", (INT)parent); 1471 1471 return FALSE; 1472 1472 } … … 1732 1732 switch ((DWORD) ptdi->hInsertAfter) { 1733 1733 case (DWORD) TVI_FIRST: 1734 1734 if (sibItem==wineItem) break; 1735 1735 if (wineItem->parent) { 1736 1736 wineItem->sibling=parentItem->firstChild;
Note:
See TracChangeset
for help on using the changeset viewer.