Changeset 496 for trunk/src/comctl32/listview.c
- Timestamp:
- Aug 14, 1999, 6:13:16 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/listview.c
r295 r496 2 2 * Listview control 3 3 * 4 * Copyright 1998 Eric Kohl4 * Copyright 1998, 1999 Eric Kohl 5 5 * Copyright 1999 Luc Tourangeau 6 6 * Copyright 1999 Achim Hasenmueller … … 13 13 * 1. No horizontal scrolling when header is larger than the client area. 14 14 * 2. Drawing optimizations. 15 * 3. Hot item handling. 15 16 * 16 17 * Notifications: … … 21 22 * 22 23 * Unicode: 23 * LISTVIEW_SetItem 32W : no unicode support24 * LISTVIEW_InsertItem 32W : no unicode support25 * LISTVIEW_InsertColumn 32W : no unicode support24 * LISTVIEW_SetItemW : no unicode support 25 * LISTVIEW_InsertItemW : no unicode support 26 * LISTVIEW_InsertColumnW : no unicode support 26 27 * LISTVIEW_GetColumnW : no unicode support 28 * LISTVIEW_SetColumnW : no unicode support 27 29 * 28 30 * Advanced functionality: 29 31 * LISTVIEW_GetNumberOfWorkAreas : not implemented 30 32 * LISTVIEW_GetHotCursor : not implemented 31 * LISTVIEW_GetHotItem : not implemented32 33 * LISTVIEW_GetHoverTime : not implemented 33 34 * LISTVIEW_GetISearchString : not implemented … … 35 36 * LISTVIEW_EditLabel : REPORT (need to implement a timer) 36 37 * LISTVIEW_GetColumnOrderArray : not implemented 38 * LISTVIEW_SetColumnOrderArray : not implemented 37 39 * LISTVIEW_Arrange : empty stub 38 40 * LISTVIEW_ApproximateViewRect : incomplete … … 3157 3159 3158 3160 /* LISTVIEW_GetEditControl */ 3159 /* LISTVIEW_GetExtendedListViewStyle */ 3161 3162 /*** 3163 * DESCRIPTION: 3164 * Retrieves the extended listview style. 3165 * 3166 * PARAMETERS: 3167 * [I] HWND : window handle 3168 * 3169 * RETURN: 3170 * SUCCESS : previous style 3171 * FAILURE : 0 3172 */ 3173 static LRESULT LISTVIEW_GetExtendedListViewStyle(HWND hwnd) 3174 { 3175 LISTVIEW_INFO *infoPtr; 3176 /* make sure we can get the listview info */ 3177 if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0))) 3178 return (0); 3179 return (infoPtr->dwExStyle); 3180 } 3160 3181 3161 3182 /*** … … 3412 3433 /* LISTVIEW_GetItemW */ 3413 3434 /* LISTVIEW_GetHotCursor */ 3414 /* LISTVIEW_GetHotItem */ 3415 /* LISTVIEW_GetHoverTime> */ 3435 3436 /*** 3437 * DESCRIPTION: 3438 * Retrieves the index of the hot item. 3439 * 3440 * PARAMETERS: 3441 * [I] HWND : window handle 3442 * 3443 * RETURN: 3444 * SUCCESS : hot item index 3445 * FAILURE : -1 (no hot item) 3446 */ 3447 static LRESULT LISTVIEW_GetHotItem(HWND hwnd) 3448 { 3449 LISTVIEW_INFO *infoPtr; 3450 /* make sure we can get the listview info */ 3451 if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0))) 3452 return (-1); 3453 return (infoPtr->nHotItem); 3454 } 3455 3456 /* LISTVIEW_GetHoverTime */ 3416 3457 3417 3458 /*** … … 4628 4669 } 4629 4670 4671 /* LISTVIEW_SetBkImage */ 4672 4630 4673 /*** 4631 4674 * DESCRIPTION: … … 4758 4801 } 4759 4802 4803 /* LISTVIEW_SetColumnW */ 4804 /* LISTVIEW_SetColumnOrderArray */ 4805 4760 4806 /*** 4761 4807 * DESCRIPTION: … … 4809 4855 /*** 4810 4856 * DESCRIPTION: 4857 * Sets the extended listview style. 4858 * 4859 * PARAMETERS: 4860 * [I] HWND : window handle 4861 * [I] DWORD : mask 4862 * [I] DWORD : style 4863 * 4864 * RETURN: 4865 * SUCCESS : previous style 4866 * FAILURE : 0 4867 */ 4868 static LRESULT LISTVIEW_SetExtendedListViewStyle(HWND hwnd, DWORD dwMask, DWORD dwStyle) 4869 { 4870 LISTVIEW_INFO *infoPtr; 4871 DWORD dwOldStyle; 4872 /* make sure we can get the listview info */ 4873 if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0))) 4874 return (0); 4875 /* store previous style */ 4876 dwOldStyle = infoPtr->dwExStyle; 4877 /* set new style */ 4878 infoPtr->dwExStyle = (dwOldStyle & ~dwMask) | (dwStyle & dwMask); 4879 return (dwOldStyle); 4880 } 4881 4882 /* LISTVIEW_SetHotCursor */ 4883 4884 /*** 4885 * DESCRIPTION: 4886 * Sets the hot item index. 4887 * 4888 * PARAMETERS: 4889 * [I] HWND : window handle 4890 * [I] INT : index 4891 * 4892 * RETURN: 4893 * SUCCESS : previous hot item index 4894 * FAILURE : -1 (no hot item) 4895 */ 4896 static LRESULT LISTVIEW_SetHotItem(HWND hwnd, INT iIndex) 4897 { 4898 LISTVIEW_INFO *infoPtr; 4899 INT iOldIndex; 4900 /* make sure we can get the listview info */ 4901 if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0))) 4902 return (-1); 4903 /* store previous index */ 4904 iOldIndex = infoPtr->nHotItem; 4905 /* set new style */ 4906 infoPtr->nHotItem = iIndex; 4907 return (iOldIndex); 4908 } 4909 4910 /* LISTVIEW_SetIconSpacing */ 4911 4912 /*** 4913 * DESCRIPTION: 4811 4914 * Sets image lists. 4812 4915 * … … 4893 4996 * [I] HWND : window handle 4894 4997 * [I] INT : item count (prjected number of items) 4895 * 4896 * RETURN: 4897 * None 4898 */ 4899 static VOID LISTVIEW_SetItemCount(HWND hwnd, INT nItemCount) 4900 { 4901 FIXME("empty stub!\n"); 4998 * [I] DWORD : update flags 4999 * 5000 * RETURN: 5001 * SUCCESS : TRUE 5002 * FAILURE : FALSE 5003 */ 5004 static BOOL LISTVIEW_SetItemCount(HWND hwnd, INT nItems, DWORD dwFlags) 5005 { 5006 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)GetWindowLongA(hwnd, 0); 5007 FIXME("(%d %08lx)empty stub!\n", nItems, dwFlags); 5008 if (nItems == 0) 5009 return LISTVIEW_DeleteAllItems (hwnd); 5010 if (nItems > GETITEMCOUNT(infoPtr)) 5011 { 5012 /* append items */ 5013 FIXME("append items\n"); 5014 } 5015 else if (nItems < GETITEMCOUNT(infoPtr)) 5016 { 5017 /* remove items */ 5018 FIXME("remove items\n"); 5019 } 5020 return TRUE; 4902 5021 } 4903 5022 … … 4947 5066 return bResult; 4948 5067 } 5068 5069 /* LISTVIEW_SetItemPosition32 */ 4949 5070 4950 5071 /*** … … 5031 5152 } 5032 5153 5154 /* LISTVIEW_SetItemTextW */ 5155 5156 /*** 5157 * DESCRIPTION: 5158 * Set item index that marks the start of a multiple selection. 5159 * 5160 * PARAMETER(S): 5161 * [I] HWND : window handle 5162 * [I] INT : index 5163 * 5164 * RETURN: 5165 * Index number or -1 if there is no selection mark. 5166 */ 5167 static LRESULT LISTVIEW_SetSelectionMark(HWND hwnd, INT nIndex) 5168 { 5169 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); 5170 INT nOldIndex = infoPtr->nSelectionMark; 5171 infoPtr->nSelectionMark = nIndex; 5172 return nOldIndex; 5173 } 5174 5033 5175 /*** 5034 5176 * DESCRIPTION: … … 5075 5217 } 5076 5218 5219 /* LISTVIEW_SetToolTips */ 5220 /* LISTVIEW_SetUnicodeFormat */ 5221 /* LISTVIEW_SetWorkAreas */ 5077 5222 5078 5223 /*** … … 5163 5308 } 5164 5309 5310 /* LISTVIEW_SubItemHitTest */ 5311 5165 5312 /*** 5166 5313 * DESCRIPTION: … … 5241 5388 infoPtr->nFocusedItem = -1; 5242 5389 infoPtr->nSelectionMark = -1; 5390 infoPtr->nHotItem = -1; 5243 5391 infoPtr->iconSpacing.cx = GetSystemMetrics(SM_CXICONSPACING); 5244 5392 infoPtr->iconSpacing.cy = GetSystemMetrics(SM_CYICONSPACING); … … 6433 6581 * 6434 6582 */ 6435 LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,6583 static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, 6436 6584 LPARAM lParam) 6437 6585 { … … 6475 6623 6476 6624 /* case LVM_GETCOLUMNW: */ 6477 /* case LVM_GETCOLUMNORDERARRAY: */ 6625 6626 case LVM_GETCOLUMNORDERARRAY: 6627 //FIXME("Unimplemented msg LVM_GETCOLUMNORDERARRAY\n"); 6628 return 0; 6629 6478 6630 6479 6631 case LVM_GETCOLUMNWIDTH: … … 6484 6636 6485 6637 /* case LVM_GETEDITCONTROL: */ 6486 /* case LVM_GETEXTENDEDLISTVIEWSTYLE: */ 6638 case LVM_GETEXTENDEDLISTVIEWSTYLE: 6639 return LISTVIEW_GetExtendedListViewStyle(hwnd); 6487 6640 6488 6641 case LVM_GETHEADER: … … 6490 6643 6491 6644 /* case LVM_GETHOTCURSOR: */ 6492 /* case LVM_GETHOTITEM: */ 6645 6646 case LVM_GETHOTITEM: 6647 return LISTVIEW_GetHotItem(hwnd); 6648 6493 6649 /* case LVM_GETHOVERTIME: */ 6494 6650 … … 6593 6749 return LISTVIEW_SetColumnA(hwnd, (INT)wParam, (LPLVCOLUMNA)lParam); 6594 6750 6595 /* case LVM_SETCOLUMNW: */ 6596 /* case LVM_SETCOLUMNORDERARRAY: */ 6751 case LVM_SETCOLUMNW: 6752 //FIXME("Unimplemented msg LVM_SETCOLUMNW\n"); 6753 return 0; 6754 6755 case LVM_SETCOLUMNORDERARRAY: 6756 //FIXME("Unimplemented msg LVM_SETCOLUMNORDERARRAY\n"); 6757 return 0; 6597 6758 6598 6759 case LVM_SETCOLUMNWIDTH: 6599 6760 return LISTVIEW_SetColumnWidth(hwnd, (INT)wParam, (INT)lParam); 6600 6761 6601 /* case LVM_SETEXTENDEDLISTVIEWSTYLE: */ 6762 case LVM_SETEXTENDEDLISTVIEWSTYLE: 6763 return LISTVIEW_SetExtendedListViewStyle(hwnd, (DWORD)wParam, (DWORD)lParam); 6764 6602 6765 /* case LVM_SETHOTCURSOR: */ 6603 /* case LVM_SETHOTITEM: */ 6766 6767 case LVM_SETHOTITEM: 6768 return LISTVIEW_SetHotItem(hwnd, (INT)wParam); 6769 6604 6770 /* case LVM_SETHOVERTIME: */ 6605 6771 /* case LVM_SETICONSPACING: */ … … 6614 6780 6615 6781 case LVM_SETITEMCOUNT: 6616 LISTVIEW_SetItemCount(hwnd, (INT)wParam); 6617 break; 6782 return LISTVIEW_SetItemCount(hwnd, (INT)wParam, (DWORD)lParam); 6618 6783 6619 6784 case LVM_SETITEMPOSITION: … … 6621 6786 (INT)HIWORD(lParam)); 6622 6787 6623 /* case LVM_SETITEMPOSITION : */6788 /* case LVM_SETITEMPOSITION32: */ 6624 6789 6625 6790 case LVM_SETITEMSTATE: … … 6629 6794 return LISTVIEW_SetItemTextA(hwnd, (INT)wParam, (LPLVITEMA)lParam); 6630 6795 6631 /* case LVM_SETSELECTIONMARK: */ 6796 /* case LVM_SETITEMTEXTW: */ 6797 6798 case LVM_SETSELECTIONMARK: 6799 return LISTVIEW_SetSelectionMark(hwnd, (INT)lParam); 6632 6800 6633 6801 case LVM_SETTEXTBKCOLOR:
Note:
See TracChangeset
for help on using the changeset viewer.