Changeset 3409 for trunk/src/comctl32/listview.cpp
- Timestamp:
- Apr 16, 2000, 8:26:59 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/listview.cpp
r3385 r3409 1 /*$Id: listview.cpp,v 1.1 3 2000-04-15 14:22:19cbratschi Exp $*/1 /*$Id: listview.cpp,v 1.14 2000-04-16 18:26:57 cbratschi Exp $*/ 2 2 /* 3 3 * Listview control … … 15 15 * - rcView and origin (need testcase!!!) 16 16 * - rcView not updated in LVM_SETITEMPOSITION and other messages 17 * - many position bugs 18 * - work area not used 19 * - custom draw 20 * - drag'n'drop (-> treeview) 21 * - edit timer 17 22 * - LISTVIEW_SetBkImage 18 23 * - LISTVIEW_GetBkImage … … 21 26 * - LVS_OWNERDRAWFIXED 22 27 * - LVS_EX_* 28 * LVS_EX_CHECKBOXES 29 * LVS_EX_TRACKSELECT 30 * LVS_EX_FULLROWSELECT 31 * LVS_EX_ONECLICKACTIVATE 32 * LVS_EX_TWOCLICKACTIVATE 33 * LVS_EX_FLATSB 34 * LVS_EX_REGIONAL 35 * LVS_EX_INFOTIP 36 * LVS_EX_UNDERLINEHOT 37 * LVS_EX_UNDERLINECOLD 38 * LVS_EX_MULTIWORKAREAS 23 39 * - many things untested! 24 40 * … … 26 42 * LISTVIEW_SetItemCount : not completed 27 43 * 28 * Advanced functionality: 29 * LISTVIEW_GetNumberOfWorkAreas : not implemented 30 * LISTVIEW_GetHoverTime : not implemented 31 * LISTVIEW_GetISearchString : not implemented 32 * 44 * Status: all messages done, many styles not (yet) implemented 45 * Version: 5.80 33 46 */ 34 47 … … 79 92 #define LISTVIEW_SCROLL_DIV_SIZE 1 80 93 94 #define DEFAULT_HOVERTIME 500 95 #define LV_ISEARCH_DELAY 1000 //documented in ListView_Message_Processing.htm 96 81 97 /* 82 98 * macros … … 85 101 /* retrieve the number of items in the listview */ 86 102 #define GETITEMCOUNT(infoPtr) ((infoPtr)->hdpaItems->nItemCount) 87 88 103 89 104 HWND CreateEditLabel(LPCSTR text, DWORD style, INT x, INT y, … … 92 107 93 108 #define LISTVIEW_GetInfoPtr(hwnd) ((LISTVIEW_INFO*)getInfoPtr(hwnd)) 94 95 INT WINAPI COMCTL32_StrCmpNIA(LPCSTR,LPCSTR,INT);96 97 #define strncasecmp COMCTL32_StrCmpNIA98 109 99 110 /* … … 965 976 { 966 977 LISTVIEW_GetItemPosition(hwnd, i, &ptItem); 978 967 979 if (PtInRect(&rcSelRect, ptItem) != FALSE) 968 980 { … … 1014 1026 POINT ptSelMark; 1015 1027 RECT rcSel; 1028 1016 1029 LISTVIEW_GetItemPosition(hwnd, nItem, &ptItem); 1017 1030 LISTVIEW_GetItemPosition(hwnd, infoPtr->nSelectionMark, &ptSelMark); … … 1076 1089 { 1077 1090 if (nItem > 0) 1078 LISTVIEW_RemoveSelections(hwnd, 0, nItem - 1);1091 LISTVIEW_RemoveSelections(hwnd,0,nItem); 1079 1092 1080 1093 if (nItem < GETITEMCOUNT(infoPtr)) 1081 LISTVIEW_RemoveSelections(hwnd, nItem + 1,GETITEMCOUNT(infoPtr));1094 LISTVIEW_RemoveSelections(hwnd,nItem+1,GETITEMCOUNT(infoPtr)); 1082 1095 } else mask |= LVIS_SELECTED; 1083 1096 1084 LISTVIEW_SetItemState(hwnd,infoPtr->nFocusedItem,0,mask); 1097 1098 if (infoPtr->nFocusedItem != nItem) LISTVIEW_SetItemState(hwnd,infoPtr->nFocusedItem,0,mask); 1085 1099 LISTVIEW_SetItemState(hwnd,nItem,LVIS_SELECTED | LVIS_FOCUSED,LVIS_SELECTED | LVIS_FOCUSED); 1086 1100 … … 1200 1214 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 1201 1215 LISTVIEW_ITEM *lpItem; 1202 1203 while ((lpItem = (LISTVIEW_ITEM*)DPA_GetPtr(infoPtr->hdpaSelItems,0)) != NULL) 1204 { 1205 LISTVIEW_SetItemState(hwnd,DPA_GetPtrIndex(infoPtr->hdpaItems,lpItem),0,LVIS_SELECTED); 1216 INT pos = 0; 1217 1218 while ((lpItem = (LISTVIEW_ITEM*)DPA_GetPtr(infoPtr->hdpaSelItems,pos)) != NULL) 1219 { 1220 INT nItem = DPA_GetPtrIndex(infoPtr->hdpaItems,lpItem); 1221 1222 if ((nItem >= nFirst) && (nItem < nLast)) 1223 LISTVIEW_SetItemState(hwnd,nItem,0,LVIS_SELECTED); 1224 else 1225 pos++; 1206 1226 } 1207 1227 } … … 1657 1677 /* get information needed for drawing the item */ 1658 1678 ZeroMemory(&lvItem, sizeof(LVITEMW)); 1659 lvItem.header.mask = LVIF_TEXT ;1679 lvItem.header.mask = LVIF_TEXT | LVIF_IMAGE; 1660 1680 lvItem.header.iItem = nItem; 1661 1681 lvItem.header.iSubItem = nSubItem; … … 1664 1684 lvItem.mustFree = FALSE; 1665 1685 LISTVIEW_GetItem(hwnd,(LPLVITEMW)&lvItem,TRUE,TRUE); 1686 1687 if (infoPtr->dwExStyle & LVS_EX_SUBITEMIMAGES) 1688 { 1689 /* small icons */ 1690 if (infoPtr->himlSmall) 1691 { 1692 ImageList_SetBkColor(infoPtr->himlSmall,CLR_NONE); 1693 ImageList_Draw(infoPtr->himlSmall,lvItem.header.iImage,hdc,rcItem.left,rcItem.top,ILD_NORMAL); 1694 1695 rcItem.left += infoPtr->iconSize.cx; 1696 } 1697 } 1666 1698 1667 1699 /* set item colors */ … … 1915 1947 1916 1948 /* add 1 for displaying a partial item at the bottom */ 1917 nLast = nItem +LISTVIEW_GetCountPerColumn(hwnd)+1;1918 nLast = min(nLast, 1949 nLast = nItem+LISTVIEW_GetCountPerColumn(hwnd)+1; 1950 nLast = min(nLast,GETITEMCOUNT(infoPtr)); 1919 1951 1920 1952 /* send cache hint notification */ … … 1945 1977 } 1946 1978 1947 for (; nItem < nLast;nItem++)1948 { 1949 for (j = 0; j < nColumnCount;j++)1979 for (;nItem < nLast;nItem++) 1980 { 1981 for (j = 0;j < nColumnCount;j++) 1950 1982 { 1951 1983 rcItem = rcHeader[j]; … … 1966 1998 nDrawPosY += infoPtr->nItemHeight; 1967 1999 } 2000 1968 2001 DR_END: 2002 if (infoPtr->dwExStyle & LVS_EX_GRIDLINES) 2003 { 2004 HPEN hOldPen; 2005 2006 hOldPen = SelectObject(hdc,GetStockObject(BLACK_BRUSH)); 2007 for (j = 0;j < nColumnCount-1;j++) 2008 { 2009 MoveToEx(hdc,rcHeader[j].right+REPORT_MARGINX-1,infoPtr->rcList.top,NULL); 2010 LineTo(hdc,rcHeader[j].right+REPORT_MARGINX-1,infoPtr->rcList.bottom); 2011 } 2012 SelectObject(hdc,hOldPen); 2013 } 2014 2015 1969 2016 COMCTL32_Free(rcHeader); 1970 2017 } … … 3483 3530 } 3484 3531 3485 /* LISTVIEW_GetHoverTime */ 3532 static LRESULT LISTVIEW_GetHoverTime(HWND hwnd,WPARAM wParam,LPARAM lParam) 3533 { 3534 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 3535 3536 return (LRESULT)infoPtr->hoverTime; 3537 } 3538 3539 static LRESULT LISTVIEW_SetHoverTime(HWND hwnd,WPARAM wParam,LPARAM lParam) 3540 { 3541 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 3542 INT oldTime = infoPtr->hoverTime; 3543 3544 infoPtr->hoverTime = (INT)lParam; 3545 if (infoPtr->hoverTime == -1) infoPtr->hoverTime = DEFAULT_HOVERTIME; 3546 3547 return (LRESULT)oldTime; 3548 } 3486 3549 3487 3550 /*** … … 3755 3818 } 3756 3819 3757 /* LISTVIEW_GetHoverTime */3758 3759 3820 /*** 3760 3821 * DESCRIPTION: … … 3843 3904 } 3844 3905 3906 static BOOL LISTVIEW_GetSubItemPosition(HWND hwnd,INT nItem,INT nSubItem,LPPOINT lpptPosition) 3907 { 3908 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 3909 RECT rect; 3910 3911 if (Header_GetItemRect(infoPtr->hwndHeader,nSubItem,&rect)) 3912 { 3913 lpptPosition->x = rect.left+REPORT_MARGINX; 3914 lpptPosition->y = ((nItem-LISTVIEW_GetTopIndex(hwnd))*infoPtr->nItemHeight)+infoPtr->rcList.top; 3915 3916 return TRUE; 3917 } 3918 3919 return FALSE; 3920 } 3921 3845 3922 /*** 3846 3923 * DESCRIPTION: … … 3858 3935 static LRESULT LISTVIEW_GetItemRect(HWND hwnd,INT nItem,LPRECT lprc,INT code) 3859 3936 { 3860 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO 3937 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 3861 3938 BOOL bResult = FALSE; 3862 3939 POINT ptOrigin; … … 4177 4254 } 4178 4255 4256 static LRESULT LISTVIEW_GetSubItemRect(HWND hwnd,INT nItem,LPRECT lprc) 4257 { 4258 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4259 INT nSubItem,code,nLabelWidth; 4260 POINT ptItem; 4261 4262 if (!lprc || (infoPtr->uView != LVS_REPORT) || (nItem < 0) || (nItem >= GETITEMCOUNT(infoPtr))) return FALSE; 4263 4264 nSubItem = lprc->top; 4265 if ((nSubItem < 0) || (nSubItem >= Header_GetItemCount(infoPtr->hwndHeader))) return FALSE; 4266 if (!LISTVIEW_GetSubItemPosition(hwnd,nItem,nSubItem,&ptItem)) return FALSE; 4267 4268 code = lprc->left; 4269 4270 switch (code) 4271 { 4272 case LVIR_BOUNDS: 4273 lprc->left = ptItem.x; 4274 lprc->right = lprc->left; 4275 lprc->top = ptItem.y; 4276 lprc->bottom = lprc->top+infoPtr->nItemHeight; 4277 4278 if ((infoPtr->dwExStyle & LVS_EX_SUBITEMIMAGES) && infoPtr->himlSmall) 4279 { 4280 lprc->right += infoPtr->iconSize.cx; 4281 } 4282 4283 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,nSubItem); 4284 lprc->right += nLabelWidth; 4285 break; 4286 4287 case LVIR_ICON: 4288 if (infoPtr->dwExStyle & LVS_EX_SUBITEMIMAGES) 4289 { 4290 lprc->left = ptItem.x; 4291 lprc->top = ptItem.y; 4292 lprc->bottom = lprc->top+infoPtr->nItemHeight; 4293 4294 if (infoPtr->himlSmall) 4295 { 4296 lprc->right = lprc->left+infoPtr->iconSize.cx; 4297 } else 4298 { 4299 lprc->right = lprc->left; 4300 } 4301 break; 4302 } else return FALSE; 4303 4304 case LVIR_LABEL: 4305 lprc->left = ptItem.x; 4306 lprc->right = lprc->left; 4307 lprc->top = ptItem.y; 4308 lprc->bottom = lprc->top+infoPtr->nItemHeight; 4309 4310 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,nSubItem); 4311 lprc->right += nLabelWidth; 4312 break; 4313 4314 default: 4315 return FALSE; 4316 } 4317 4318 return TRUE; 4319 } 4320 4179 4321 /*** 4180 4322 * DESCRIPTION: … … 4220 4362 LRESULT LISTVIEW_GetItemSpacing(HWND hwnd, BOOL bSmall) 4221 4363 { 4222 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO 4364 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4223 4365 LONG lResult; 4224 4366 … … 4450 4592 } 4451 4593 4452 /* LISTVIEW_GetNumberOfWorkAreas */ 4594 static LRESULT LISTVIEW_GetNumberOfWorkAreas(HWND hwnd,WPARAM wParam,LPARAM lParam) 4595 { 4596 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4597 LPINT lpuWorkAreas = (LPINT)lParam; 4598 4599 if (!lpuWorkAreas) return FALSE; 4600 4601 *lpuWorkAreas = infoPtr->nWorkAreas; 4602 4603 return TRUE; 4604 } 4605 4606 static LRESULT LISTVIEW_GetWorkAreas(HWND hwnd,WPARAM wParam,LPARAM lParam) 4607 { 4608 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4609 INT nWorkAreas = (INT)wParam; 4610 LPRECT lprc = (LPRECT)lParam; 4611 4612 if ((nWorkAreas <= 0) || (nWorkAreas > infoPtr->nWorkAreas) || !lprc) return FALSE; 4613 4614 for (INT x = 0;x < nWorkAreas;x++) 4615 lprc[x] = infoPtr->rcWorkAreas[x]; 4616 4617 return TRUE; 4618 } 4619 4620 static LRESULT LISTVIEW_SetWorkAreas(HWND hwnd,WPARAM wParam,LPARAM lParam) 4621 { 4622 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4623 INT nWorkAreas = (INT)wParam; 4624 LPRECT lprc = (LPRECT)lParam; 4625 4626 if ((nWorkAreas < 0) || (nWorkAreas > LV_MAX_WORKAREAS)) return FALSE; 4627 4628 COMCTL32_Free(infoPtr->rcWorkAreas); 4629 if ((nWorkAreas == 0) || !lprc) 4630 { 4631 infoPtr->nWorkAreas = 0; 4632 infoPtr->rcWorkAreas = NULL; 4633 } else 4634 { 4635 infoPtr->nWorkAreas = nWorkAreas; 4636 infoPtr->rcWorkAreas = (LPRECT)COMCTL32_Alloc(nWorkAreas*sizeof(RECT)); 4637 for (INT x = 0;x < nWorkAreas;x++) 4638 infoPtr->rcWorkAreas[x] = lprc[x]; 4639 } 4640 4641 return TRUE; 4642 } 4643 4453 4644 4454 4645 /*** … … 4466 4657 static LRESULT LISTVIEW_GetOrigin(HWND hwnd, LPPOINT lpptOrigin) 4467 4658 { 4468 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO 4659 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4469 4660 4470 4661 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) … … 4516 4707 static LRESULT LISTVIEW_GetSelectionMark(HWND hwnd) 4517 4708 { 4518 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO 4709 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4519 4710 4520 4711 return infoPtr->nSelectionMark; … … 4597 4788 } 4598 4789 4599 static BOOL LISTVIEW_InternalHitTestItem(HWND hwnd,LISTVIEW_INFO *infoPtr,INT nItem,LPLVHITTESTINFO lpHitTestInfo )4790 static BOOL LISTVIEW_InternalHitTestItem(HWND hwnd,LISTVIEW_INFO *infoPtr,INT nItem,LPLVHITTESTINFO lpHitTestInfo,BOOL checkSubItems) 4600 4791 { 4601 4792 RECT rcItem; 4793 4794 if (checkSubItems && (infoPtr->uView == LVS_REPORT)) 4795 { 4796 INT nColumnCount = Header_GetItemCount(infoPtr->hwndHeader); 4797 INT xDiff = -infoPtr->lefttop.x*infoPtr->scrollStep.x; 4798 4799 rcItem.top = infoPtr->rcList.top+(nItem-LISTVIEW_GetTopIndex(hwnd))*infoPtr->nItemHeight; 4800 rcItem.bottom = rcItem.top+infoPtr->nItemHeight; 4801 for (INT x = 0;x < nColumnCount;x++) 4802 { 4803 RECT rcColumn; 4804 4805 Header_GetItemRect(infoPtr->hwndHeader,x,&rcColumn); 4806 rcItem.left = xDiff+REPORT_MARGINX+rcColumn.left; 4807 rcItem.right = xDiff+rcColumn.right-REPORT_MARGINX; 4808 if (PtInRect(&rcItem,lpHitTestInfo->pt)) 4809 { 4810 rcItem.top = x; 4811 rcItem.left = LVIR_BOUNDS; 4812 if (LISTVIEW_GetSubItemRect(hwnd,nItem,&rcItem) && PtInRect(&rcItem,lpHitTestInfo->pt)) 4813 { 4814 rcItem.top = x; 4815 rcItem.left = LVIR_ICON; 4816 if (LISTVIEW_GetSubItemRect(hwnd,nItem,&rcItem) && PtInRect(&rcItem,lpHitTestInfo->pt)) 4817 { 4818 lpHitTestInfo->flags = LVHT_ONITEMICON; 4819 lpHitTestInfo->iItem = nItem; 4820 lpHitTestInfo->iSubItem = x; 4821 return TRUE; 4822 } 4823 4824 lpHitTestInfo->flags = LVHT_ONITEMLABEL; 4825 lpHitTestInfo->iItem = nItem; 4826 lpHitTestInfo->iSubItem = x; 4827 4828 return TRUE; 4829 } 4830 } 4831 } 4832 return FALSE; 4833 } 4602 4834 4603 4835 if (LISTVIEW_GetItemRect(hwnd,nItem,&rcItem,LVIR_BOUNDS)) … … 4657 4889 if (nItem >= GETITEMCOUNT(infoPtr)) return -1; 4658 4890 4659 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,nItem,lpHitTestInfo ))4891 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,nItem,lpHitTestInfo,FALSE)) 4660 4892 return nItem; 4661 4893 } else if (infoPtr->uView == LVS_LIST) … … 4668 4900 if (nItem >= GETITEMCOUNT(infoPtr)) return -1; 4669 4901 4670 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,nItem,lpHitTestInfo ))4902 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,nItem,lpHitTestInfo,FALSE)) 4671 4903 return nItem; 4672 4904 } else … … 4676 4908 for (i = 0; i < GETITEMCOUNT(infoPtr); i++) 4677 4909 { 4678 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,i,lpHitTestInfo ))4910 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,i,lpHitTestInfo,FALSE)) 4679 4911 return i; 4680 4912 } … … 4700 4932 static LRESULT LISTVIEW_HitTest(HWND hwnd, LPLVHITTESTINFO lpHitTestInfo) 4701 4933 { 4702 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO 4934 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4703 4935 INT nItem = -1; 4704 4936 … … 4708 4940 { 4709 4941 lpHitTestInfo->flags = LVHT_TOLEFT; 4710 } 4711 else if (infoPtr->rcList.right < lpHitTestInfo->pt.x) 4942 } else if (infoPtr->rcList.right < lpHitTestInfo->pt.x) 4712 4943 { 4713 4944 lpHitTestInfo->flags = LVHT_TORIGHT; … … 4716 4947 { 4717 4948 lpHitTestInfo->flags |= LVHT_ABOVE; 4718 } 4719 else if (infoPtr->rcList.bottom < lpHitTestInfo->pt.y) 4949 } else if (infoPtr->rcList.bottom < lpHitTestInfo->pt.y) 4720 4950 { 4721 4951 lpHitTestInfo->flags |= LVHT_BELOW; … … 4729 4959 return nItem; 4730 4960 } 4961 4962 static LRESULT LISTVIEW_SubItemHitTest(HWND hwnd,LPLVHITTESTINFO lpHitTestInfo) 4963 { 4964 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 4965 INT nItem = -1; 4966 INT nSubItem = -1; 4967 4968 lpHitTestInfo->flags = 0; 4969 if (infoPtr->uView != LVS_REPORT) return -1; 4970 4971 if (infoPtr->rcList.left > lpHitTestInfo->pt.x) 4972 { 4973 lpHitTestInfo->flags = LVHT_TOLEFT; 4974 } else if (infoPtr->rcList.right < lpHitTestInfo->pt.x) 4975 { 4976 lpHitTestInfo->flags = LVHT_TORIGHT; 4977 } 4978 if (infoPtr->rcList.top > lpHitTestInfo->pt.y) 4979 { 4980 lpHitTestInfo->flags |= LVHT_ABOVE; 4981 } else if (infoPtr->rcList.bottom < lpHitTestInfo->pt.y) 4982 { 4983 lpHitTestInfo->flags |= LVHT_BELOW; 4984 } 4985 4986 if (lpHitTestInfo->flags == 0) 4987 { 4988 INT nTop = LISTVIEW_GetTopIndex(hwnd),nItem; 4989 4990 nItem = nTop+((lpHitTestInfo->pt.y-infoPtr->rcList.top)/infoPtr->nItemHeight); 4991 if (nItem >= GETITEMCOUNT(infoPtr)) return -1; 4992 4993 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,nItem,lpHitTestInfo,TRUE)) 4994 return lpHitTestInfo->iSubItem; 4995 } 4996 4997 return nSubItem; 4998 } 4999 4731 5000 4732 5001 /*** … … 5418 5687 /* store previous style */ 5419 5688 dwOldStyle = infoPtr->dwExStyle; 5689 5420 5690 /* set new style */ 5421 5691 infoPtr->dwExStyle = (dwOldStyle & ~dwMask) | (dwStyle & dwMask); 5422 return (dwOldStyle); 5692 5693 //update report view 5694 if ((((dwOldStyle & LVS_EX_GRIDLINES) != (infoPtr->dwExStyle & LVS_EX_GRIDLINES)) || 5695 ((dwOldStyle & LVS_EX_SUBITEMIMAGES) != (infoPtr->dwExStyle & LVS_EX_SUBITEMIMAGES))) && 5696 (infoPtr->uView == LVS_REPORT)) 5697 { 5698 LISTVIEW_Refresh(hwnd); 5699 } 5700 5701 //update header 5702 if ((dwOldStyle & LVS_EX_HEADERDRAGDROP) != (infoPtr->dwExStyle & LVS_EX_HEADERDRAGDROP)) 5703 { 5704 if (infoPtr->hwndHeader) 5705 { 5706 DWORD dwStyle = GetWindowLongA(infoPtr->hwndHeader,GWL_STYLE); 5707 5708 if (infoPtr->dwExStyle & LVS_EX_HEADERDRAGDROP) 5709 dwStyle |= HDS_DRAGDROP; 5710 else 5711 dwStyle &= ~HDS_DRAGDROP; 5712 SetWindowLongA(infoPtr->hwndHeader,GWL_STYLE,dwStyle); 5713 } 5714 } 5715 5716 return dwOldStyle; 5423 5717 } 5424 5718 … … 5481 5775 } 5482 5776 5483 /* LISTVIEW_SetIconSpacing */ 5777 static LRESULT LISTVIEW_SetIconSpacing(HWND hwnd,WPARAM wParam,LPARAM lParam) 5778 { 5779 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 5780 DWORD oldIS = MAKELONG(infoPtr->iconSpacing.cx,infoPtr->iconSpacing.cy); 5781 INT cx = LOWORD(lParam),cy = HIWORD(lParam); 5782 5783 if (cx == -1) cx = GetSystemMetrics(SM_CXICONSPACING); 5784 if (cy == -1) cy = GetSystemMetrics(SM_CYICONSPACING); 5785 if ((cx != infoPtr->iconSpacing.cx) || (cy != infoPtr->iconSpacing.cy)) 5786 { 5787 infoPtr->iconSpacing.cx = cx; 5788 infoPtr->iconSpacing.cy = cy; 5789 if (((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) && (infoPtr->dwStyle & LVS_AUTOARRANGE)) 5790 { 5791 LISTVIEW_Arrange(hwnd,LVA_DEFAULT); 5792 } 5793 } 5794 5795 return oldIS; 5796 } 5484 5797 5485 5798 /*** … … 5498 5811 static LRESULT LISTVIEW_SetImageList(HWND hwnd, INT nType, HIMAGELIST himl) 5499 5812 { 5500 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO 5813 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 5501 5814 HIMAGELIST himlTemp = 0; 5502 5815 … … 5877 6190 5878 6191 infoPtr->nSelectionMark = nIndex; 6192 5879 6193 return nOldIndex; 5880 6194 } … … 5932 6246 /* LISTVIEW_SetToolTips */ 5933 6247 /* LISTVIEW_SetUnicodeFormat */ 5934 /* LISTVIEW_SetWorkAreas */5935 6248 5936 6249 /*** … … 6085 6398 infoPtr->pedititem = NULL; 6086 6399 infoPtr->bDoEditLabel = FALSE; 6400 infoPtr->hoverTime = DEFAULT_HOVERTIME; 6087 6401 6088 6402 /* get default font (icon title) */ … … 6099 6413 6100 6414 /* set header font */ 6101 SendMessageA(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, 6102 (LPARAM)TRUE); 6415 SendMessageA(infoPtr->hwndHeader,WM_SETFONT,(WPARAM)infoPtr->hFont,(LPARAM)TRUE); 6103 6416 6104 6417 if (uView == LVS_ICON) … … 6106 6419 infoPtr->iconSize.cx = GetSystemMetrics(SM_CXICON); 6107 6420 infoPtr->iconSize.cy = GetSystemMetrics(SM_CYICON); 6108 } 6109 else if (uView == LVS_REPORT) 6421 } else if (uView == LVS_REPORT) 6110 6422 { 6111 6423 if (!(LVS_NOCOLUMNHEADER & lpcs->style)) … … 6116 6428 infoPtr->iconSize.cx = GetSystemMetrics(SM_CXSMICON); 6117 6429 infoPtr->iconSize.cy = GetSystemMetrics(SM_CYSMICON); 6118 } 6119 else 6430 } else 6120 6431 { 6121 6432 infoPtr->iconSize.cx = GetSystemMetrics(SM_CXSMICON); … … 6130 6441 infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); 6131 6442 infoPtr->nItemHeight = LISTVIEW_GetItemHeight(hwnd); 6443 6444 //create tooltip 6445 infoPtr->hwndToolTip = createToolTip(hwnd,TTF_TRACK | TTF_ABSOLUTE | TTF_TRANSPARENT,TRUE); 6446 SendMessageA(infoPtr->hwndToolTip,WM_SETFONT,infoPtr->hFont,0); 6447 6132 6448 6133 6449 return 0; … … 6479 6795 } 6480 6796 6481 /************************ Defines that LISTVIEW_ProcessLetterKeys uses *******************************/ 6482 #define KEY_DELAY 900 6483 #define LISTVIEW_InitLvItemStruct(item,idx,TEXT) \ 6484 ZeroMemory(&(item), sizeof(LVITEMA)); \ 6485 (item).mask = LVIF_TEXT; \ 6486 (item).iItem = (idx); \ 6487 (item).iSubItem = 0; \ 6488 (item).pszText = (CHAR*)&(TEXT); \ 6489 (item).cchTextMax = MAX_PATH 6490 6491 /************************************************************************************************************************ 6492 * DESCRIPTION: 6493 * Processes keyboard messages generated by pressing the letter keys on the keyboard. 6494 * Assumes the list is sorted alphabetically, without regard to case. 6495 * 6496 * PARAMETERS: 6497 * [ I ] HWND: handle to the window 6498 * [ I ] WPARAM: the character code, the actual character 6499 * [ I ] LPARAM: key data 6500 * 6501 * 6502 * RETURN: 6503 * Zero. 6504 * 6505 * CHANGE LOG: 6506 * Feb 17, 2000 -------------> Creation of function. 6507 * Feb 22, 2000 -------------> Added macros. 6508 * TODO: 6509 * 6510 * 6511 ************************************************************************************************************************/ 6512 static INT LISTVIEW_ProcessLetterKeys( HWND hwnd, WPARAM charCode, LPARAM keyData ) 6513 { 6514 LISTVIEW_INFO *infoPtr = NULL; 6515 INT nItem = -1; 6516 INT nSize = 0; 6517 INT idx = 0; 6518 BOOL bFoundMatchingFiles = FALSE; 6519 LVITEMA item; 6520 CHAR TEXT[ MAX_PATH ]; 6521 CHAR szCharCode[ 2 ]; 6522 DWORD timeSinceLastKeyPress = 0; 6523 6524 sprintf( szCharCode, "%c", charCode ); 6525 6526 /* simple parameter checking */ 6527 if ( !hwnd || !charCode || !keyData ) 6528 return 0; 6529 6530 infoPtr = (LISTVIEW_INFO*)getInfoPtr(hwnd); 6531 6532 if ( !infoPtr ) 6533 return 0; 6534 6535 /* only allow the valid WM_CHARs through */ 6536 if ( isalnum( charCode ) || charCode == '.' || charCode == '`' || charCode == '!' 6537 || charCode == '@' || charCode == '#' || charCode == '$' || charCode == '%' 6538 || charCode == '^' || charCode == '&' || charCode == '*' || charCode == '(' 6539 || charCode == ')' || charCode == '-' || charCode == '_' || charCode == '+' 6540 || charCode == '=' || charCode == '\\'|| charCode == ']' || charCode == '}' 6541 || charCode == '[' || charCode == '{' || charCode == '/' || charCode == '?' 6542 || charCode == '>' || charCode == '<' || charCode == ',' || charCode == '~') 6543 { 6544 timeSinceLastKeyPress = GetTickCount(); 6545 6546 nSize = GETITEMCOUNT( infoPtr ); 6547 /* if there are 0 items, there is no where to go */ 6548 if ( nSize == 0 ) 6549 return 0; 6550 /* 6551 * If the last charCode equals the current charCode then look 6552 * to the next element in list to see if it matches the previous 6553 * charCode. 6554 */ 6555 if ( infoPtr->charCode == charCode ) 6556 { 6557 if ( timeSinceLastKeyPress - infoPtr->timeSinceLastKeyPress < KEY_DELAY ) 6558 { /* append new character to search string */ 6559 lstrcatA( infoPtr->szSearchParam, szCharCode ); 6560 infoPtr->nSearchParamLength++; 6561 6562 /* loop from start of list view */ 6563 for( idx = infoPtr->nFocusedItem; idx < nSize; idx++ ) 6564 { /* get item */ 6565 LISTVIEW_InitLvItemStruct( item, idx, TEXT ); 6566 LISTVIEW_GetItem(hwnd,(LVITEMW*)&item,FALSE,FALSE);//CB:todo 6567 6568 /* compare items */ 6569 if ( strncasecmp( item.pszText, infoPtr->szSearchParam, 6570 infoPtr->nSearchParamLength ) == 0 ) 6571 { 6572 nItem = idx; 6573 break; 6574 } 6575 } 6576 } 6577 else if ( infoPtr->timeSinceLastKeyPress > timeSinceLastKeyPress ) 6578 { /* The DWORD went over it's boundery?? Ergo assuming too slow??. */ 6579 for ( idx = 0; idx < nSize; idx++ ) 6580 { 6581 LISTVIEW_InitLvItemStruct( item, idx, TEXT ); 6582 LISTVIEW_GetItem(hwnd,(LVITEMW*)&item,FALSE,FALSE);//CB:todo 6583 6584 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6585 { 6586 nItem = idx; 6587 break; 6588 } 6589 } 6590 lstrcpyA( infoPtr->szSearchParam, szCharCode ); 6591 infoPtr->nSearchParamLength = 1; 6592 } 6593 else 6594 { /* Save szCharCode for use in later searches */ 6595 lstrcpyA( infoPtr->szSearchParam, szCharCode ); 6596 infoPtr->nSearchParamLength = 1; 6597 6598 LISTVIEW_InitLvItemStruct( item, infoPtr->nFocusedItem + 1, TEXT ); 6599 LISTVIEW_GetItem(hwnd,(LVITEMW*)&item,FALSE,FALSE);//CB:todo 6600 6601 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6602 nItem = infoPtr->nFocusedItem + 1; 6603 else 6604 { /* 6605 * Ok so there are no more folders that match 6606 * now we look for files. 6607 */ 6608 for ( idx = infoPtr->nFocusedItem + 1; idx < nSize; idx ++ ) 6609 { 6610 LISTVIEW_InitLvItemStruct( item, idx, TEXT ); 6611 LISTVIEW_GetItem(hwnd,(LVITEMW*)&item,FALSE,FALSE);//CB:todo 6612 6613 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6614 { 6615 nItem = idx; 6616 bFoundMatchingFiles = TRUE; 6617 break; 6618 } 6619 } 6620 if ( !bFoundMatchingFiles ) 6621 { /* go back to first instance */ 6622 for ( idx = 0; idx < nSize; idx ++ ) 6623 { 6624 LISTVIEW_InitLvItemStruct( item,idx, TEXT ); 6625 LISTVIEW_GetItem(hwnd,(LVITEMW*)&item,FALSE,FALSE);//CB:todo 6626 6627 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6628 { 6629 nItem = idx; 6630 break; 6631 } 6632 } 6633 } 6634 } 6635 } 6636 } /*END: if ( infoPtr->charCode == charCode )*/ 6637 6638 else /* different keypressed */ 6639 { 6640 /* could be that they are spelling the file/directory for us */ 6641 if ( timeSinceLastKeyPress - infoPtr->timeSinceLastKeyPress > KEY_DELAY ) 6642 { /* 6643 * Too slow, move to the first instance of the 6644 * charCode. 6645 */ 6646 for ( idx = 0; idx < nSize; idx++ ) 6647 { 6648 LISTVIEW_InitLvItemStruct( item,idx, TEXT ); 6649 LISTVIEW_GetItem(hwnd,(LVITEMW*)&item,FALSE,FALSE);//CB:todo 6650 6651 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6652 { 6653 nItem = idx; 6654 break; 6655 } 6656 } 6657 lstrcpyA( infoPtr->szSearchParam, szCharCode ); 6658 infoPtr->nSearchParamLength = 1; 6659 } 6660 else if ( infoPtr->timeSinceLastKeyPress > timeSinceLastKeyPress ) 6661 { /* The DWORD went over it's boundery?? Ergo assuming too slow??. */ 6662 for ( idx = 0; idx < nSize; idx++ ) 6663 { 6664 LISTVIEW_InitLvItemStruct( item,idx, TEXT ); 6665 LISTVIEW_GetItem(hwnd,(LVITEMW*)&item,FALSE,FALSE);//CB:todo 6666 6667 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6668 { 6669 nItem = idx; 6670 break; 6671 } 6672 } 6673 lstrcpyA( infoPtr->szSearchParam, szCharCode ); 6674 infoPtr->nSearchParamLength = 1; 6675 } 6676 else /* Search for the string the user is typing */ 6677 { 6678 /* append new character to search string */ 6679 lstrcatA( infoPtr->szSearchParam, szCharCode ); 6680 infoPtr->nSearchParamLength++; 6681 6682 /* loop from start of list view */ 6683 for( idx = 0; idx < nSize; idx++ ) 6684 { /* get item */ 6685 LISTVIEW_InitLvItemStruct( item, idx, TEXT ); 6686 LISTVIEW_GetItem(hwnd,(LVITEMW*)&item,FALSE,FALSE);//CB:todo 6687 6688 /* compare items */ 6689 if ( strncasecmp( item.pszText, infoPtr->szSearchParam, 6690 infoPtr->nSearchParamLength ) == 0 ) 6691 { 6692 nItem = idx; 6693 break; 6694 } 6695 } 6696 } 6697 }/*END: else */ 6698 } 6797 static BOOL LISTVIEW_Compare(HWND hwnd,INT nItem,LPWSTR text,INT textlen,BOOL *matchLast) 6798 { 6799 BOOL res; 6800 INT itemlen; 6801 LVINTERNALITEMW lvItem; 6802 6803 ZeroMemory(&lvItem,sizeof(LVITEMW)); 6804 lvItem.header.mask = LVIF_TEXT; 6805 lvItem.header.iItem = nItem; 6806 lvItem.header.cchTextMax = DISP_TEXT_SIZE; 6807 lvItem.mustFree = FALSE; 6808 LISTVIEW_GetItem(hwnd,(LPLVITEMW)&lvItem,TRUE,TRUE); 6809 6810 itemlen = lstrlenAW(lvItem.header.pszText,lvItem.unicode); 6811 if (itemlen < textlen) 6812 { 6813 res = FALSE; 6814 } else 6815 { 6816 res = (lstrcmpniAW(lvItem.header.pszText,lvItem.unicode,text,TRUE,textlen) == 0); 6817 } 6818 if (!res && matchLast) 6819 { 6820 textlen--; 6821 if ((textlen > 0) && (itemlen >= textlen)) 6822 *matchLast = (lstrcmpniAW(lvItem.header.pszText,lvItem.unicode,text,TRUE,textlen) == 0); 6699 6823 else 6700 return 0; 6701 6702 LISTVIEW_KeySelection(hwnd, nItem ); 6703 6704 /* Store the WM_CHAR for next time */ 6705 infoPtr->charCode = charCode; 6706 6707 /* Store time */ 6708 infoPtr->timeSinceLastKeyPress = timeSinceLastKeyPress; 6709 6710 return 0; 6711 6712 }/*END:LISTVIEW_ProcessLetterKeys( HWND hwndParent, INT nVirtualKey, LONG lKeyData ) */ 6824 *matchLast = FALSE; 6825 } 6826 if (lvItem.mustFree) COMCTL32_Free(lvItem.header.pszText); 6827 6828 return res; 6829 } 6830 6831 static INT LISTVIEW_Search(HWND hwnd,LISTVIEW_INFO *infoPtr,INT iItem,LPWSTR text,INT textlen,INT *nearest) 6832 { 6833 INT start,item; 6834 BOOL bMatchLast; 6835 6836 start = iItem; 6837 if (nearest) *nearest = -1; 6838 6839 //search start to end 6840 for (item = start;item < GETITEMCOUNT(infoPtr);item++) 6841 { 6842 if (nearest) 6843 { 6844 if (LISTVIEW_Compare(hwnd,item,text,textlen,(*nearest == -1) ? &bMatchLast:NULL)) 6845 return item; 6846 else if ((*nearest == -1) && bMatchLast) 6847 *nearest = item; 6848 } else 6849 { 6850 if (LISTVIEW_Compare(hwnd,item,text,textlen,NULL)) 6851 return item; 6852 } 6853 } 6854 6855 //search first to start 6856 for (item = 0;item < start;item++) 6857 { 6858 if (nearest) 6859 { 6860 if (LISTVIEW_Compare(hwnd,item,text,textlen,(*nearest == -1) ? &bMatchLast:NULL)) 6861 return item; 6862 else if ((*nearest == -1) && bMatchLast) 6863 *nearest = item; 6864 } else 6865 { 6866 if (LISTVIEW_Compare(hwnd,item,text,textlen,NULL)) 6867 return item; 6868 } 6869 } 6870 6871 return -1; 6872 } 6873 6874 //NOTE: sister function in treeview control -> sync changes 6875 6876 static VOID LISTVIEW_ISearch(HWND hwnd,CHAR ch) 6877 { 6878 LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(hwnd); 6879 LPWSTR newString; 6880 INT len,item,nearest = -1; 6881 CHAR ch2[2]; 6882 DWORD dwISearchTime; 6883 BOOL checkNearest = TRUE; 6884 6885 //check timer 6886 dwISearchTime = GetTickCount(); 6887 if ((infoPtr->uISearchLen > 0) && (TICKDIFF(infoPtr->dwISearchTime,dwISearchTime) > LV_ISEARCH_DELAY)) 6888 { 6889 COMCTL32_Free(infoPtr->pszISearch); 6890 infoPtr->pszISearch = NULL; 6891 infoPtr->uISearchLen = 0; 6892 } 6893 6894 //prepare new search string 6895 len = infoPtr->uISearchLen+1; 6896 newString = (WCHAR*)COMCTL32_Alloc((len+1)*sizeof(WCHAR)); 6897 6898 if (infoPtr->uISearchLen > 0) lstrcpyW(newString,infoPtr->pszISearch); 6899 6900 ch2[0] = ch; 6901 ch2[1] = 0; 6902 lstrcpyAtoW((LPWSTR)&newString[len-1],(LPSTR)&ch2); 6903 for (INT x = 1;x < len;x++) 6904 { 6905 if (newString[0] != newString[x]) 6906 { 6907 checkNearest = FALSE; 6908 break; 6909 } 6910 } 6911 6912 //search 6913 6914 //start with selected item or root 6915 if (infoPtr->nFocusedItem != -1) 6916 { 6917 item = infoPtr->nFocusedItem; 6918 6919 //check if new string is valid for old selection 6920 if (LISTVIEW_Compare(hwnd,item,newString,len,NULL)) 6921 goto ISearchDone; 6922 6923 //no match, continue with next item 6924 item++; 6925 } else item = 0; 6926 6927 //scan 6928 item = LISTVIEW_Search(hwnd,infoPtr,item,newString,len,checkNearest ? &nearest:NULL); 6929 6930 if ((item == -1) && (nearest != -1)) 6931 { 6932 LISTVIEW_SetSelection(hwnd,nearest); 6933 LISTVIEW_EnsureVisible(hwnd,nearest,FALSE); 6934 infoPtr->dwISearchTime = GetTickCount(); 6935 6936 COMCTL32_Free(newString); 6937 return; 6938 } 6939 6940 ISearchDone: 6941 //done 6942 if (item != -1) 6943 { 6944 COMCTL32_Free(infoPtr->pszISearch); 6945 infoPtr->pszISearch = newString; 6946 infoPtr->uISearchLen = len; 6947 LISTVIEW_SetSelection(hwnd,item); 6948 LISTVIEW_EnsureVisible(hwnd,item,FALSE); 6949 infoPtr->dwISearchTime = GetTickCount(); 6950 } else 6951 { 6952 COMCTL32_Free(newString); 6953 MessageBeep(0xFFFFFFFF); 6954 } 6955 } 6956 6957 static LRESULT LISTVIEW_Char(HWND hwnd,WPARAM wParam,LPARAM lParam) 6958 { 6959 CHAR ch = (CHAR)wParam; 6960 6961 LISTVIEW_ISearch(hwnd,ch); 6962 6963 return 0; 6964 } 6713 6965 6714 6966 /*** … … 6939 7191 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 6940 7192 7193 //destroy tooltip 7194 destroyToolTip(infoPtr->hwndToolTip); 7195 6941 7196 /* delete all items */ 6942 7197 LISTVIEW_DeleteAllItems(hwnd); … … 7202 7457 if (hFont == 0) 7203 7458 { 7459 if (infoPtr->hFont == infoPtr->hDefaultFont) return 0; 7204 7460 infoPtr->hFont = infoPtr->hDefaultFont; 7205 } 7206 else7207 {7461 } else 7462 { 7463 if (infoPtr->hFont == hFont) return 0; 7208 7464 infoPtr->hFont = hFont; 7209 7465 } … … 7212 7468 { 7213 7469 /* set header font */ 7214 SendMessageA(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, 7215 MAKELPARAM(fRedraw, 0)); 7216 } 7470 SendMessageA(infoPtr->hwndHeader,WM_SETFONT,(WPARAM)hFont,MAKELPARAM(fRedraw,0)); 7471 } 7472 7473 //set tooltip font 7474 SendMessageA(infoPtr->hwndToolTip,WM_SETFONT,(WPARAM)hFont,fRedraw); 7217 7475 7218 7476 /* invalidate listview control client area */ … … 7735 7993 static LRESULT LISTVIEW_GetISearchString(HWND hwnd,WPARAM wParam,LPARAM lParam,BOOL unicode) 7736 7994 { 7995 LISTVIEW_INFO *infoPtr = LISTVIEW_GetInfoPtr(hwnd); 7996 LPWSTR lpsz = (LPWSTR)lParam; 7997 7998 if (infoPtr->uISearchLen == 0) return 0; 7999 8000 if (unicode) 8001 lstrcpyW(lpsz,infoPtr->pszISearch); 8002 else 8003 lstrcpyWtoA((LPSTR)lpsz,infoPtr->pszISearch); 8004 8005 return infoPtr->uISearchLen; 8006 } 8007 8008 static LRESULT LISTVIEW_GetToolTips(HWND hwnd,WPARAM wParam,LPARAM lParam) 8009 { 8010 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 8011 8012 return infoPtr->hwndToolTip; 8013 } 8014 8015 static LRESULT LISTVIEW_SetToolTips(HWND hwnd,WPARAM wParam,LPARAM lParam) 8016 { 8017 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 8018 HWND oldToolTip = infoPtr->hwndToolTip; 8019 8020 infoPtr->hwndToolTip = (HWND)lParam; 8021 8022 return oldToolTip; 8023 } 8024 8025 static LRESULT LISTVIEW_MouseMove(HWND hwnd,WPARAM wParam,LPARAM lParam) 8026 { 7737 8027 //CB: todo 7738 8028 7739 return 0;8029 return DefWindowProcA(hwnd,WM_MOUSEMOVE,wParam,lParam); 7740 8030 } 7741 8031 … … 7756 8046 return LISTVIEW_Arrange(hwnd, (INT)wParam); 7757 8047 7758 7759 8048 case LVM_CREATEDRAGIMAGE: 7760 8049 return LISTVIEW_CreateDragImage(hwnd,wParam,lParam); … … 7826 8115 return LISTVIEW_GetHotItem(hwnd); 7827 8116 7828 /* case LVM_GETHOVERTIME: */ 8117 case LVM_GETHOVERTIME: 8118 return LISTVIEW_GetHoverTime(hwnd,wParam,lParam); 7829 8119 7830 8120 case LVM_GETIMAGELIST: … … 7867 8157 return LISTVIEW_GetNextItem(hwnd, (INT)wParam, LOWORD(lParam)); 7868 8158 7869 /* case LVM_GETNUMBEROFWORKAREAS: */ 8159 case LVM_GETNUMBEROFWORKAREAS: 8160 return LISTVIEW_GetNumberOfWorkAreas(hwnd,wParam,lParam); 7870 8161 7871 8162 case LVM_GETORIGIN: … … 7884 8175 return LISTVIEW_GetStringWidth(hwnd,0,(LPWSTR)lParam,TRUE); 7885 8176 7886 /* case LVM_GETSUBITEMRECT: */ 8177 case LVM_GETSUBITEMRECT: 8178 return LISTVIEW_GetSubItemRect(hwnd,(INT)wParam,(LPRECT)lParam); 7887 8179 7888 8180 case LVM_GETTEXTBKCOLOR: … … 7892 8184 return LISTVIEW_GetTextColor(hwnd); 7893 8185 7894 /* case LVM_GETTOOLTIPS: */ 8186 case LVM_GETTOOLTIPS: 8187 return LISTVIEW_GetToolTips(hwnd,wParam,lParam); 7895 8188 7896 8189 case LVM_GETTOPINDEX: … … 7900 8193 return LISTVIEW_GetViewRect(hwnd, (LPRECT)lParam); 7901 8194 7902 /* case LVM_GETWORKAREAS: */ 8195 case LVM_GETWORKAREAS: 8196 return LISTVIEW_GetWorkAreas(hwnd,wParam,lParam); 7903 8197 7904 8198 case LVM_HITTEST: 7905 return LISTVIEW_HitTest(hwnd, 8199 return LISTVIEW_HitTest(hwnd,(LPLVHITTESTINFO)lParam); 7906 8200 7907 8201 case LVM_INSERTCOLUMNA: … … 7956 8250 return LISTVIEW_SetHotItem(hwnd, (INT)wParam); 7957 8251 7958 /* case LVM_SETHOVERTIME: */ 7959 /* case LVM_SETICONSPACING: */ 8252 case LVM_SETHOVERTIME: 8253 return LISTVIEW_SetHoverTime(hwnd,wParam,lParam); 8254 8255 case LVM_SETICONSPACING: 8256 return LISTVIEW_SetIconSpacing(hwnd,wParam,lParam); 7960 8257 7961 8258 case LVM_SETIMAGELIST: … … 7995 8292 return LISTVIEW_SetTextColor(hwnd, (COLORREF)lParam); 7996 8293 7997 /* case LVM_SETTOOLTIPS: */ 7998 /* case LVM_SETWORKAREAS: */ 8294 case LVM_SETTOOLTIPS: 8295 return LISTVIEW_SetToolTips(hwnd,wParam,lParam); 8296 8297 case LVM_SETWORKAREAS: 8298 return LISTVIEW_SetWorkAreas(hwnd,wParam,lParam); 7999 8299 8000 8300 case LVM_SORTITEMS: 8001 8301 return LISTVIEW_SortItems(hwnd, wParam, lParam); 8002 8302 8003 /* case LVM_SUBITEMHITTEST: */ 8303 case LVM_SUBITEMHITTEST: 8304 return LISTVIEW_SubItemHitTest(hwnd,(LPLVHITTESTINFO)lParam); 8004 8305 8005 8306 case LVM_UPDATE: … … 8007 8308 8008 8309 case WM_CHAR: 8009 return LISTVIEW_ ProcessLetterKeys( hwnd, wParam, lParam);8310 return LISTVIEW_Char(hwnd,wParam,lParam); 8010 8311 8011 8312 case WM_COMMAND: … … 8019 8320 8020 8321 case WM_GETDLGCODE: 8021 return DLGC_WANTCHARS | DLGC_WANT ARROWS;8322 return DLGC_WANTCHARS | DLGC_WANTTAB | DLGC_WANTARROWS; 8022 8323 8023 8324 case WM_GETFONT: … … 8042 8343 return LISTVIEW_LButtonUp(hwnd,(WORD)wParam,LOWORD(lParam),HIWORD(lParam)); 8043 8344 8044 /* case WM_MOUSEMOVE: */ 8045 /* return LISTVIEW_MouseMove (hwnd, wParam, lParam); */ 8345 case WM_MOUSEMOVE: 8346 return LISTVIEW_MouseMove (hwnd,wParam,lParam); 8046 8347 8047 8348 case WM_NCCREATE:
Note:
See TracChangeset
for help on using the changeset viewer.