Changeset 1058 for trunk/src/comctl32/listview.c
- Timestamp:
- Sep 26, 1999, 1:01:11 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/listview.c
r496 r1058 43 43 * LISTVIEW_Update : not completed 44 44 */ 45 46 /* WINE 990923 level */ 45 47 46 48 #include <string.h> … … 3576 3578 HDC hdc; 3577 3579 HFONT hOldFont; 3578 INT n MaxWidth;3580 INT nLeftPos; 3579 3581 INT nLabelWidth; 3580 3582 TEXTMETRICA tm; … … 3682 3684 { 3683 3685 bResult = TRUE; 3684 n MaxWidth = lprc->left = ptItem.x + ptOrigin.x;3686 nLeftPos = lprc->left = ptItem.x + ptOrigin.x; 3685 3687 lprc->top = ptItem.y + ptOrigin.y; 3686 3688 lprc->bottom = lprc->top + infoPtr->nItemHeight; … … 3697 3699 3698 3700 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3699 if (lprc->left + nLabelWidth < n MaxWidth+ infoPtr->nItemWidth)3701 if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth) 3700 3702 { 3701 3703 lprc->right = lprc->left + nLabelWidth; … … 3703 3705 else 3704 3706 { 3705 lprc->right = n MaxWidth+ infoPtr->nItemWidth;3707 lprc->right = nLeftPos + infoPtr->nItemWidth; 3706 3708 } 3707 3709 } … … 3710 3712 { 3711 3713 bResult = TRUE; 3712 lprc->left = ptItem.x;3714 nLeftPos = lprc->left = ptItem.x; 3713 3715 lprc->top = ptItem.y; 3714 3716 lprc->bottom = lprc->top + infoPtr->nItemHeight; … … 3724 3726 } 3725 3727 3726 lprc->right = lprc->left + LISTVIEW_GetLabelWidth(hwnd, nItem); 3728 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3729 if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth) 3730 { 3731 lprc->right = lprc->left + nLabelWidth; 3732 } 3733 else 3734 { 3735 lprc->right = nLeftPos + infoPtr->nItemWidth; 3736 } 3727 3737 } 3728 3738 break; … … 3777 3787 } 3778 3788 3779 lprc->right += LISTVIEW_GetLabelWidth(hwnd, nItem); 3789 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3790 if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth) 3791 { 3792 lprc->right += nLabelWidth; 3793 } 3794 else 3795 { 3796 lprc->right = lprc->left + infoPtr->nItemWidth; 3797 } 3780 3798 } 3781 3799 break; … … 3801 3819 { 3802 3820 bResult = TRUE; 3803 lprc->left = ptItem.x + ptOrigin.x;3821 nLeftPos= lprc->left = ptItem.x + ptOrigin.x; 3804 3822 lprc->top = ptItem.y + ptOrigin.y; 3805 3823 lprc->bottom = lprc->top + infoPtr->nItemHeight; … … 3817 3835 } 3818 3836 3819 lprc->right += LISTVIEW_GetLabelWidth(hwnd, nItem); 3837 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3838 if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth) 3839 { 3840 lprc->right += nLabelWidth; 3841 } 3842 else 3843 { 3844 lprc->right = lprc->left + infoPtr->nItemWidth; 3845 } 3820 3846 } 3821 3847 } … … 3823 3849 { 3824 3850 bResult = TRUE; 3825 lprc->left = ptItem.x;3851 nLeftPos = lprc->left = ptItem.x; 3826 3852 lprc->top = ptItem.y; 3827 3853 lprc->bottom = lprc->top + infoPtr->nItemHeight; … … 3839 3865 } 3840 3866 3841 lprc->right += LISTVIEW_GetLabelWidth(hwnd, nItem); 3867 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3868 if (lprc->right + nLabelWidth < nLeftPos + infoPtr->nItemWidth) 3869 { 3870 lprc->right += nLabelWidth; 3871 } 3872 else 3873 { 3874 lprc->right = nLeftPos + infoPtr->nItemWidth; 3875 } 3842 3876 } 3843 3877 break; … … 3860 3894 * FAILURE : zero 3861 3895 */ 3862 staticINT LISTVIEW_GetLabelWidth(HWND hwnd, INT nItem)3896 INT LISTVIEW_GetLabelWidth(HWND hwnd, INT nItem) 3863 3897 { 3864 3898 CHAR szDispText[DISP_TEXT_SIZE]; … … 3892 3926 * Horizontal + vertical spacing 3893 3927 */ 3894 staticLRESULT LISTVIEW_GetItemSpacing(HWND hwnd, BOOL bSmall)3928 LRESULT LISTVIEW_GetItemSpacing(HWND hwnd, BOOL bSmall) 3895 3929 { 3896 3930 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); … … 3922 3956 * State specified by the mask. 3923 3957 */ 3924 staticLRESULT LISTVIEW_GetItemState(HWND hwnd, INT nItem, UINT uMask)3958 LRESULT LISTVIEW_GetItemState(HWND hwnd, INT nItem, UINT uMask) 3925 3959 { 3926 3960 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); … … 3956 3990 * FAILURE : 0 3957 3991 */ 3958 staticLRESULT LISTVIEW_GetItemTextA(HWND hwnd, INT nItem, LPLVITEMA lpLVItem)3992 LRESULT LISTVIEW_GetItemTextA(HWND hwnd, INT nItem, LPLVITEMA lpLVItem) 3959 3993 { 3960 3994 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); … … 4509 4543 } 4510 4544 4511 /* LISTVIEW_InsertColumnW */ 4545 static LRESULT LISTVIEW_InsertColumnW(HWND hwnd, INT nColumn, 4546 LPLVCOLUMNW lpColumn) 4547 { 4548 LVCOLUMNA lvca; 4549 LRESULT lres; 4550 4551 memcpy(&lvca,lpColumn,sizeof(lvca)); 4552 //AH: todo 4553 // if (lpColumn->mask & LVCF_TEXT) 4554 // lvca.pszText = HEAP_strdupWtoA(GetProcessHeap(),0,lpColumn->pszText); 4555 lres = LISTVIEW_InsertColumnA(hwnd,nColumn,&lvca); 4556 if (lpColumn->mask & LVCF_TEXT) 4557 HeapFree(GetProcessHeap(),0,lvca.pszText); 4558 return lres; 4559 } 4512 4560 4513 4561 /*** … … 4609 4657 } 4610 4658 4611 /* LISTVIEW_InsertItemW */ 4659 static LRESULT LISTVIEW_InsertItemW(HWND hwnd, LPLVITEMW lpLVItem) { 4660 LVITEMA lvia; 4661 LRESULT lres; 4662 4663 memcpy(&lvia,lpLVItem,sizeof(LVITEMA)); 4664 if (lvia.mask & LVIF_TEXT) { 4665 if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) 4666 lvia.pszText = LPSTR_TEXTCALLBACKA; 4667 //AH: todo 4668 // else 4669 // lvia.pszText = HEAP_strdupWtoA(GetProcessHeap(),0,lpLVItem->pszText); 4670 } 4671 lres = LISTVIEW_InsertItemA(hwnd, &lvia); 4672 if (lvia.mask & LVIF_TEXT) { 4673 if (lpLVItem->pszText != LPSTR_TEXTCALLBACKW) 4674 HeapFree(GetProcessHeap(),0,lvia.pszText); 4675 } 4676 return lres; 4677 } 4612 4678 4613 4679 /*** … … 6323 6389 infoPtr->bFocus = TRUE; 6324 6390 6391 InvalidateRect(hwnd, NULL, TRUE); 6392 UpdateWindow(hwnd); 6393 6325 6394 return 0; 6326 6395 } … … 6722 6791 6723 6792 case LVM_INSERTCOLUMNA: 6724 return LISTVIEW_InsertColumnA(hwnd, (INT)wParam, 6725 (LPLVCOLUMNA)lParam); 6726 6727 /* case LVM_INSERTCOLUMNW: */ 6793 return LISTVIEW_InsertColumnA(hwnd, (INT)wParam, (LPLVCOLUMNA)lParam); 6794 6795 case LVM_INSERTCOLUMNW: 6796 return LISTVIEW_InsertColumnW(hwnd, (INT)wParam, (LPLVCOLUMNW)lParam); 6728 6797 6729 6798 case LVM_INSERTITEMA: 6730 6799 return LISTVIEW_InsertItemA(hwnd, (LPLVITEMA)lParam); 6731 6800 6732 /* case LVM_INSERTITEMW: */ 6801 case LVM_INSERTITEMW: 6802 return LISTVIEW_InsertItemW(hwnd, (LPLVITEMW)lParam); 6733 6803 6734 6804 case LVM_REDRAWITEMS: … … 6827 6897 6828 6898 case WM_GETDLGCODE: 6829 return DLGC_WANT TAB| DLGC_WANTARROWS;6899 return DLGC_WANTCHARS | DLGC_WANTARROWS; 6830 6900 6831 6901 case WM_GETFONT:
Note:
See TracChangeset
for help on using the changeset viewer.