Changeset 3216 for trunk/src/comctl32/listview.cpp
- Timestamp:
- Mar 24, 2000, 6:16:27 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/listview.cpp
r3203 r3216 1 /*$Id: listview.cpp,v 1. 6 2000-03-23 17:14:34cbratschi Exp $*/1 /*$Id: listview.cpp,v 1.7 2000-03-24 17:14:02 cbratschi Exp $*/ 2 2 /* 3 3 * Listview control … … 13 13 * TODO: 14 14 * - Hot item handling. 15 * - use hdpaSelItems for multisel 15 16 * 16 17 * Notifications: … … 158 159 { 159 160 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 160 DWORD dwStyle;161 UINT uView;162 161 163 162 if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return; 164 163 165 dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 166 uView = dwStyle & LVS_TYPEMASK; 167 168 if (uView == LVS_REPORT) 164 if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) 169 165 { 170 166 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); … … 221 217 if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return; 222 218 LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS); 223 //CB: todo: clip header 219 220 if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) 221 { 222 RECT header; 223 INT headerH; 224 225 GetWindowRect(infoPtr->hwndHeader,&header); 226 headerH = rect.bottom-rect.top; 227 if (rect.bottom <= headerH) return; 228 if (rect.top < headerH) rect.top = headerH; 229 } 230 224 231 InvalidateRect(hwnd,&rect,TRUE); 225 232 } … … 233 240 if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return; 234 241 LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS); 235 //CB: todo: clip header 242 236 243 //get header rect 237 244 Header_GetItemRect(infoPtr->hwndHeader,nSubItem,&header); … … 239 246 rect.right = max(header.left,header.right-REPORT_MARGINX); 240 247 248 if (!(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) 249 { 250 INT headerH; 251 252 GetWindowRect(infoPtr->hwndHeader,&header); 253 headerH = rect.bottom-rect.top; 254 if (rect.bottom <= headerH) return; 255 if (rect.top < headerH) rect.top = headerH; 256 } 257 241 258 /* Offset the Scroll Bar Pos */ 242 259 rect.left -= xOffset; … … 246 263 } 247 264 248 static VOID LISTVIEW_ScrollWindow(HWND hwnd,INT xScroll,INT yScroll ,UINT uView)265 static VOID LISTVIEW_ScrollWindow(HWND hwnd,INT xScroll,INT yScroll) 249 266 { 250 267 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); … … 252 269 if (infoPtr->refreshFlags & (RF_REFRESH | RF_NOREDRAW)) return; 253 270 254 if ( uView == LVS_REPORT)271 if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) 255 272 { 256 273 RECT rect,header; … … 263 280 { //up 264 281 INT headerH = header.bottom-header.top; 265 282 //CB: redraw bug with _KeySelection 283 //UpdateWindow(hwnd); 284 //CB: inconsistent lefttop.y during this call 266 285 rect.top += headerH-yScroll; 267 286 if (rect.top < rect.bottom) … … 270 289 rect.top = rect.bottom+yScroll; 271 290 if (rect.top < headerH) rect.top = headerH; 272 InvalidateRect(hwnd,&rect,TRUE); //CB: still wrong pixels291 InvalidateRect(hwnd,&rect,TRUE); 273 292 } else 274 293 { … … 339 358 { 340 359 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 341 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);342 UINT uView = dwStyle & LVS_TYPEMASK;343 360 INT nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top; 344 361 INT nListWidth = infoPtr->rcList.right - infoPtr->rcList.left; 345 362 SCROLLINFO scrollInfo; 346 363 347 if ( dwStyle & LVS_NOSCROLL)364 if (infoPtr->dwStyle & LVS_NOSCROLL) 348 365 { 349 366 infoPtr->lefttop.x = 0; … … 353 370 infoPtr->scrollStep = infoPtr->lefttop; 354 371 ShowScrollBar(hwnd,SB_BOTH,FALSE); 372 //update scroll flags 373 infoPtr->dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 355 374 return; 356 375 } … … 359 378 scrollInfo.cbSize = sizeof(SCROLLINFO); 360 379 361 if ( uView == LVS_LIST)380 if (infoPtr->uView == LVS_LIST) 362 381 { 363 382 /* update horizontal scrollbar */ … … 365 384 INT nCountPerRow = LISTVIEW_GetCountPerRow(hwnd); 366 385 INT nNumOfItems = GETITEMCOUNT(infoPtr); 367 386 //CB: wrong 368 387 infoPtr->maxScroll.x = nNumOfItems / nCountPerColumn; 369 388 if ((nNumOfItems % nCountPerColumn) == 0) … … 380 399 scrollInfo.fMask = SIF_RANGE | SIF_POS | SIF_PAGE; 381 400 SetScrollInfo(hwnd,SB_HORZ,&scrollInfo,TRUE); 382 } else if ( uView == LVS_REPORT)401 } else if (infoPtr->uView == LVS_REPORT) 383 402 { 384 403 /* update vertical scrollbar */ … … 397 416 /* update horizontal scrollbar */ 398 417 nListWidth = infoPtr->rcList.right - infoPtr->rcList.left; 399 if (!( dwStyle & WS_HSCROLL) || !GETITEMCOUNT(infoPtr))418 if (!(infoPtr->dwStyle & WS_HSCROLL) || !GETITEMCOUNT(infoPtr)) 400 419 infoPtr->lefttop.x = 0; 401 420 … … 423 442 424 443 /* Update Horizontal Scrollbar */ 425 if (!( dwStyle & WS_HSCROLL) || !GETITEMCOUNT(infoPtr))444 if (!(infoPtr->dwStyle & WS_HSCROLL) || !GETITEMCOUNT(infoPtr)) 426 445 infoPtr->lefttop.x = 0; 427 446 infoPtr->maxScroll.x = max(nViewWidth / LISTVIEW_SCROLL_DIV_SIZE, 0); … … 438 457 /* Update Vertical Scrollbar */ 439 458 nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top; 440 if (!( dwStyle & WS_VSCROLL) || !GETITEMCOUNT(infoPtr))459 if (!(infoPtr->dwStyle & WS_VSCROLL) || !GETITEMCOUNT(infoPtr)) 441 460 infoPtr->lefttop.x = 0; 442 461 infoPtr->maxScroll.y = max(nViewHeight / LISTVIEW_SCROLL_DIV_SIZE,0); … … 452 471 } 453 472 } 473 //update scroll flags 474 infoPtr->dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 454 475 } 455 476 … … 467 488 static VOID LISTVIEW_UnsupportedStyles(LONG lStyle) 468 489 { 469 if ((LVS_TYPEMASK & lStyle) == LVS_EDITLABELS)470 {471 //FIXME(" LVS_EDITLABELS\n");472 }473 474 490 if ((LVS_TYPEMASK & lStyle) == LVS_NOLABELWRAP) 475 491 { … … 511 527 { 512 528 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 513 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;514 529 INT nListWidth = infoPtr->rcList.right - infoPtr->rcList.left; 515 530 POINT ptItem; … … 517 532 INT i; 518 533 519 if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))534 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 520 535 { 521 536 ZeroMemory(&ptItem, sizeof(POINT)); … … 568 583 { 569 584 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 570 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;571 585 INT nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top; 572 586 POINT ptItem; … … 574 588 INT i; 575 589 576 if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))590 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 577 591 { 578 592 ZeroMemory(&ptItem, sizeof(POINT)); … … 724 738 { 725 739 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 726 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;727 740 INT nHeaderItemCount; 728 741 RECT rcHeaderItem; … … 731 744 INT i; 732 745 733 if ( uView == LVS_ICON)746 if (infoPtr->uView == LVS_ICON) 734 747 { 735 748 nItemWidth = infoPtr->iconSpacing.cx; 736 749 } 737 else if ( uView == LVS_REPORT)750 else if (infoPtr->uView == LVS_REPORT) 738 751 { 739 752 /* calculate width of header */ … … 807 820 { 808 821 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 809 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;810 822 INT nHeaderItemCount; 811 823 RECT rcHeaderItem; … … 813 825 INT i; 814 826 815 // TRACE("(hwnd=%x)\n", hwnd); 816 817 if (uView == LVS_ICON) 827 if (infoPtr->uView == LVS_ICON) 818 828 { 819 829 nItemWidth = infoPtr->iconSpacing.cx; 820 830 } 821 else if ( uView == LVS_REPORT)831 else if (infoPtr->uView == LVS_REPORT) 822 832 { 823 833 /* calculate width of header */ … … 882 892 { 883 893 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 884 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;885 894 INT nItemHeight = 0; 886 895 887 if ( uView == LVS_ICON)896 if (infoPtr->uView == LVS_ICON) 888 897 { 889 898 nItemHeight = infoPtr->iconSpacing.cy; … … 1030 1039 { 1031 1040 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 1032 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK; 1033 1034 if ((uView == LVS_LIST) || (uView == LVS_REPORT)) 1041 1042 if ((infoPtr->uView == LVS_LIST) || (infoPtr->uView == LVS_REPORT)) 1035 1043 { 1036 1044 INT i; … … 1112 1120 { 1113 1121 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 1114 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);1115 1122 DWORD mask = LVIS_FOCUSED; 1116 1123 1117 if (!( dwStyle & LVS_SINGLESEL))1124 if (!(infoPtr->dwStyle & LVS_SINGLESEL)) 1118 1125 { 1119 1126 if (nItem > 0) … … 1146 1153 { 1147 1154 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 1148 LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);1149 1155 WORD wShift = HIWORD(GetKeyState(VK_SHIFT)); 1150 1156 WORD wCtrl = HIWORD(GetKeyState(VK_CONTROL)); … … 1152 1158 if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr))) 1153 1159 { 1154 if ( lStyle & LVS_SINGLESEL)1160 if (infoPtr->dwStyle & LVS_SINGLESEL) 1155 1161 { 1156 1162 LISTVIEW_SetSelection(hwnd, nItem); … … 1191 1197 { 1192 1198 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 1193 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);1194 UINT uView = dwStyle & LVS_TYPEMASK;1195 1199 RECT rcItem; 1196 1200 INT i,nFirst = LISTVIEW_GetTopIndex(hwnd),nLast = GETITEMCOUNT(infoPtr); … … 1199 1203 // remove loop 1200 1204 1201 if ( uView == LVS_REPORT)1205 if (infoPtr->uView == LVS_REPORT) 1202 1206 { 1203 1207 nLast = nFirst+LISTVIEW_GetCountPerColumn(hwnd)+2; … … 1482 1486 static BOOL LISTVIEW_InitItem(HWND hwnd,LISTVIEW_ITEM *lpItem,LPLVITEMW lpLVItem,BOOL unicode) 1483 1487 { 1484 L ONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);1488 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 1485 1489 BOOL bResult = FALSE; 1486 1490 … … 1516 1520 if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) 1517 1521 { 1518 if (( lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING))1522 if ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING)) 1519 1523 { 1520 1524 return FALSE; … … 1542 1546 if ((LPSTR)lpLVItem->pszText == LPSTR_TEXTCALLBACKA) 1543 1547 { 1544 if (( lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING))1548 if ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING)) 1545 1549 { 1546 1550 return FALSE; … … 1596 1600 static BOOL LISTVIEW_InitSubItem(HWND hwnd,LISTVIEW_SUBITEM *lpSubItem,LPLVITEMW lpLVItem,BOOL unicode) 1597 1601 { 1598 L ONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);1602 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 1599 1603 BOOL bResult = FALSE; 1600 1604 … … 1617 1621 if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) 1618 1622 { 1619 if (( lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING))1623 if ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING)) 1620 1624 return FALSE; 1621 1625 … … 1635 1639 if ((LPSTR)lpLVItem->pszText == LPSTR_TEXTCALLBACKA) 1636 1640 { 1637 if (( lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING))1641 if ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING)) 1638 1642 return FALSE; 1639 1643 … … 1680 1684 static BOOL LISTVIEW_AddSubItem(HWND hwnd, LPLVITEMW lpLVItem,BOOL unicode) 1681 1685 { 1682 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO 1686 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 1683 1687 LISTVIEW_SUBITEM *lpSubItem = NULL; 1684 1688 BOOL bResult = FALSE; … … 1797 1801 static INT LISTVIEW_GetTopIndex(HWND hwnd) 1798 1802 { 1799 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 1800 DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 1801 UINT uView = dwStyle & LVS_TYPEMASK; 1803 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 1802 1804 INT nItem = 0; 1803 1805 1804 if ( uView == LVS_LIST)1805 { 1806 if ( dwStyle & WS_HSCROLL)1806 if (infoPtr->uView == LVS_LIST) 1807 { 1808 if (infoPtr->dwStyle & WS_HSCROLL) 1807 1809 nItem = infoPtr->lefttop.x*LISTVIEW_GetCountPerColumn(hwnd); 1808 } else if ( uView == LVS_REPORT)1809 { 1810 if ( dwStyle & WS_VSCROLL)1810 } else if (infoPtr->uView == LVS_REPORT) 1811 { 1812 if (infoPtr->dwStyle & WS_VSCROLL) 1811 1813 nItem = infoPtr->lefttop.y; 1812 1814 } … … 1925 1927 nMixMode = SetROP2(hdc, R2_XORPEN); 1926 1928 } 1927 else if (( GetWindowLongA(hwnd, GWL_STYLE)& LVS_SHOWSELALWAYS) &&1929 else if ((infoPtr->dwStyle & LVS_SHOWSELALWAYS) && 1928 1930 (lvItem.header.state & LVIS_SELECTED) && !infoPtr->bFocus) 1929 1931 { … … 2067 2069 { 2068 2070 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2069 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);2070 2071 INT nDrawPosY = infoPtr->rcList.top; 2071 2072 INT nColumnCount = Header_GetItemCount(infoPtr->hwndHeader); … … 2080 2081 2081 2082 /* send cache hint notification */ 2082 if ( dwStyle & LVS_OWNERDATA)2083 if (infoPtr->dwStyle & LVS_OWNERDATA) 2083 2084 { 2084 2085 NMLVCACHEHINT nmlv; … … 2101 2102 2102 2103 /* Offset the Scroll Bar Pos */ 2103 if ( dwStyle & WS_HSCROLL)2104 if (infoPtr->dwStyle & WS_HSCROLL) 2104 2105 { 2105 2106 rcHeader[j].left -= xOffset; … … 2146 2147 { 2147 2148 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2148 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;2149 2149 INT nListWidth = infoPtr->rcList.right - infoPtr->rcList.left; 2150 2150 INT nCountPerRow = 1; … … 2152 2152 if (nListWidth > 0) 2153 2153 { 2154 if ( uView == LVS_REPORT)2154 if (infoPtr->uView == LVS_REPORT) 2155 2155 { 2156 2156 nCountPerRow = 1; … … 2210 2210 { 2211 2211 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2212 LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);2213 2212 INT nColumnCount = 0; 2214 2213 2215 if ( (lStyle & LVS_TYPEMASK)== LVS_LIST)2214 if (infoPtr->uView == LVS_LIST) 2216 2215 { 2217 2216 if (infoPtr->rcList.right % infoPtr->nItemWidth == 0) … … 2345 2344 { 2346 2345 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 2347 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;2348 2346 HFONT hOldFont; 2349 2347 HPEN hPen, hOldPen; … … 2359 2357 SelectObject(hdc, GetStockObject(NULL_BRUSH)); 2360 2358 2361 switch ( uView)2359 switch (infoPtr->uView) 2362 2360 { 2363 2361 case LVS_LIST: … … 2403 2401 WORD wWidth, WORD wHeight) 2404 2402 { 2405 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2406 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK; 2403 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 2407 2404 INT nItemCountPerColumn = 1; 2408 2405 INT nColumnCount = 0; … … 2414 2411 } 2415 2412 2416 if ( uView == LVS_LIST)2413 if (infoPtr->uView == LVS_LIST) 2417 2414 { 2418 2415 if (wHeight == 0xFFFF) … … 2454 2451 dwViewRect = MAKELONG(wWidth, wHeight); 2455 2452 } 2456 else if ( uView == LVS_REPORT)2453 else if (infoPtr->uView == LVS_REPORT) 2457 2454 { 2458 2455 /* TO DO */ 2459 2456 } 2460 else if ( uView == LVS_SMALLICON)2457 else if (infoPtr->uView == LVS_SMALLICON) 2461 2458 { 2462 2459 /* TO DO */ 2463 2460 } 2464 else if ( uView == LVS_ICON)2461 else if (infoPtr->uView == LVS_ICON) 2465 2462 { 2466 2463 /* TO DO */ … … 2484 2481 static LRESULT LISTVIEW_Arrange(HWND hwnd, INT nAlignCode) 2485 2482 { 2486 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;2483 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 2487 2484 BOOL bResult = FALSE; 2488 2485 2489 if (( uView == LVS_ICON) || (uView == LVS_SMALLICON))2486 if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) 2490 2487 { 2491 2488 switch (nAlignCode) … … 2525 2522 { 2526 2523 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2527 LONG lCtrlId = GetWindowLongA(hwnd, GWL_ID);2528 LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);2529 UINT uView = lStyle & LVS_TYPEMASK;2530 2524 LISTVIEW_ITEM *lpItem; 2531 2525 LISTVIEW_SUBITEM *lpSubItem; … … 2603 2597 2604 2598 /* align items (set position of each item) */ 2605 if (( uView == LVS_ICON) || (uView == LVS_SMALLICON))2606 { 2607 if ( lStyle & LVS_ALIGNLEFT)2599 if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) 2600 { 2601 if (infoPtr->dwStyle & LVS_ALIGNLEFT) 2608 2602 { 2609 2603 LISTVIEW_AlignLeft(hwnd); … … 2639 2633 { 2640 2634 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2641 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;2642 2635 BOOL bResult = FALSE; 2643 2636 2644 if (Header_DeleteItem(infoPtr->hwndHeader, nColumn) != FALSE)2637 if (Header_DeleteItem(infoPtr->hwndHeader, nColumn)) 2645 2638 { 2646 2639 bResult = LISTVIEW_RemoveColumn(infoPtr->hdpaItems, nColumn); … … 2650 2643 2651 2644 /* reset scroll parameters */ 2652 if ( uView == LVS_REPORT)2645 if (infoPtr->uView == LVS_REPORT) 2653 2646 { 2654 2647 /* update scrollbar(s) */ … … 2678 2671 { 2679 2672 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2680 LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);2681 UINT uView = lStyle & LVS_TYPEMASK;2682 2673 NMLISTVIEW nmlv; 2683 2674 BOOL bResult = FALSE; … … 2737 2728 2738 2729 /* align items (set position of each item) */ 2739 if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))2740 { 2741 if ( lStyle & LVS_ALIGNLEFT)2730 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 2731 { 2732 if (infoPtr->dwStyle & LVS_ALIGNLEFT) 2742 2733 { 2743 2734 LISTVIEW_AlignLeft(hwnd); … … 2884 2875 WCHAR* textW = NULL; 2885 2876 2886 if (!( GetWindowLongA(hwnd, GWL_STYLE)& LVS_EDITLABELS))2877 if (!(infoPtr->dwStyle & LVS_EDITLABELS)) 2887 2878 return FALSE; 2888 2879 … … 2972 2963 { 2973 2964 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2974 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);2975 UINT uView = dwStyle & LVS_TYPEMASK;2976 2965 SCROLLINFO scrollInfo; 2977 2966 INT nScrollPosHeight = 0; … … 2991 2980 if (rcItem.left < infoPtr->rcList.left) 2992 2981 { 2993 if ( dwStyle & WS_HSCROLL)2982 if (infoPtr->dwStyle & WS_HSCROLL) 2994 2983 { 2995 2984 /* scroll left */ 2996 if ( uView == LVS_LIST)2985 if (infoPtr->uView == LVS_LIST) 2997 2986 { 2998 2987 nScrollPosWidth = infoPtr->scrollStep.x; 2999 2988 rcItem.left += infoPtr->rcList.left; 3000 } else if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))2989 } else if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 3001 2990 { 3002 2991 nScrollPosWidth = infoPtr->scrollStep.x; … … 3022 3011 } else if (rcItem.right > infoPtr->rcList.right) 3023 3012 { 3024 if ( dwStyle & WS_HSCROLL)3013 if (infoPtr->dwStyle & WS_HSCROLL) 3025 3014 { 3026 3015 /* scroll right */ 3027 if ( uView == LVS_LIST)3016 if (infoPtr->uView == LVS_LIST) 3028 3017 { 3029 3018 rcItem.right -= infoPtr->rcList.right; 3030 3019 nScrollPosWidth = infoPtr->scrollStep.x; 3031 } else if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))3020 } else if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 3032 3021 { 3033 3022 rcItem.right -= infoPtr->rcList.right; … … 3058 3047 { 3059 3048 /* scroll up */ 3060 if ( dwStyle & WS_VSCROLL)3061 { 3062 if ( uView == LVS_REPORT)3049 if (infoPtr->dwStyle & WS_VSCROLL) 3050 { 3051 if (infoPtr->uView == LVS_REPORT) 3063 3052 { 3064 3053 rcItem.top -= infoPtr->rcList.top; 3065 3054 nScrollPosHeight = infoPtr->scrollStep.y; 3066 3055 } 3067 else if (( uView == LVS_ICON) || (uView == LVS_SMALLICON))3056 else if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) 3068 3057 { 3069 3058 nScrollPosHeight = infoPtr->scrollStep.y; … … 3085 3074 { 3086 3075 /* scroll down */ 3087 if ( dwStyle & WS_VSCROLL)3088 { 3089 if ( uView == LVS_REPORT)3076 if (infoPtr->dwStyle & WS_VSCROLL) 3077 { 3078 if (infoPtr->uView == LVS_REPORT) 3090 3079 { 3091 3080 rcItem.bottom -= infoPtr->rcList.bottom; 3092 3081 nScrollPosHeight = infoPtr->scrollStep.y; 3093 } else if (( uView == LVS_ICON) || (uView == LVS_SMALLICON))3082 } else if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) 3094 3083 { 3095 3084 nScrollPosHeight = infoPtr->scrollStep.x; … … 3111 3100 3112 3101 if ((oldlefttop.x != infoPtr->lefttop.x) || (oldlefttop.y != infoPtr->lefttop.y)) 3113 LISTVIEW_ScrollWindow(hwnd,(oldlefttop.x-infoPtr->lefttop.x)*infoPtr->scrollStep.x,(oldlefttop.y-infoPtr->lefttop.y)*infoPtr->scrollStep.y ,uView);3102 LISTVIEW_ScrollWindow(hwnd,(oldlefttop.x-infoPtr->lefttop.x)*infoPtr->scrollStep.x,(oldlefttop.y-infoPtr->lefttop.y)*infoPtr->scrollStep.y); 3114 3103 3115 3104 return TRUE; … … 3524 3513 { 3525 3514 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 3526 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;3527 3515 INT nColumnWidth = 0; 3528 3516 HDITEMA hdi; 3529 3517 3530 if ( uView == LVS_LIST)3518 if (infoPtr->uView == LVS_LIST) 3531 3519 { 3532 3520 nColumnWidth = infoPtr->nItemWidth; 3533 3521 } 3534 else if ( uView == LVS_REPORT)3522 else if (infoPtr->uView == LVS_REPORT) 3535 3523 { 3536 3524 /* get column width from header */ … … 3561 3549 { 3562 3550 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 3563 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;3564 3551 INT nItemCount = 0; 3565 3552 3566 if ( uView == LVS_LIST)3553 if (infoPtr->uView == LVS_LIST) 3567 3554 { 3568 3555 if (infoPtr->rcList.right > infoPtr->nItemWidth) … … 3572 3559 } 3573 3560 } 3574 else if ( uView == LVS_REPORT)3561 else if (infoPtr->uView == LVS_REPORT) 3575 3562 { 3576 3563 nItemCount = LISTVIEW_GetCountPerColumn(hwnd); … … 4123 4110 { 4124 4111 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 4125 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;4126 4112 BOOL bResult = FALSE; 4127 4113 HDPA hdpaSubItems; … … 4133 4119 (lpptPosition != NULL)) 4134 4120 { 4135 if ( uView == LVS_LIST)4121 if (infoPtr->uView == LVS_LIST) 4136 4122 { 4137 4123 bResult = TRUE; … … 4158 4144 } 4159 4145 } 4160 else if ( uView == LVS_REPORT)4146 else if (infoPtr->uView == LVS_REPORT) 4161 4147 { 4162 4148 bResult = TRUE; … … 4207 4193 { 4208 4194 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 4209 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;4210 4195 BOOL bResult = FALSE; 4211 4196 POINT ptOrigin; … … 4225 4210 { 4226 4211 case LVIR_ICON: 4227 if ( uView == LVS_ICON)4212 if (infoPtr->uView == LVS_ICON) 4228 4213 { 4229 4214 if (infoPtr->himlNormal != NULL) … … 4240 4225 } 4241 4226 } 4242 else if ( uView == LVS_SMALLICON)4227 else if (infoPtr->uView == LVS_SMALLICON) 4243 4228 { 4244 4229 if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE) … … 4282 4267 4283 4268 case LVIR_LABEL: 4284 if ( uView == LVS_ICON)4269 if (infoPtr->uView == LVS_ICON) 4285 4270 { 4286 4271 if (infoPtr->himlNormal != NULL) … … 4313 4298 } 4314 4299 } 4315 else if ( uView == LVS_SMALLICON)4300 else if (infoPtr->uView == LVS_SMALLICON) 4316 4301 { 4317 4302 if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE) … … 4373 4358 4374 4359 case LVIR_BOUNDS: 4375 if ( uView == LVS_ICON)4360 if (infoPtr->uView == LVS_ICON) 4376 4361 { 4377 4362 if (infoPtr->himlNormal != NULL) … … 4387 4372 } 4388 4373 } 4389 else if ( uView == LVS_SMALLICON)4374 else if (infoPtr->uView == LVS_SMALLICON) 4390 4375 { 4391 4376 if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE) … … 4434 4419 4435 4420 case LVIR_SELECTBOUNDS: 4436 if ( uView == LVS_ICON)4421 if (infoPtr->uView == LVS_ICON) 4437 4422 { 4438 4423 if (infoPtr->himlNormal != NULL) … … 4448 4433 } 4449 4434 } 4450 else if ( uView == LVS_SMALLICON)4435 else if (infoPtr->uView == LVS_SMALLICON) 4451 4436 { 4452 4437 if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE) … … 4658 4643 { 4659 4644 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 4660 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;4661 4645 UINT uMask = 0; 4662 4646 LVFINDINFOW lvFindInfo; … … 4682 4666 if (uFlags & LVNI_ABOVE) 4683 4667 { 4684 if (( uView == LVS_LIST) || (uView == LVS_REPORT))4668 if ((infoPtr->uView == LVS_LIST) || (infoPtr->uView == LVS_REPORT)) 4685 4669 { 4686 4670 while (nItem >= 0) … … 4705 4689 else if (uFlags & LVNI_BELOW) 4706 4690 { 4707 if (( uView == LVS_LIST) || (uView == LVS_REPORT))4691 if ((infoPtr->uView == LVS_LIST) || (infoPtr->uView == LVS_REPORT)) 4708 4692 { 4709 4693 while (nItem < GETITEMCOUNT(infoPtr)) … … 4728 4712 else if (uFlags & LVNI_TOLEFT) 4729 4713 { 4730 if ( uView == LVS_LIST)4714 if (infoPtr->uView == LVS_LIST) 4731 4715 { 4732 4716 nCountPerColumn = LISTVIEW_GetCountPerColumn(hwnd); … … 4738 4722 } 4739 4723 } 4740 else if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))4724 else if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 4741 4725 { 4742 4726 lvFindInfo.flags = LVFI_NEARESTXY; … … 4752 4736 else if (uFlags & LVNI_TORIGHT) 4753 4737 { 4754 if ( uView == LVS_LIST)4738 if (infoPtr->uView == LVS_LIST) 4755 4739 { 4756 4740 nCountPerColumn = LISTVIEW_GetCountPerColumn(hwnd); … … 4762 4746 } 4763 4747 } 4764 else if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))4748 else if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 4765 4749 { 4766 4750 lvFindInfo.flags = LVFI_NEARESTXY; … … 4807 4791 { 4808 4792 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 4809 DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 4810 UINT uView = dwStyle & LVS_TYPEMASK; 4811 4812 if ((uView == LVS_SMALLICON) || (uView == LVS_ICON)) 4813 { 4814 if (dwStyle & WS_HSCROLL) 4793 4794 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 4795 { 4796 if (infoPtr->dwStyle & WS_HSCROLL) 4815 4797 lpptOrigin->x = -infoPtr->lefttop.x*infoPtr->scrollStep.x; 4816 4798 else 4817 4799 lpptOrigin->x = 0; 4818 4800 4819 if ( dwStyle & WS_VSCROLL)4801 if (infoPtr->dwStyle & WS_VSCROLL) 4820 4802 lpptOrigin->y = -infoPtr->lefttop.y*infoPtr->scrollStep.y; 4821 4803 else … … 5143 5125 hdi.iOrder = lpColumn->iOrder; 5144 5126 } 5145 5127 //CB: todo: use macros 5146 5128 /* insert item in header control */ 5147 5129 if (unicode) … … 5182 5164 LISTVIEW_ITEM* lv_first = (LISTVIEW_ITEM*) DPA_GetPtr( hdpa_first, 0 ); 5183 5165 LISTVIEW_ITEM* lv_second = (LISTVIEW_ITEM*) DPA_GetPtr( hdpa_second, 0 ); 5184 LONG lStyle = GetWindowLongA((HWND) lParam, GWL_STYLE);5166 LONG dwStyle = GetWindowLongA((HWND) lParam, GWL_STYLE); 5185 5167 INT cmpv = lstrcmpW( lv_first->pszText, lv_second->pszText ); 5186 5168 /* if we're sorting descending, negate the return value */ 5187 return ( lStyle & LVS_SORTDESCENDING) ? -cmpv : cmpv;5169 return (dwStyle & LVS_SORTDESCENDING) ? -cmpv : cmpv; 5188 5170 } 5189 5171 … … 5203 5185 { 5204 5186 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 5205 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);5206 UINT uView = dwStyle & LVS_TYPEMASK;5207 LONG lCtrlId = GetWindowLongA(hwnd,GWL_ID);5208 5187 NMLISTVIEW nmlv; 5209 5188 INT nItem = -1; … … 5221 5200 { 5222 5201 ZeroMemory(lpItem, sizeof(LISTVIEW_ITEM)); 5223 if (LISTVIEW_InitItem(hwnd, lpItem, lpLVItem,unicode) != FALSE)5202 if (LISTVIEW_InitItem(hwnd, lpItem, lpLVItem,unicode)) 5224 5203 { 5225 5204 /* insert item in listview control data structure */ 5226 5205 hdpaSubItems = DPA_Create(8); 5227 if (hdpaSubItems != NULL)5206 if (hdpaSubItems) 5228 5207 { 5229 5208 nItem = DPA_InsertPtr(hdpaSubItems, 0, lpItem); 5230 5209 if (nItem != -1) 5231 5210 { 5232 if ( (( dwStyle & LVS_SORTASCENDING) || (dwStyle & LVS_SORTDESCENDING))5233 && !( dwStyle & LVS_OWNERDRAWFIXED)5211 if ( ((infoPtr->dwStyle & LVS_SORTASCENDING) || (infoPtr->dwStyle & LVS_SORTDESCENDING)) 5212 && !(infoPtr->dwStyle & LVS_OWNERDRAWFIXED) 5234 5213 && (LPSTR_TEXTCALLBACKW != lpLVItem->pszText) ) 5235 5214 { … … 5269 5248 sendNotify(hwnd,LVN_INSERTITEM,&nmlv.hdr); 5270 5249 5271 if (( uView == LVS_SMALLICON) || (uView == LVS_LIST))5250 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_LIST)) 5272 5251 { 5273 5252 nItemWidth = LISTVIEW_CalculateWidth(hwnd, lpLVItem->iItem); … … 5279 5258 5280 5259 /* align items (set position of each item) */ 5281 if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))5260 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 5282 5261 { 5283 if ( dwStyle & LVS_ALIGNLEFT)5262 if (infoPtr->dwStyle & LVS_ALIGNLEFT) 5284 5263 { 5285 5264 LISTVIEW_AlignLeft(hwnd); … … 5548 5527 HDITEMA hdi; 5549 5528 LRESULT lret; 5550 LONG lStyle;5551 5529 5552 5530 // set column width only if in report mode 5553 lStyle = GetWindowLongA(hwnd, GWL_STYLE); 5554 if ((lStyle & LVS_TYPEMASK) != LVS_REPORT) 5531 if (infoPtr->uView != LVS_REPORT) 5555 5532 return (FALSE); 5556 5533 … … 5787 5764 return LISTVIEW_DeleteAllItems (hwnd); 5788 5765 5789 if ( GetWindowLongA(hwnd, GWL_STYLE)& LVS_OWNERDATA)5766 if (infoPtr->dwStyle & LVS_OWNERDATA) 5790 5767 { 5791 5768 // FIXME("LVS_OWNERDATA is set!\n"); … … 5827 5804 { 5828 5805 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 5829 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;5830 5806 LISTVIEW_ITEM *lpItem; 5831 5807 HDPA hdpaSubItems; … … 5834 5810 if ((nItem >= 0) || (nItem < GETITEMCOUNT(infoPtr))) 5835 5811 { 5836 if (( uView == LVS_ICON) || (uView == LVS_SMALLICON))5812 if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) 5837 5813 { 5838 5814 hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem); … … 6131 6107 6132 6108 DPA_Destroy(sortList); 6109 LISTVIEW_Refresh(hwnd); 6133 6110 } 6134 6111 … … 6153 6130 { 6154 6131 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 6155 LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);6156 6132 BOOL bResult = FALSE; 6157 6133 RECT rc; … … 6162 6138 6163 6139 /* rearrange with default alignment style */ 6164 if (( lStyle & LVS_AUTOARRANGE) && (((lStyle & LVS_TYPEMASK)== LVS_ICON) ||6165 ( (lStyle & LVS_TYPEMASK)== LVS_SMALLICON)))6140 if ((infoPtr->dwStyle & LVS_AUTOARRANGE) && ((infoPtr->uView == LVS_ICON) || 6141 (infoPtr->uView == LVS_SMALLICON))) 6166 6142 { 6167 6143 LISTVIEW_Arrange(hwnd, 0); … … 6203 6179 6204 6180 /* set default values */ 6181 infoPtr->dwStyle = lpcs->style; 6182 infoPtr->uView = uView; 6205 6183 infoPtr->uCallbackMask = 0; 6206 6184 infoPtr->nFocusedItem = -1; … … 6251 6229 } 6252 6230 6253 /* display unsupported listview window styles */6254 LISTVIEW_UnsupportedStyles(lpcs->style);6255 6256 6231 /* allocate memory for the data structure */ 6257 infoPtr->hdpaItems = DPA_Create(10); 6232 infoPtr->hdpaItems = DPA_Create(64); 6233 infoPtr->hdpaSelItems = DPA_Create(10); 6258 6234 6259 6235 /* initialize size of items */ … … 6382 6358 SCROLLINFO scrollInfo; 6383 6359 RECT rect; 6384 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);6385 UINT uView = dwStyle & LVS_TYPEMASK;6386 6360 INT yScroll = (oldY-infoPtr->lefttop.y)*infoPtr->nItemHeight; 6387 6361 … … 6392 6366 SetScrollInfo(hwnd,SB_VERT,&scrollInfo,TRUE); 6393 6367 6394 LISTVIEW_ScrollWindow(hwnd,0,yScroll ,uView);6368 LISTVIEW_ScrollWindow(hwnd,0,yScroll); 6395 6369 6396 6370 return TRUE; … … 6466 6440 SCROLLINFO scrollInfo; 6467 6441 RECT rect; 6468 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);6469 UINT uView = dwStyle & LVS_TYPEMASK;6470 6442 INT xScroll = (oldX-infoPtr->lefttop.x)*infoPtr->scrollStep.x; 6471 6443 … … 6476 6448 SetScrollInfo(hwnd,SB_HORZ,&scrollInfo,TRUE); 6477 6449 6478 LISTVIEW_ScrollWindow(hwnd,xScroll,0 ,uView);6450 LISTVIEW_ScrollWindow(hwnd,xScroll,0); 6479 6451 } 6480 6452 … … 6487 6459 INT gcWheelDelta = 0; 6488 6460 UINT pulScrollLines = 3; 6489 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);6490 UINT uView = dwStyle & LVS_TYPEMASK;6491 6461 6492 6462 SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0); 6493 6463 gcWheelDelta -= wheelDelta; 6494 6464 6495 switch( uView)6465 switch(infoPtr->uView) 6496 6466 { 6497 6467 case LVS_ICON: … … 6501 6471 * should be fixed in the future. 6502 6472 */ 6503 if ( dwStyle & WS_VSCROLL)6473 if (infoPtr->dwStyle & WS_VSCROLL) 6504 6474 LISTVIEW_VScroll(hwnd,SB_THUMBPOSITION,infoPtr->lefttop.y+(gcWheelDelta < 0) ? 37:-37,0); 6505 6475 break; … … 6508 6478 if (abs(gcWheelDelta) >= WHEEL_DELTA && pulScrollLines) 6509 6479 { 6510 if ( dwStyle & WS_VSCROLL)6480 if (infoPtr->dwStyle & WS_VSCROLL) 6511 6481 { 6512 6482 int cLineScroll = min(LISTVIEW_GetCountPerColumn(hwnd), pulScrollLines); … … 6920 6890 { 6921 6891 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 6922 LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE);6923 6892 static BOOL bGroupSelect = TRUE; 6924 6893 POINT ptPosition; … … 6939 6908 if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr))) 6940 6909 { 6941 if ( lStyle & LVS_SINGLESEL)6910 if (infoPtr->dwStyle & LVS_SINGLESEL) 6942 6911 { 6943 6912 if ((LISTVIEW_GetItemState(hwnd, nItem, LVIS_SELECTED) & LVIS_SELECTED) && infoPtr->bDoEditLabel != TRUE) … … 7071 7040 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 7072 7041 7073 //TRACE("(hwnd=%x)\n", hwnd);7074 7075 7042 /* delete all items */ 7076 7043 LISTVIEW_DeleteAllItems(hwnd); … … 7078 7045 /* destroy data structure */ 7079 7046 DPA_Destroy(infoPtr->hdpaItems); 7047 DPA_Destroy(infoPtr->hdpaSelItems); 7080 7048 7081 7049 /* destroy font */ … … 7327 7295 { 7328 7296 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 7329 UINT uView = GetWindowLongA(hwnd, GWL_STYLE) & LVS_TYPEMASK;7330 7331 // TRACE("(hwnd=%x,hfont=%x,redraw=%hu)\n", hwnd, hFont, fRedraw);7332 7297 7333 7298 if (hFont == 0) … … 7340 7305 } 7341 7306 7342 if ( uView == LVS_REPORT)7307 if (infoPtr->uView == LVS_REPORT) 7343 7308 { 7344 7309 /* set header font */ … … 7409 7374 { 7410 7375 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 7411 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);7412 UINT uView = dwStyle & LVS_TYPEMASK;7413 7376 7414 7377 LISTVIEW_UpdateSize(hwnd); 7415 7378 LISTVIEW_UpdateScroll(hwnd); 7416 7379 7417 if (( uView == LVS_SMALLICON) || (uView == LVS_ICON))7418 { 7419 if ( dwStyle & LVS_ALIGNLEFT)7380 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 7381 { 7382 if (infoPtr->dwStyle & LVS_ALIGNLEFT) 7420 7383 LISTVIEW_AlignLeft(hwnd); 7421 7384 else … … 7438 7401 { 7439 7402 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 7440 LONG dwStyle = GetWindowLongA(hwnd,GWL_STYLE);7441 UINT uView = dwStyle & LVS_TYPEMASK;7442 7403 RECT rcList; 7443 7404 … … 7448 7409 infoPtr->rcList.bottom = max(rcList.bottom - rcList.top, 1); 7449 7410 7450 if ( uView == LVS_LIST)7451 { 7452 if (!( dwStyle & WS_HSCROLL))7411 if (infoPtr->uView == LVS_LIST) 7412 { 7413 if (!(infoPtr->dwStyle & WS_HSCROLL)) 7453 7414 { 7454 7415 INT nHScrollHeight = GetSystemMetrics(SM_CYHSCROLL); … … 7458 7419 } 7459 7420 } 7460 } else if ( uView == LVS_REPORT)7461 { 7462 if (!( dwStyle & LVS_NOCOLUMNHEADER))7421 } else if (infoPtr->uView == LVS_REPORT) 7422 { 7423 if (!(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) 7463 7424 { 7464 7425 HDLAYOUT hl; … … 7496 7457 if (wStyleType == GWL_STYLE) 7497 7458 { 7459 infoPtr->dwStyle = lpss->styleNew; 7460 infoPtr->uView = lpss->styleNew & LVS_TYPEMASK; 7498 7461 if (uOldView == LVS_REPORT) 7499 7462 {
Note:
See TracChangeset
for help on using the changeset viewer.