Changeset 3369 for trunk/src/comctl32/listview.cpp
- Timestamp:
- Apr 12, 2000, 6:39:00 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/listview.cpp
r3351 r3369 1 /*$Id: listview.cpp,v 1.1 1 2000-04-08 18:32:54cbratschi Exp $*/1 /*$Id: listview.cpp,v 1.12 2000-04-12 16:38:58 cbratschi Exp $*/ 2 2 /* 3 3 * Listview control … … 9 9 * 10 10 * NOTES 11 * Listview control implementation.11 * Listview control implementation. 12 12 * 13 13 * TODO: 14 14 * - Hot item handling. 15 * - use hdpaSelItems for multisel 15 * - subitems not sort save! (sortitem.exe) 16 * - rcView and origin (need testcase!!!) 17 * - rcView not updated in LVM_SETITEMPOSITION and other messages 18 * - many things untested! 16 19 * 17 20 * Notifications: … … 29 32 * LISTVIEW_GetColumnOrderArray : simple hack only 30 33 * LISTVIEW_SetColumnOrderArray : simple hack only 31 * LISTVIEW_Arrange : empty stub32 34 * LISTVIEW_ApproximateViewRect : incomplete 33 * LISTVIEW_Scroll : not implemented 34 * LISTVIEW_RedrawItems : empty stub 35 * LISTVIEW_Update : not completed 36 * 37 * the sort algorithm isn't stable (order of same items isn't fixed)!!! 35 * 38 36 */ 39 37 … … 43 41 */ 44 42 45 #include <string.h>46 #include <wcstr.h>47 43 #include <stdio.h> 48 44 #include "winbase.h" … … 84 80 85 81 /* Increment size of the horizontal scroll bar */ 86 #define LISTVIEW_SCROLL_DIV_SIZE 1 082 #define LISTVIEW_SCROLL_DIV_SIZE 1 87 83 88 84 /* … … 109 105 110 106 static INT LISTVIEW_HitTestItem(HWND, LPLVHITTESTINFO); 107 static INT LISTVIEW_GetColumnCount(HWND); 111 108 static INT LISTVIEW_GetCountPerRow(HWND); 112 109 static INT LISTVIEW_GetCountPerColumn(HWND); … … 121 118 static LRESULT LISTVIEW_GetItemRect(HWND hwnd,INT nItem,LPRECT lprc,INT code); 122 119 static INT LISTVIEW_GetItemWidth(HWND); 123 static INT LISTVIEW_GetLabelWidth(HWND, 120 static INT LISTVIEW_GetLabelWidth(HWND,INT,INT); 124 121 static LRESULT LISTVIEW_GetOrigin(HWND, LPPOINT); 125 122 static INT LISTVIEW_CalculateWidth(HWND hwnd, INT nItem); … … 135 132 static LRESULT LISTVIEW_SetItem(HWND, LPLVITEMW,BOOL); 136 133 static BOOL LISTVIEW_SetItemFocus(HWND, INT); 137 static BOOL LISTVIEW_SetItemPosition(HWND, INT, INT, INT);134 static BOOL LISTVIEW_SetItemPosition(HWND,INT,INT,INT,BOOL); 138 135 static VOID LISTVIEW_UpdateScroll(HWND); 139 136 static VOID LISTVIEW_SetSelection(HWND, INT); … … 144 141 static VOID LISTVIEW_UnsupportedStyles(LONG lStyle); 145 142 static HWND LISTVIEW_EditLabel(HWND hwnd,INT nItem,BOOL unicode); 146 static BOOL LISTVIEW_EndEditLabel(HWND hwnd,LPSTR pszText,DWORD nItem );143 static BOOL LISTVIEW_EndEditLabel(HWND hwnd,LPSTR pszText,DWORD nItem,BOOL cancel); 147 144 static LRESULT LISTVIEW_Command(HWND hwnd, WPARAM wParam, LPARAM lParam); 148 145 static LRESULT LISTVIEW_SortItems(HWND hwnd, WPARAM wParam, LPARAM lParam); … … 151 148 static LRESULT LISTVIEW_GetItemState(HWND hwnd, INT nItem, UINT uMask); 152 149 static LRESULT LISTVIEW_SetItemState(HWND hwnd,INT nItem,DWORD data,DWORD mask); 153 static BOOL LISTVIEW_SetItemPosition(HWND hwnd, INT nItem, INT nPosX, INT nPosY);154 150 static LRESULT LISTVIEW_GetStringWidth(HWND hwnd,HDC hdc,LPWSTR lpszText,BOOL unicode); 155 151 static BOOL LISTVIEW_EnsureVisible(HWND hwnd,INT nItem,BOOL bPartial); … … 162 158 if (infoPtr->internalFlags & IF_NOREDRAW) return; 163 159 164 if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) 165 { 166 RECT rect,rect2; 167 168 GetClientRect(hwnd,&rect); 169 GetWindowRect(infoPtr->hwndHeader,&rect2); 170 rect.top += rect2.bottom-rect2.top; 171 InvalidateRect(hwnd,&rect,TRUE); 172 } else InvalidateRect(hwnd,NULL,TRUE); 160 InvalidateRect(hwnd,&infoPtr->rcList,TRUE); 173 161 } 174 162 … … 190 178 if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) 191 179 { 192 RECT header;193 INT headerH;194 180 RECT rect2; 195 181 196 182 //clip header control 197 GetWindowRect(infoPtr->hwndHeader,&header); 198 headerH = rect.bottom-rect.top; 199 if (rect.bottom <= headerH) return; 200 if (rect.top < headerH) rect.top = headerH; 183 if (nItem < LISTVIEW_GetTopIndex(hwnd)) return; 184 201 185 //clip width 202 186 HEADER_GetItemRect(infoPtr->hwndHeader,(WPARAM)0,(LPARAM)&rect2); … … 207 191 } 208 192 193 static VOID LISTVIEW_RefreshItems(HWND hwnd,INT nFirst,INT nLast) 194 { 195 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 196 RECT rect; 197 198 if (infoPtr->internalFlags & IF_NOREDRAW) return; 199 200 if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) 201 { 202 INT x; 203 RECT rect; 204 205 for (x = nFirst;x < nLast;x++) 206 { 207 LISTVIEW_GetItemRect(hwnd,x,&rect,LVIR_BOUNDS); 208 InvalidateRect(hwnd,&rect,TRUE); 209 } 210 } else if (infoPtr->uView == LVS_REPORT) 211 { 212 INT nTop = LISTVIEW_GetTopIndex(hwnd),nBottom,xOffset = infoPtr->lefttop.x*infoPtr->scrollStep.x; 213 RECT rcHeader,rect; 214 215 if (nTop > nLast) return; 216 if (nTop > nFirst) nFirst = nTop; 217 218 nBottom = nTop+LISTVIEW_GetCountPerColumn(hwnd)+1; 219 nBottom = min(nTop,GETITEMCOUNT(infoPtr)); 220 221 if (nFirst > nBottom) return; 222 if (nLast > nBottom) nLast = nBottom; 223 224 Header_GetItemRect(infoPtr->hwndHeader,0,&rcHeader); 225 rcHeader.left += REPORT_MARGINX; 226 rcHeader.right = max(rcHeader.left,rcHeader.right-REPORT_MARGINX); 227 228 if (infoPtr->dwStyle & WS_HSCROLL) 229 { 230 rcHeader.left -= xOffset; 231 rcHeader.right -= xOffset; 232 } 233 234 rect.left = rcHeader.left; 235 rect.right = rcHeader.right; 236 rect.top = infoPtr->rcList.top+(nFirst-nTop)*infoPtr->nItemHeight; 237 rect.bottom = rect.top+(nLast-nFirst+1)*infoPtr->nItemHeight; 238 InvalidateRect(hwnd,&rect,TRUE); 239 } else if (infoPtr->uView == LVS_LIST) 240 { 241 INT nColumnCount = LISTVIEW_GetColumnCount(hwnd); 242 INT nCountPerColumn = LISTVIEW_GetCountPerColumn(hwnd); 243 INT nTop = LISTVIEW_GetTopIndex(hwnd); 244 INT xStart = 0,yStart = 0,xEnd,yEnd,x; 245 RECT rect; 246 247 if (nLast < nTop) return; 248 if (nFirst < nTop) 249 nFirst = nTop; 250 else 251 { 252 xStart = (nFirst-nTop)/nCountPerColumn; 253 yStart = (nFirst-nTop)%nCountPerColumn; 254 if (xStart >= nColumnCount) return; 255 } 256 xEnd = (nLast-nTop)/nCountPerColumn; 257 yEnd = (nLast-nTop)%nCountPerColumn; 258 if (xEnd >= nColumnCount) 259 { 260 xEnd = nColumnCount-1; 261 yEnd = nCountPerColumn-1; 262 } 263 264 for (x = xStart;x <= xEnd;x++) 265 { 266 if (x == xStart) 267 rect.top = yStart*infoPtr->nItemHeight; 268 else 269 rect.top = 0; 270 rect.left = x*infoPtr->nItemWidth; 271 if (x == xEnd) 272 rect.bottom = rect.top+(yEnd+1)*infoPtr->nItemHeight; 273 else 274 rect.bottom = rect.top+nCountPerColumn*infoPtr->nItemHeight; 275 rect.right = rect.left+infoPtr->nItemWidth; 276 InvalidateRect(hwnd,&rect,TRUE); 277 } 278 } 279 } 280 209 281 static VOID LISTVIEW_RefreshSubItem(HWND hwnd,INT nItem,INT nSubItem) 210 282 { … … 214 286 215 287 if (infoPtr->internalFlags & IF_NOREDRAW) return; 288 216 289 if (infoPtr->uView != LVS_REPORT) return; 290 if (nItem < LISTVIEW_GetTopIndex(hwnd)) return; 217 291 LISTVIEW_GetItemRect(hwnd,nItem,&rect,LVIR_SELECTBOUNDS); 218 292 … … 222 296 rect.right = max(column.left,column.right-REPORT_MARGINX); 223 297 224 if (!(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))225 {226 RECT header;227 INT headerH;228 229 //clip header control230 GetWindowRect(infoPtr->hwndHeader,&header);231 headerH = rect.bottom-rect.top;232 if (rect.bottom <= headerH) return;233 if (rect.top < headerH) rect.top = headerH;234 }235 236 298 /* Offset the Scroll Bar Pos */ 237 299 rect.left -= xOffset; … … 249 311 if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER)) 250 312 { 251 RECT rect ,header;313 RECT rect = infoPtr->rcList; 252 314 253 315 //clip header 254 GetClientRect(hwnd,&rect);255 GetWindowRect(infoPtr->hwndHeader,&header);256 257 316 if (yScroll < 0) 258 317 { //up 259 INT headerH = header.bottom-header.top; 260 //CB: redraw bug with _KeySelection 261 //UpdateWindow(hwnd); 262 //CB: inconsistent lefttop.y during this call 263 rect.top += headerH-yScroll; 318 rect.top -= yScroll; 264 319 if (rect.top < rect.bottom) 265 320 { 266 ScrollWindowEx(hwnd,xScroll,yScroll,&rect,NULL,0,NULL,0); 267 rect.top = rect.bottom+yScroll; 268 if (rect.top < headerH) rect.top = headerH; 269 InvalidateRect(hwnd,&rect,TRUE); 321 INT h; 322 323 ScrollWindowEx(hwnd,xScroll,yScroll,&rect,NULL,0,NULL,SW_INVALIDATE); 324 h = rect.bottom-rect.top; 325 rect.top = infoPtr->rcList.top+h; 326 rect.bottom = infoPtr->rcList.bottom-h; 327 if (rect.bottom > rect.top) InvalidateRect(hwnd,&rect,TRUE); 270 328 } else 271 329 { 272 rect.top = headerH; 273 InvalidateRect(hwnd,&rect,TRUE); 274 } 275 } else if (yScroll > 0) 330 InvalidateRect(hwnd,&infoPtr->rcList,TRUE); 331 } 332 } else 276 333 { //down 277 rect.top += header.bottom-header.top;278 ScrollWindowEx(hwnd,xScroll,yScroll,&rect,NULL,0,NULL,SW_INVALIDATE);279 }280 if (yScroll == 0)281 {282 rect.top += header.bottom-header.top;283 334 ScrollWindowEx(hwnd,xScroll,yScroll,&rect,NULL,0,NULL,SW_INVALIDATE); 284 335 } … … 362 413 INT nCountPerRow = LISTVIEW_GetCountPerRow(hwnd); 363 414 INT nNumOfItems = GETITEMCOUNT(infoPtr); 364 //CB: wrong 415 365 416 infoPtr->maxScroll.x = nNumOfItems / nCountPerColumn; 366 if ( (nNumOfItems % nCountPerColumn) == 0)367 infoPtr->maxScroll.x --;417 if (nNumOfItems % nCountPerColumn) 418 infoPtr->maxScroll.x++; 368 419 369 420 infoPtr->lefttop.x = LISTVIEW_GetTopIndex(hwnd) / nCountPerColumn; … … 525 576 } 526 577 527 LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y );578 LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y,TRUE); 528 579 ptItem.x += infoPtr->nItemWidth; 529 580 rcView.right = max(rcView.right, ptItem.x); … … 536 587 for (i = 0; i < GETITEMCOUNT(infoPtr); i++) 537 588 { 538 LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y );589 LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y,TRUE); 539 590 ptItem.y += infoPtr->nItemHeight; 540 591 } … … 581 632 } 582 633 583 LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y );634 LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y,TRUE); 584 635 ptItem.y += infoPtr->nItemHeight; 585 636 rcView.bottom = max(rcView.bottom, ptItem.y); … … 592 643 for (i = 0; i < GETITEMCOUNT(infoPtr); i++) 593 644 { 594 LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y );645 LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y,TRUE); 595 646 ptItem.x += infoPtr->nItemWidth; 596 647 } … … 690 741 { 691 742 lpSubItem = (LISTVIEW_SUBITEM *) DPA_GetPtr(hdpaSubItems, i); 692 if (lpSubItem != NULL)743 if (lpSubItem) 693 744 { 694 745 if (lpSubItem->iSubItem == nSubItem) … … 742 793 for (i = 0; i < GETITEMCOUNT(infoPtr); i++) 743 794 { 744 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, i);795 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,i,0); 745 796 nItemWidth = max(nItemWidth, nLabelWidth); 746 797 } … … 762 813 nItemWidth += WIDTH_PADDING; 763 814 764 if (infoPtr->himlSmall != NULL)815 if (infoPtr->himlSmall) 765 816 { 766 817 nItemWidth += infoPtr->iconSize.cx; 767 818 } 768 819 769 if (infoPtr->himlState != NULL)820 if (infoPtr->himlState) 770 821 { 771 822 nItemWidth += infoPtr->iconSize.cx; … … 822 873 { 823 874 /* get width of string */ 824 nItemWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);875 nItemWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,0); 825 876 826 877 /* default label size */ … … 1176 1227 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 1177 1228 RECT rcItem; 1178 INT i,nFirst = LISTVIEW_GetTopIndex(hwnd),nLast = GETITEMCOUNT(infoPtr);1179 1180 //CB: todo: first calc rect, then compare with item rect1181 // remove loop1182 1229 1183 1230 if (infoPtr->uView == LVS_REPORT) 1184 1231 { 1185 nLast = nFirst+LISTVIEW_GetCountPerColumn(hwnd)+2; 1186 nLast = min(nLast,GETITEMCOUNT(infoPtr)); 1187 } 1188 1189 for (i = nFirst;i < nLast;i++) 1190 { 1191 if (LISTVIEW_GetItemRect(hwnd,i,&rcItem,LVIR_SELECTBOUNDS) && PtInRect(&rcItem,pt)) 1192 return i; 1232 INT nTop = LISTVIEW_GetTopIndex(hwnd),nItem; 1233 1234 nItem = nTop+((pt.y-infoPtr->rcList.top)/infoPtr->nItemHeight); 1235 if (nItem >= GETITEMCOUNT(infoPtr)) return -1; 1236 1237 if (LISTVIEW_GetItemRect(hwnd,nItem,&rcItem,LVIR_SELECTBOUNDS) && PtInRect(&rcItem,pt)) 1238 return nItem; 1239 } else if (infoPtr->uView == LVS_LIST) 1240 { 1241 INT nTop = LISTVIEW_GetTopIndex(hwnd),nItem; 1242 INT nCountPerColumn = LISTVIEW_GetCountPerColumn(hwnd); 1243 1244 nItem = nTop+(pt.y/infoPtr->nItemHeight)+ 1245 ((INT)(pt.x-infoPtr->lefttop.x*infoPtr->scrollStep.x)/infoPtr->nItemWidth)*nCountPerColumn; 1246 if (nItem >= GETITEMCOUNT(infoPtr)) return -1; 1247 1248 if (LISTVIEW_GetItemRect(hwnd,nItem,&rcItem,LVIR_SELECTBOUNDS) && PtInRect(&rcItem,pt)) 1249 return nItem; 1250 } else 1251 { 1252 INT i,nFirst = LISTVIEW_GetTopIndex(hwnd),nLast = GETITEMCOUNT(infoPtr); 1253 1254 for (i = nFirst;i < nLast;i++) 1255 { 1256 if (LISTVIEW_GetItemRect(hwnd,i,&rcItem,LVIR_SELECTBOUNDS) && PtInRect(&rcItem,pt)) 1257 return i; 1258 } 1193 1259 } 1194 1260 … … 1210 1276 static VOID LISTVIEW_RemoveSelections(HWND hwnd, INT nFirst, INT nLast) 1211 1277 { 1212 INT i; 1213 1214 //CB: really slow! 1215 1216 for (i = nFirst; i <= nLast; i++) 1217 { 1218 LISTVIEW_SetItemState(hwnd,i,0,LVIS_SELECTED); 1278 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 1279 LISTVIEW_ITEM *lpItem; 1280 1281 while ((lpItem = (LISTVIEW_ITEM*)DPA_GetPtr(infoPtr->hdpaSelItems,0)) != NULL) 1282 { 1283 LISTVIEW_SetItemState(hwnd,DPA_GetPtrIndex(infoPtr->hdpaItems,lpItem),0,LVIS_SELECTED); 1219 1284 } 1220 1285 } … … 1241 1306 { 1242 1307 hdpaSubItems = (HDPA)DPA_GetPtr(hdpaItems, i); 1243 if (hdpaSubItems != NULL)1308 if (hdpaSubItems) 1244 1309 { 1245 1310 if (LISTVIEW_RemoveSubItem(hdpaSubItems, nSubItem) == FALSE) … … 1462 1527 BOOL bResult = FALSE; 1463 1528 1464 if ( (lpItem != NULL) && (lpLVItem != NULL))1529 if (lpItem && lpLVItem) 1465 1530 { 1466 1531 bResult = TRUE; … … 1498 1563 } 1499 1564 1500 if ((lpItem->pszText != NULL) && 1501 (lpItem->pszText != LPSTR_TEXTCALLBACKW)) 1565 if (lpItem->pszText && (lpItem->pszText != LPSTR_TEXTCALLBACKW)) 1502 1566 { 1503 1567 COMCTL32_Free(lpItem->pszText); … … 2044 2108 INT nDrawPosY = infoPtr->rcList.top; 2045 2109 INT nColumnCount = Header_GetItemCount(infoPtr->hwndHeader); 2046 RECT rcItem, rcClient,*rcHeader;2110 RECT rcItem,*rcHeader; 2047 2111 INT j,nItem,nLast,xOffset = infoPtr->lefttop.x*infoPtr->scrollStep.x; 2048 2112 … … 2050 2114 2051 2115 /* add 1 for displaying a partial item at the bottom */ 2052 nLast = nItem + LISTVIEW_GetCountPerColumn(hwnd) +1;2116 nLast = nItem + LISTVIEW_GetCountPerColumn(hwnd)+1; 2053 2117 nLast = min(nLast, GETITEMCOUNT(infoPtr)); 2054 2118 … … 2063 2127 sendNotify(hwnd,LVN_ODCACHEHINT,&nmlv.hdr); 2064 2128 } 2065 2066 GetClientRect(hwnd,&rcClient);2067 2129 2068 2130 //get header rects … … 2090 2152 rcItem.bottom = rcItem.top + infoPtr->nItemHeight; 2091 2153 2092 if (rcItem.top >= (updateRect ? updateRect->bottom: rcClient.bottom)) goto DR_END;2154 if (rcItem.top >= (updateRect ? updateRect->bottom:infoPtr->rcList.bottom)) goto DR_END; 2093 2155 2094 2156 if (!updateRect || IntersectRect(NULL,&rcItem,updateRect)) … … 2222 2284 INT nItemWidth = infoPtr->nItemWidth; 2223 2285 INT nItemHeight = infoPtr->nItemHeight; 2224 RECT rcClient;2225 2286 2226 2287 /* get number of fully visible columns */ … … 2229 2290 nItem = LISTVIEW_GetTopIndex(hwnd); 2230 2291 2231 GetClientRect(hwnd,&rcClient);2232 2233 2292 for (i = 0; i < nColumnCount; i++) 2234 2293 { … … 2243 2302 rcItem.right = rcItem.left + nItemWidth; 2244 2303 2245 if ( rcItem.left >= (updateRect ? updateRect->right:rcClient.right)) return;2304 if (updateRect && (rcItem.left >= updateRect->right)) return; 2246 2305 2247 2306 if (!updateRect || IntersectRect(NULL,&rcItem,updateRect)) … … 2276 2335 ptPosition.x += ptOrigin.x; 2277 2336 ptPosition.y += ptOrigin.y; 2278 //CB: wrong nItemWidth/Height! 2337 2279 2338 if (ptPosition.y + infoPtr->nItemHeight > infoPtr->rcList.top) 2280 2339 { … … 2295 2354 else 2296 2355 LISTVIEW_DrawItem(hwnd, hdc, i, rcItem); 2297 } else if (updateRect && (rcItem.top >= updateRect->bottom)) return;2356 } 2298 2357 } 2299 } else return;2358 } 2300 2359 } 2301 2360 } … … 2440 2499 } 2441 2500 2501 static VOID LISTVIEW_SnapToGrid(HWND hwnd) 2502 { 2503 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 2504 2505 if ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_ICON)) 2506 { 2507 INT gridW = infoPtr->nItemWidth,gridH = infoPtr->nItemHeight,i; 2508 2509 for (i = 0; i < GETITEMCOUNT(infoPtr);i++) 2510 { 2511 POINT point; 2512 2513 LISTVIEW_GetItemPosition(hwnd,i,&point); 2514 if ((point.x % gridW) || (point.y % gridH)) 2515 { 2516 LISTVIEW_SetItemPosition(hwnd,i,point.x-point.x%gridW,point.y-point.y%gridH,TRUE); 2517 } 2518 } 2519 } 2520 } 2521 2442 2522 /*** 2443 2523 * DESCRIPTION: … … 2455 2535 { 2456 2536 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 2457 BOOL bResult = FALSE;2458 2537 2459 2538 if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) 2460 2539 { 2540 if (nAlignCode == LVA_DEFAULT) 2541 { 2542 switch (infoPtr->dwStyle & LVS_ALIGNMASK) 2543 { 2544 case LVS_ALIGNLEFT: 2545 nAlignCode = LVA_ALIGNLEFT; 2546 break; 2547 2548 case LVS_ALIGNTOP: 2549 nAlignCode = LVA_ALIGNLEFT; 2550 break; 2551 2552 default: 2553 return FALSE; 2554 } 2555 } 2556 2461 2557 switch (nAlignCode) 2462 2558 { 2463 case LVA_ALIGNLEFT:2464 /* TO DO */2465 break;2466 case LVA_ALIGNTOP: 2467 /* TO DO */2468 break;2469 case LVA_DEFAULT:2470 /* TO DO */ 2471 break;2472 case LVA_SNAPTOGRID:2473 /* TO DO */2474 break; 2475 }2476 }2477 2478 return bResult;2479 } 2480 2481 /* << LISTVIEW_CreateDragImage >> */ 2559 case LVA_ALIGNLEFT: 2560 LISTVIEW_AlignLeft(hwnd); 2561 break; 2562 2563 case LVA_ALIGNTOP: 2564 LISTVIEW_AlignTop(hwnd); 2565 break; 2566 2567 case LVA_SNAPTOGRID: 2568 LISTVIEW_SnapToGrid(hwnd); 2569 break; 2570 2571 default: 2572 return FALSE; 2573 } 2574 } 2575 2576 return TRUE; 2577 } 2482 2578 2483 2579 /*** … … 2503 2599 INT j; 2504 2600 HDPA hdpaSubItems; 2505 2506 // TRACE("(hwnd=%x,)\n", hwnd);2507 2601 2508 2602 if (GETITEMCOUNT(infoPtr) > 0) … … 2568 2662 /* reinitialize listview memory */ 2569 2663 bResult = DPA_DeleteAllPtrs(infoPtr->hdpaItems); 2664 DPA_DeleteAllPtrs(infoPtr->hdpaSelItems); 2570 2665 2571 2666 /* align items (set position of each item) */ … … 2651 2746 INT i; 2652 2747 2653 // TRACE("(hwnd=%x,nItem=%d)\n", hwnd, nItem);2654 2655 2748 if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr))) 2656 2749 { … … 2659 2752 2660 2753 hdpaSubItems = (HDPA)DPA_DeletePtr(infoPtr->hdpaItems, nItem); 2661 if (hdpaSubItems != NULL)2754 if (hdpaSubItems) 2662 2755 { 2663 2756 for (i = 1; i < hdpaSubItems->nItemCount; i++) … … 2679 2772 2680 2773 lpItem = (LISTVIEW_ITEM *)DPA_GetPtr(hdpaSubItems, 0); 2681 if (lpItem != NULL) 2682 { 2774 if (lpItem) 2775 { 2776 //remove from selection list 2777 DPA_DeletePtr(infoPtr->hdpaSelItems,DPA_GetPtrIndex(infoPtr->hdpaSelItems,lpItem)); 2778 2683 2779 /* send LVN_DELETEITEM notification */ 2684 2780 nmlv.iItem = nItem; … … 2745 2841 { 2746 2842 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2843 2747 2844 return infoPtr->hwndEdit; 2748 2845 } … … 2763 2860 */ 2764 2861 2765 static BOOL LISTVIEW_EndEditLabel(HWND hwnd, LPSTR pszText, DWORD nItem)2862 static BOOL LISTVIEW_EndEditLabel(HWND hwnd,LPSTR pszText,DWORD nItem,BOOL cancel) 2766 2863 { 2767 2864 NMLVDISPINFOW dispInfo; … … 2774 2871 ZeroMemory(&dispInfo, sizeof(NMLVDISPINFOW)); 2775 2872 2776 if ( NULL ==(hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem)))2777 2778 2779 if ( NULL ==(lpItem = (LISTVIEW_ITEM *)DPA_GetPtr(hdpaSubItems, 0)))2780 2873 if (!(hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem))) 2874 return FALSE; 2875 2876 if (!(lpItem = (LISTVIEW_ITEM *)DPA_GetPtr(hdpaSubItems, 0))) 2877 return FALSE; 2781 2878 2782 2879 dispInfo.item.mask = 0; … … 2784 2881 dispInfo.item.state = lpItem->state; 2785 2882 dispInfo.item.stateMask = 0; 2786 if (isUnicodeNotify(&infoPtr->header)) 2787 { 2788 textW = HEAP_strdupAtoW(GetProcessHeap(),0,pszText); 2789 2790 dispInfo.item.pszText = textW; 2791 dispInfo.item.cchTextMax = textW ? lstrlenW(textW):0; 2883 if (cancel) 2884 { 2885 dispInfo.item.pszText = NULL; 2886 dispInfo.item.cchTextMax = 0; 2792 2887 } else 2793 2888 { 2794 dispInfo.item.pszText = (LPWSTR)pszText; 2795 dispInfo.item.cchTextMax = pszText ? lstrlenA(pszText):0; 2889 if (isUnicodeNotify(&infoPtr->header)) 2890 { 2891 textW = HEAP_strdupAtoW(GetProcessHeap(),0,pszText); 2892 2893 dispInfo.item.pszText = textW; 2894 dispInfo.item.cchTextMax = textW ? lstrlenW(textW):0; 2895 } else 2896 { 2897 dispInfo.item.pszText = (LPWSTR)pszText; 2898 dispInfo.item.cchTextMax = pszText ? lstrlenA(pszText):0; 2899 } 2796 2900 } 2797 2901 dispInfo.item.iImage = lpItem->iImage; … … 2802 2906 2803 2907 /* Do we need to update the Item Text */ 2804 if(bUpdateItemText) 2805 { 2806 if(lpItem->pszText != LPSTR_TEXTCALLBACKW) 2807 { 2808 if (isUnicodeNotify(&infoPtr->header)) 2809 Str_SetPtrW(&lpItem->pszText,textW); 2810 else 2811 { 2812 COMCTL32_Free(lpItem->pszText); 2813 lpItem->pszText = HEAP_strdupAtoW(GetProcessHeap(),0,pszText); 2814 } 2815 2816 } 2908 if (bUpdateItemText) 2909 { 2910 LVINTERNALITEMW lvItem; 2911 2912 //get old text 2913 ZeroMemory(&lvItem, sizeof(LVITEMW)); 2914 lvItem.header.mask = LVIF_TEXT; 2915 lvItem.header.stateMask = LVIS_SELECTED | LVIS_FOCUSED | LVIS_STATEIMAGEMASK; 2916 lvItem.header.iItem = nItem; 2917 lvItem.header.iSubItem = 0; 2918 lvItem.header.cchTextMax = DISP_TEXT_SIZE; 2919 lvItem.header.pszText = NULL; 2920 lvItem.mustFree = FALSE; 2921 LISTVIEW_GetItem(hwnd,(LPLVITEMW)&lvItem,TRUE,TRUE); 2922 2923 if ((lvItem.unicode && (lstrcmpAtoW(pszText,lvItem.header.pszText) != 0)) || (!lvItem.unicode && (lstrcmpA((LPSTR)lvItem.header.pszText,pszText) != 0))) 2924 { 2925 if (lpItem->pszText != LPSTR_TEXTCALLBACKW) 2926 { 2927 if (isUnicodeNotify(&infoPtr->header)) 2928 Str_SetPtrW(&lpItem->pszText,textW); 2929 else 2930 { 2931 COMCTL32_Free(lpItem->pszText); 2932 lpItem->pszText = HEAP_strdupAtoW(GetProcessHeap(),0,pszText); 2933 } 2934 } else 2935 { 2936 NMLVDISPINFOW lvdi; 2937 BOOL retval; 2938 2939 lvdi.item.mask = TVIF_TEXT; 2940 lvdi.item.iItem = nItem; 2941 lvdi.item.state = lpItem->state; 2942 lvdi.item.lParam = lpItem->lParam; 2943 if (isUnicodeNotify(&infoPtr->header)) 2944 { 2945 lvdi.item.pszText = textW; 2946 lvdi.item.cchTextMax = lstrlenW(textW)+1; 2947 } else 2948 { 2949 lvdi.item.pszText = (LPWSTR)pszText; 2950 lvdi.item.cchTextMax = lstrlenA(pszText)+1; 2951 } 2952 2953 retval = (BOOL)sendNotify(hwnd,isUnicodeNotify(&infoPtr->header) ? LVN_SETDISPINFOW:LVN_SETDISPINFOA,&lvdi.hdr); 2954 } 2955 } 2956 if (lvItem.mustFree) COMCTL32_Free(lvItem.header.pszText); 2817 2957 } 2818 2958 … … 2931 3071 * FAILURE : FALSE 2932 3072 */ 2933 static BOOL LISTVIEW_EnsureVisible(HWND hwnd,INT nItem,BOOL bPartial )3073 static BOOL LISTVIEW_EnsureVisible(HWND hwnd,INT nItem,BOOL bPartialOk) 2934 3074 { 2935 3075 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 2936 SCROLLINFO scrollInfo;2937 3076 INT nScrollPosHeight = 0; 2938 3077 INT nScrollPosWidth = 0; … … 2940 3079 POINT oldlefttop = infoPtr->lefttop; 2941 3080 2942 ZeroMemory(&scrollInfo,sizeof(SCROLLINFO));2943 scrollInfo.cbSize = sizeof(SCROLLINFO);2944 scrollInfo.fMask = SIF_POS;2945 2946 /* ALWAYS bPartial == FALSE, FOR NOW! */2947 2948 3081 if (LISTVIEW_GetItemRect(hwnd, nItem, &rcItem,LVIR_BOUNDS)) 2949 3082 { 3083 if (bPartialOk && IntersectRect(NULL,&rcItem,&infoPtr->rcList)) 3084 return TRUE; 3085 2950 3086 if (rcItem.left < infoPtr->rcList.left) 2951 3087 { … … 2974 3110 if (infoPtr->lefttop.x != oldlefttop.x) 2975 3111 { 3112 SCROLLINFO scrollInfo; 3113 3114 ZeroMemory(&scrollInfo,sizeof(SCROLLINFO)); 3115 scrollInfo.cbSize = sizeof(SCROLLINFO); 3116 scrollInfo.fMask = SIF_POS; 2976 3117 scrollInfo.nPos = infoPtr->lefttop.x; 2977 3118 SetScrollInfo(hwnd,SB_HORZ,&scrollInfo,TRUE); … … 3007 3148 if (infoPtr->lefttop.x != oldlefttop.x) 3008 3149 { 3150 SCROLLINFO scrollInfo; 3151 3152 ZeroMemory(&scrollInfo,sizeof(SCROLLINFO)); 3153 scrollInfo.cbSize = sizeof(SCROLLINFO); 3154 scrollInfo.fMask = SIF_POS; 3009 3155 scrollInfo.nPos = infoPtr->lefttop.x; 3010 3156 SetScrollInfo(hwnd,SB_HORZ,&scrollInfo,TRUE); … … 3037 3183 if (infoPtr->lefttop.y != oldlefttop.y) 3038 3184 { 3185 SCROLLINFO scrollInfo; 3186 3187 ZeroMemory(&scrollInfo,sizeof(SCROLLINFO)); 3188 scrollInfo.cbSize = sizeof(SCROLLINFO); 3189 scrollInfo.fMask = SIF_POS; 3039 3190 scrollInfo.nPos = infoPtr->lefttop.y; 3040 3191 SetScrollInfo(hwnd,SB_VERT,&scrollInfo,TRUE); … … 3062 3213 if (infoPtr->lefttop.y != oldlefttop.y) 3063 3214 { 3215 SCROLLINFO scrollInfo; 3216 3217 ZeroMemory(&scrollInfo,sizeof(SCROLLINFO)); 3218 scrollInfo.cbSize = sizeof(SCROLLINFO); 3219 scrollInfo.fMask = SIF_POS; 3064 3220 scrollInfo.nPos = infoPtr->lefttop.y; 3065 3221 SetScrollInfo(hwnd,SB_VERT,&scrollInfo,TRUE); … … 3153 3309 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 3154 3310 POINT ptItem; 3155 LVI TEMW lvItem;3156 BOOL bWrap = FALSE ,rc;3311 LVINTERNALITEMW lvItem; 3312 BOOL bWrap = FALSE; 3157 3313 INT nItem = nStart; 3158 3314 INT nLast = GETITEMCOUNT(infoPtr); 3159 CHAR* textA = NULL; 3160 WCHAR* textW = NULL; 3161 3162 if ((nItem >= -1) && (lpFindInfo != NULL)) 3163 { 3164 ZeroMemory(&lvItem, sizeof(LVITEMW)); 3315 3316 if ((nItem >= -1) && lpFindInfo) 3317 { 3318 ZeroMemory(&lvItem,sizeof(LVITEMW)); 3165 3319 3166 3320 if (lpFindInfo->flags & LVFI_PARAM) 3167 3321 { 3168 lvItem. mask |= LVIF_PARAM;3322 lvItem.header.mask |= LVIF_PARAM; 3169 3323 } 3170 3324 3171 3325 if (lpFindInfo->flags & LVFI_STRING) 3172 3326 { 3173 lvItem.mask |= LVIF_TEXT; 3174 if (unicode) 3175 { 3176 textW = (WCHAR*)COMCTL32_Alloc(DISP_TEXT_SIZE*sizeof(WCHAR)); 3177 lvItem.pszText = textW; 3178 } else 3179 { 3180 textA = (CHAR*)COMCTL32_Alloc(DISP_TEXT_SIZE*sizeof(CHAR)); 3181 lvItem.pszText = (LPWSTR)textA; 3182 } 3183 lvItem.cchTextMax = DISP_TEXT_SIZE; 3327 lvItem.header.mask |= LVIF_TEXT; 3328 lvItem.header.pszText = NULL; 3329 lvItem.header.cchTextMax = DISP_TEXT_SIZE; 3184 3330 } 3185 3331 3186 3332 if (lpFindInfo->flags & LVFI_PARTIAL) 3187 3333 { 3188 lvItem.mask |= LVIF_TEXT; 3189 if (unicode) 3190 { 3191 if (!textW) 3192 { 3193 textW = (WCHAR*)COMCTL32_Alloc(DISP_TEXT_SIZE*sizeof(WCHAR)); 3194 lvItem.pszText = textW; 3195 } 3196 } else 3197 { 3198 if (!textA) 3199 { 3200 textA = (CHAR*)COMCTL32_Alloc(DISP_TEXT_SIZE*sizeof(CHAR)); 3201 lvItem.pszText = (LPWSTR)textA; 3202 } 3203 } 3204 lvItem.cchTextMax = DISP_TEXT_SIZE; 3334 lvItem.header.mask |= LVIF_TEXT; 3335 lvItem.header.pszText = NULL; 3336 lvItem.header.cchTextMax = DISP_TEXT_SIZE; 3205 3337 } 3206 3338 … … 3222 3354 if (lpFindInfo->flags & LVFI_NEARESTXY) 3223 3355 { 3224 nItem = LISTVIEW_GetNearestItem(hwnd, ptItem, 3225 lpFindInfo->vkDirection); 3356 nItem = LISTVIEW_GetNearestItem(hwnd,ptItem,lpFindInfo->vkDirection); 3226 3357 if (nItem != -1) 3227 3358 { … … 3238 3369 } 3239 3370 3240 lvItem. iItem = nItem;3241 lvItem. iSubItem = 0;3242 if (unicode) 3243 LISTVIEW_GetItem(hwnd,&lvItem,TRUE,FALSE);//CB:todo3244 else3245 LISTVIEW_GetItem(hwnd,&lvItem,FALSE,FALSE);//CB:todo3246 if ( rc != FALSE)3371 lvItem.header.iItem = nItem; 3372 lvItem.header.iSubItem = 0; 3373 3374 lvItem.mustFree = FALSE; 3375 lvItem.header.pszText = NULL; 3376 lvItem.header.cchTextMax = DISP_TEXT_SIZE; 3377 if (LISTVIEW_GetItem(hwnd,(LVITEMW*)&lvItem,TRUE,TRUE)) 3247 3378 { 3248 if (lvItem. mask & LVIF_TEXT)3379 if (lvItem.header.mask & LVIF_TEXT) 3249 3380 { 3250 3381 if (lpFindInfo->flags & LVFI_PARTIAL) 3251 3382 { 3252 if ( unicode)3383 if (lstrstrAW(lvItem.header.pszText,lvItem.unicode,(LPWSTR)lpFindInfo->psz,unicode)) 3253 3384 { 3254 if ( wcswcs((const wchar_t*)lvItem.pszText,(wchar_t*)lpFindInfo->psz) == NULL)3385 if (lvItem.mustFree) COMCTL32_Free(lvItem.header.pszText); 3255 3386 continue; 3256 } else 3387 } 3388 } else 3389 { 3390 if (lstrcmpAW(lvItem.header.pszText,lvItem.unicode,(LPWSTR)lpFindInfo->psz,unicode) != 0) 3257 3391 { 3258 if ( strstr((LPSTR)lvItem.pszText,(LPSTR)lpFindInfo->psz) == NULL)3259 3392 if (lvItem.mustFree) COMCTL32_Free(lvItem.header.pszText); 3393 continue; 3260 3394 } 3261 3395 } 3262 else 3263 { 3264 if (unicode) 3265 { 3266 if (lstrcmpW(lvItem.pszText,lpFindInfo->psz) != 0) 3267 continue; 3268 3269 } else 3270 { 3271 if (lstrcmpA((LPSTR)lvItem.pszText,(LPSTR)lpFindInfo->psz) != 0) 3272 continue; 3273 } 3274 } 3396 if (lvItem.mustFree) COMCTL32_Free(lvItem.header.pszText); 3275 3397 } 3276 3398 3277 if (lvItem. mask & LVIF_PARAM)3399 if (lvItem.header.mask & LVIF_PARAM) 3278 3400 { 3279 if (lpFindInfo->lParam != lvItem. lParam)3401 if (lpFindInfo->lParam != lvItem.header.lParam) 3280 3402 continue; 3281 3403 } … … 3285 3407 } 3286 3408 3287 if (bWrap != FALSE)3409 if (bWrap) 3288 3410 { 3289 3411 nItem = -1; … … 3298 3420 } 3299 3421 3300 return -1;3422 return -1; 3301 3423 } 3302 3424 … … 3372 3494 BOOL bResult = FALSE; 3373 3495 3374 if (lpColumn != NULL)3496 if (lpColumn) 3375 3497 { 3376 3498 /* initialize memory */ 3377 ZeroMemory(&hdi, 3499 ZeroMemory(&hdi,sizeof(HDITEMW)); 3378 3500 3379 3501 if (lpColumn->mask & LVCF_FMT) … … 3408 3530 else 3409 3531 bResult = Header_GetItemA(infoPtr->hwndHeader,nItem,(HDITEMW*)&hdi); 3410 if (bResult != FALSE)3532 if (bResult) 3411 3533 { 3412 3534 if (lpColumn->mask & LVCF_FMT) … … 3489 3611 } else if (infoPtr->uView == LVS_REPORT) 3490 3612 { 3491 HDITEM Ahdi;3613 HDITEMW hdi; 3492 3614 3493 3615 /* get column width from header */ 3494 ZeroMemory(&hdi, sizeof(HDITEMA));3616 ZeroMemory(&hdi,sizeof(HDITEMW)); 3495 3617 hdi.mask = HDI_WIDTH; 3496 3618 if (Header_GetItemW(infoPtr->hwndHeader, nColumn, &hdi)) … … 3603 3725 switch (nImageList) 3604 3726 { 3605 case LVSIL_NORMAL: 3606 himl = infoPtr->himlNormal; 3607 break; 3608 case LVSIL_SMALL: 3609 himl = infoPtr->himlSmall; 3610 break; 3611 case LVSIL_STATE: 3612 himl = infoPtr->himlState; 3613 break; 3727 case LVSIL_NORMAL: 3728 himl = infoPtr->himlNormal; 3729 break; 3730 3731 case LVSIL_SMALL: 3732 himl = infoPtr->himlSmall; 3733 break; 3734 3735 case LVSIL_STATE: 3736 himl = infoPtr->himlState; 3737 break; 3614 3738 } 3615 3739 3616 3740 return (LRESULT)himl; 3617 3741 } 3618 3619 /* LISTVIEW_GetISearchString */3620 3742 3621 3743 /*** … … 4167 4289 if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr)) && lprc) 4168 4290 { 4169 if (LISTVIEW_GetItemPosition(hwnd, nItem, &ptItem) != FALSE)4291 if (LISTVIEW_GetItemPosition(hwnd, nItem, &ptItem)) 4170 4292 { 4171 4293 switch(code) … … 4239 4361 lprc->top = (ptItem.y + ptOrigin.y + infoPtr->iconSize.cy + 4240 4362 ICON_BOTTOM_PADDING + ICON_TOP_PADDING); 4241 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);4363 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,0); 4242 4364 if (infoPtr->iconSpacing.cx - nLabelWidth > 1) 4243 4365 { … … 4279 4401 } 4280 4402 4281 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);4403 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,0); 4282 4404 if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth) 4283 4405 { … … 4307 4429 } 4308 4430 4309 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);4431 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,0); 4310 4432 if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth) 4311 4433 { … … 4352 4474 if (infoPtr->himlSmall) 4353 4475 lprc->right += infoPtr->iconSize.cx; 4354 lprc->right += LISTVIEW_GetLabelWidth(hwnd, nItem);4476 lprc->right += LISTVIEW_GetLabelWidth(hwnd,nItem,0); 4355 4477 } 4356 4478 } … … 4373 4495 } 4374 4496 4375 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);4497 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,0); 4376 4498 if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth) 4377 4499 { … … 4426 4548 } 4427 4549 4428 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);4550 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,0); 4429 4551 if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth) 4430 4552 { … … 4456 4578 } 4457 4579 4458 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);4580 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd,nItem,0); 4459 4581 if (lprc->right + nLabelWidth < nLeftPos + infoPtr->nItemWidth) 4460 4582 { … … 4485 4607 * FAILURE : zero 4486 4608 */ 4487 INT LISTVIEW_GetLabelWidth(HWND hwnd, INT nItem)4609 INT LISTVIEW_GetLabelWidth(HWND hwnd,INT nItem,INT nSubItem) 4488 4610 { 4489 4611 INT nLabelWidth = 0; … … 4493 4615 lvItem.header.mask = LVIF_TEXT; 4494 4616 lvItem.header.iItem = nItem; 4617 lvItem.header.iSubItem = nSubItem; 4495 4618 lvItem.header.cchTextMax = DISP_TEXT_SIZE; 4496 4619 lvItem.header.pszText = NULL; … … 4583 4706 INT nLength = 0; 4584 4707 4585 if (lpLVItem != NULL)4708 if (lpLVItem) 4586 4709 { 4587 4710 if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr))) … … 4589 4712 lpLVItem->mask = LVIF_TEXT; 4590 4713 lpLVItem->iItem = nItem; 4591 if (LISTVIEW_GetItem(hwnd,lpLVItem,unicode,FALSE) != FALSE)4714 if (LISTVIEW_GetItem(hwnd,lpLVItem,unicode,FALSE)) 4592 4715 { 4593 4716 nLength = unicode ? lstrlenW(lpLVItem->pszText):lstrlenA((LPSTR)lpLVItem->pszText); … … 4796 4919 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 4797 4920 INT nSelectedCount = 0; 4798 INT i; 4799 4800 for (i = 0; i < GETITEMCOUNT(infoPtr); i++) 4801 { 4802 if (LISTVIEW_GetItemState(hwnd, i, LVIS_SELECTED) & LVIS_SELECTED) 4803 { 4804 nSelectedCount++; 4805 } 4806 } 4807 4808 return nSelectedCount; 4921 4922 return nSelectedCount = infoPtr->hdpaSelItems->nItemCount; 4809 4923 } 4810 4924 … … 4902 5016 } 4903 5017 5018 static BOOL LISTVIEW_InternalHitTestItem(HWND hwnd,LISTVIEW_INFO *infoPtr,INT nItem,LPLVHITTESTINFO lpHitTestInfo) 5019 { 5020 RECT rcItem; 5021 5022 if (LISTVIEW_GetItemRect(hwnd,nItem,&rcItem,LVIR_BOUNDS)) 5023 { 5024 if (PtInRect(&rcItem,lpHitTestInfo->pt)) 5025 { 5026 if (LISTVIEW_GetItemRect(hwnd,nItem,&rcItem,LVIR_ICON) && PtInRect(&rcItem,lpHitTestInfo->pt)) 5027 { 5028 lpHitTestInfo->flags = LVHT_ONITEMICON; 5029 lpHitTestInfo->iItem = nItem; 5030 lpHitTestInfo->iSubItem = 0; 5031 return TRUE; 5032 } 5033 5034 if (LISTVIEW_GetItemRect(hwnd,nItem,&rcItem,LVIR_LABEL) && PtInRect(&rcItem,lpHitTestInfo->pt)) 5035 { 5036 lpHitTestInfo->flags = LVHT_ONITEMLABEL; 5037 lpHitTestInfo->iItem = nItem; 5038 lpHitTestInfo->iSubItem = 0; 5039 return TRUE; 5040 } 5041 5042 lpHitTestInfo->flags = LVHT_ONITEMSTATEICON; 5043 lpHitTestInfo->iItem = nItem; 5044 lpHitTestInfo->iSubItem = 0; 5045 return TRUE; 5046 } 5047 } 5048 5049 return FALSE; 5050 } 5051 4904 5052 /*** 4905 5053 * DESCRIPTION: … … 4918 5066 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 4919 5067 RECT rcItem; 4920 INT i; 4921 4922 //CB: very slow! 4923 for (i = 0; i < GETITEMCOUNT(infoPtr); i++) 4924 { 4925 if (LISTVIEW_GetItemRect(hwnd, i, &rcItem,LVIR_BOUNDS)) 4926 { 4927 if (PtInRect(&rcItem, lpHitTestInfo->pt)) 4928 { 4929 if (LISTVIEW_GetItemRect(hwnd, i, &rcItem,LVIR_ICON)) 4930 { 4931 if (PtInRect(&rcItem, lpHitTestInfo->pt)) 4932 { 4933 lpHitTestInfo->flags = LVHT_ONITEMICON; 4934 lpHitTestInfo->iItem = i; 4935 lpHitTestInfo->iSubItem = 0; 4936 return i; 4937 } 4938 } 4939 4940 if (LISTVIEW_GetItemRect(hwnd, i, &rcItem,LVIR_LABEL)) 4941 { 4942 if (PtInRect(&rcItem, lpHitTestInfo->pt)) 4943 { 4944 lpHitTestInfo->flags = LVHT_ONITEMLABEL; 4945 lpHitTestInfo->iItem = i; 4946 lpHitTestInfo->iSubItem = 0; 4947 return i; 4948 } 4949 } 4950 4951 lpHitTestInfo->flags = LVHT_ONITEMSTATEICON; 4952 lpHitTestInfo->iItem = i; 4953 lpHitTestInfo->iSubItem = 0; 5068 5069 if (!lpHitTestInfo) return -1; 5070 5071 if (infoPtr->uView == LVS_REPORT) 5072 { 5073 INT nTop = LISTVIEW_GetTopIndex(hwnd),nItem; 5074 5075 nItem = nTop+((lpHitTestInfo->pt.y-infoPtr->rcList.top)/infoPtr->nItemHeight); 5076 if (nItem >= GETITEMCOUNT(infoPtr)) return -1; 5077 5078 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,nItem,lpHitTestInfo)) 5079 return nItem; 5080 } else if (infoPtr->uView == LVS_LIST) 5081 { 5082 INT nTop = LISTVIEW_GetTopIndex(hwnd),nItem; 5083 INT nCountPerColumn = LISTVIEW_GetCountPerColumn(hwnd); 5084 5085 nItem = nTop+(lpHitTestInfo->pt.y/infoPtr->nItemHeight)+ 5086 ((INT)(lpHitTestInfo->pt.x-infoPtr->lefttop.x*infoPtr->scrollStep.x)/infoPtr->nItemWidth)*nCountPerColumn; 5087 if (nItem >= GETITEMCOUNT(infoPtr)) return -1; 5088 5089 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,nItem,lpHitTestInfo)) 5090 return nItem; 5091 } else 5092 { 5093 INT i; 5094 5095 for (i = 0; i < GETITEMCOUNT(infoPtr); i++) 5096 { 5097 if (LISTVIEW_InternalHitTestItem(hwnd,infoPtr,i,lpHitTestInfo)) 4954 5098 return i; 4955 }4956 5099 } 4957 5100 } … … 5052 5195 { 5053 5196 hdi.fmt |= HDF_BITMAP_ON_RIGHT; 5054 /* ??? */5055 5197 } 5056 5198 5057 5199 if (lpColumn->fmt & LVCFMT_COL_HAS_IMAGES) 5058 5200 { 5059 /* ??? */5201 hdi.fmt |= HDF_IMAGE; 5060 5202 } 5061 5203 … … 5092 5234 hdi.iOrder = lpColumn->iOrder; 5093 5235 } 5094 //CB: todo: use macros 5236 5095 5237 /* insert item in header control */ 5096 5238 if (unicode) … … 5271 5413 { 5272 5414 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 5273 BOOL bResult = FALSE;5274 5415 5275 5416 if (nFirst <= nLast) … … 5279 5420 if ((nLast >= 0) && (nLast < GETITEMCOUNT(infoPtr))) 5280 5421 { 5281 /* bResult = */ 5282 LISTVIEW_Refresh(hwnd); 5283 } 5284 } 5285 } 5286 5287 return bResult; 5288 } 5289 5290 /* LISTVIEW_Scroll */ 5422 if ((nFirst == 0) && (nLast == GETITEMCOUNT(infoPtr))) 5423 { 5424 InvalidateRect(hwnd,NULL,TRUE); 5425 5426 return TRUE; 5427 } 5428 5429 if (nFirst == nLast) 5430 LISTVIEW_RefreshItem(hwnd,nFirst,TRUE); 5431 else 5432 LISTVIEW_RefreshItems(hwnd,nFirst,nLast); 5433 5434 return TRUE; 5435 } 5436 } 5437 } 5438 5439 return FALSE; 5440 } 5441 5442 static LRESULT LISTVIEW_Scroll(HWND hwnd,WPARAM wParam,LPARAM lParam) 5443 { 5444 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 5445 INT dx = (INT)wParam,dy = (INT)lParam,maxX,maxY; 5446 POINT oldlefttop = infoPtr->lefttop; 5447 5448 //x units: (icon, report -> pixels; list -> columns) 5449 if (infoPtr->uView != LVS_LIST) 5450 { 5451 dx /= infoPtr->scrollStep.x; 5452 } 5453 5454 //y units: (icon, list -> pixels; report -> lines) 5455 if (infoPtr->uView == LVS_LIST) 5456 { 5457 //no vertical scrolling (so far) 5458 dy = 0; 5459 } else if ((infoPtr->uView == LVS_ICON) || (infoPtr->uView == LVS_SMALLICON)) 5460 { 5461 dy /= infoPtr->scrollStep.y; 5462 } 5463 5464 infoPtr->lefttop.x += dx; 5465 infoPtr->lefttop.y += dy; 5466 maxX = infoPtr->maxScroll.x-infoPtr->scrollPage.x; 5467 maxY = infoPtr->maxScroll.y-infoPtr->scrollPage.y; 5468 5469 if (infoPtr->lefttop.x > maxX) 5470 infoPtr->lefttop.x = maxX; 5471 5472 if (infoPtr->lefttop.x < 0) 5473 infoPtr->lefttop.x = 0; 5474 5475 if (infoPtr->lefttop.y > maxY) 5476 infoPtr->lefttop.y = maxY; 5477 5478 if (infoPtr->lefttop.y < 0) 5479 infoPtr->lefttop.y = 0; 5480 5481 if ((oldlefttop.x != infoPtr->lefttop.x) || (oldlefttop.y != infoPtr->lefttop.y)) 5482 { 5483 SCROLLINFO scrollInfo; 5484 RECT rect; 5485 INT xScroll = (oldlefttop.x-infoPtr->lefttop.x)*infoPtr->scrollStep.x; 5486 INT yScroll = (oldlefttop.y-infoPtr->lefttop.y)*infoPtr->scrollStep.y; 5487 5488 if (xScroll != 0) 5489 { 5490 ZeroMemory(&scrollInfo, sizeof(SCROLLINFO)); 5491 scrollInfo.cbSize = sizeof(SCROLLINFO); 5492 scrollInfo.nPos = infoPtr->lefttop.x; 5493 scrollInfo.fMask = SIF_POS; 5494 SetScrollInfo(hwnd,SB_HORZ,&scrollInfo,TRUE); 5495 } 5496 5497 if (yScroll != 0) 5498 { 5499 ZeroMemory(&scrollInfo, sizeof(SCROLLINFO)); 5500 scrollInfo.cbSize = sizeof(SCROLLINFO); 5501 scrollInfo.nPos = infoPtr->lefttop.y; 5502 scrollInfo.fMask = SIF_POS; 5503 SetScrollInfo(hwnd,SB_VERT,&scrollInfo,TRUE); 5504 } 5505 5506 LISTVIEW_ScrollWindow(hwnd,xScroll,yScroll); 5507 5508 return TRUE; 5509 } 5510 5511 return FALSE; 5512 } 5291 5513 5292 5514 /*** … … 5495 5717 // make sure we can get the listview info 5496 5718 if (!infoPtr) 5497 5719 return (FALSE); 5498 5720 5499 5721 // set column width only if in report mode 5500 5722 if (infoPtr->uView != LVS_REPORT) 5501 5723 return (FALSE); 5502 5724 5503 5725 if (!infoPtr->hwndHeader) // make sure we have a header 5504 5726 return (FALSE); 5505 5727 5506 5728 if (cx == LVSCW_AUTOSIZE_USEHEADER) … … 5509 5731 } else if (cx == LVSCW_AUTOSIZE) 5510 5732 { 5733 INT nItemWidth,i; 5734 5511 5735 cx = HEADER_GetExpandedColumnTextWidth(infoPtr->hwndHeader,iCol); 5512 5736 5513 //CB: todo 5737 for (i = 0;i < GETITEMCOUNT(infoPtr);i++) 5738 { 5739 nItemWidth = LISTVIEW_GetLabelWidth(hwnd,i,iCol)+2*REPORT_MARGINX; 5740 if (nItemWidth > cx) cx = nItemWidth; 5741 } 5514 5742 } 5515 5743 … … 5647 5875 HDPA hdpaSubItems; 5648 5876 NMLISTVIEW nmlv; 5649 //CB: LVS_REPORT (and other) and new text: invalidate if item rect > nItemWidth 5650 if (lpLVItem != NULL)5877 5878 if (lpLVItem) 5651 5879 { 5652 5880 if ((lpLVItem->iItem >= 0) && (lpLVItem->iItem < GETITEMCOUNT(infoPtr))) … … 5682 5910 5683 5911 /* copy information */ 5912 if (uChanged & LVIF_STATE) 5913 { 5914 if ((nmlv.uNewState & LVIS_SELECTED) != (nmlv.uOldState & LVIS_SELECTED)) 5915 { 5916 if (nmlv.uOldState & LVIS_SELECTED) 5917 DPA_DeletePtr(infoPtr->hdpaSelItems,DPA_GetPtrIndex(infoPtr->hdpaSelItems,lpItem)); 5918 else 5919 DPA_InsertPtr(infoPtr->hdpaSelItems,0,lpItem); 5920 } 5921 } 5684 5922 bResult = LISTVIEW_InitItem(hwnd, lpItem, lpLVItem,unicode); 5685 5923 5686 5924 /* send LVN_ITEMCHANGED notification */ 5687 5925 sendNotify(hwnd,LVN_ITEMCHANGED,&nmlv.hdr); 5926 5927 if ((uChanged & LVIF_TEXT) && ((infoPtr->uView == LVS_SMALLICON) || (infoPtr->uView == LVS_LIST))) 5928 { 5929 INT nItemWidth = LISTVIEW_CalculateWidth(hwnd,lpLVItem->iItem); 5930 5931 if (nItemWidth > infoPtr->nItemWidth) 5932 { 5933 infoPtr->nItemWidth = nItemWidth; 5934 LISTVIEW_Refresh(hwnd); 5935 5936 return bResult; 5937 } 5938 } 5688 5939 5689 5940 LISTVIEW_RefreshItem(hwnd,lpLVItem->iItem,TRUE); … … 5735 5986 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 5736 5987 5737 // FIXME("(%d %08lx)empty stub!\n", nItems, dwFlags);5738 5988 5739 5989 if (nItems == 0) … … 5742 5992 if (infoPtr->dwStyle & LVS_OWNERDATA) 5743 5993 { 5744 // FIXME("LVS_OWNERDATA is set!\n"); 5745 } 5746 else 5747 { 5748 if (nItems > GETITEMCOUNT(infoPtr)) 5749 { 5750 /* append items */ 5751 // FIXME("append items\n"); 5752 5753 } 5754 else if (nItems < GETITEMCOUNT(infoPtr)) 5755 { 5756 /* remove items */ 5757 // FIXME("remove items\n"); 5758 5759 } 5994 //FIXME("LVS_OWNERDATA is set!\n"); 5995 } else 5996 { 5997 if (nItems > GETITEMCOUNT(infoPtr)) 5998 { 5999 /* append items */ 6000 6001 //CB: todo: what does the Windows version? 6002 } else if (nItems < GETITEMCOUNT(infoPtr)) 6003 { 6004 /* remove items */ 6005 6006 //CB: todo: what does the Windows version? 6007 } 5760 6008 } 5761 6009 … … 5777 6025 * FAILURE : FALSE 5778 6026 */ 5779 static BOOL LISTVIEW_SetItemPosition(HWND hwnd, INT nItem, INT nPosX, INT nPosY)6027 static BOOL LISTVIEW_SetItemPosition(HWND hwnd,INT nItem,INT nPosX,INT nPosY,BOOL ignoreAutoArrange) 5780 6028 { 5781 6029 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); … … 5789 6037 { 5790 6038 hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem); 5791 if (hdpaSubItems != NULL)6039 if (hdpaSubItems) 5792 6040 { 5793 6041 lpItem = (LISTVIEW_ITEM *)DPA_GetPtr(hdpaSubItems, 0); 5794 if (lpItem != NULL)6042 if (lpItem) 5795 6043 { 5796 6044 bResult = TRUE; 5797 lpItem->ptPosition.x = nPosX; 5798 lpItem->ptPosition.y = nPosY; 6045 6046 if ((lpItem->ptPosition.x == nPosX) && (lpItem->ptPosition.y == nPosY)) 6047 return bResult; 6048 6049 if (infoPtr->dwStyle & LVS_AUTOARRANGE) 6050 { 6051 lpItem->ptPosition.x = nPosX; 6052 lpItem->ptPosition.y = nPosY; 6053 6054 if (!ignoreAutoArrange) LISTVIEW_Arrange(hwnd,LVA_DEFAULT); 6055 } else 6056 { 6057 POINT point; 6058 RECT rect1,rect2; 6059 6060 LISTVIEW_GetItemRect(hwnd,nItem,&rect1,LVIR_BOUNDS); 6061 lpItem->ptPosition.x = nPosX; 6062 lpItem->ptPosition.y = nPosY; 6063 LISTVIEW_GetItemRect(hwnd,nItem,&rect2,LVIR_BOUNDS); 6064 InvalidateRect(hwnd,&rect1,TRUE); 6065 InvalidateRect(hwnd,&rect2,TRUE); 6066 } 5799 6067 } 5800 6068 } … … 5805 6073 } 5806 6074 5807 /* LISTVIEW_SetItemPosition32 */ 6075 static BOOL LISTVIEW_SetItemPosition32(HWND hwnd,INT nItem,LPPOINT lpptNewPos) 6076 { 6077 if (!lpptNewPos) return FALSE; 6078 6079 return LISTVIEW_SetItemPosition(hwnd,nItem,lpptNewPos->x,lpptNewPos->y,FALSE); 6080 } 5808 6081 5809 6082 //replaces ListView_SetItemState macro … … 6244 6517 RECT rc; 6245 6518 HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk); 6519 6246 6520 GetClientRect(hwnd, &rc); 6247 6521 FillRect((HDC)wParam, &rc, hBrush); … … 6323 6597 case SB_THUMBTRACK: 6324 6598 infoPtr->lefttop.y = nCurrentPos; 6599 6325 6600 if (infoPtr->lefttop.y > maxY) 6326 6601 infoPtr->lefttop.y = maxY; … … 6335 6610 SCROLLINFO scrollInfo; 6336 6611 RECT rect; 6337 INT yScroll = (oldY-infoPtr->lefttop.y)*infoPtr-> nItemHeight;6612 INT yScroll = (oldY-infoPtr->lefttop.y)*infoPtr->scrollStep.y; 6338 6613 6339 6614 ZeroMemory(&scrollInfo, sizeof(SCROLLINFO)); … … 6431 6706 } 6432 6707 6433 static LRESULT LISTVIEW_MouseWheel(HWND hwnd, INT wheelDelta)6708 static LRESULT LISTVIEW_MouseWheel(HWND hwnd,WPARAM wParam,LPARAM lParam) 6434 6709 { 6435 6710 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd); 6436 6711 INT gcWheelDelta = 0; 6437 6712 UINT pulScrollLines = 3; 6713 INT wheelDelta = (short int)HIWORD(wParam); 6714 6715 if (wParam & (MK_SHIFT | MK_CONTROL)) 6716 return DefWindowProcA(hwnd,WM_MOUSEWHEEL,wParam,lParam); 6717 6438 6718 6439 6719 SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0); … … 6633 6913 if ( timeSinceLastKeyPress - infoPtr->timeSinceLastKeyPress < KEY_DELAY ) 6634 6914 { /* append new character to search string */ 6635 strcat( infoPtr->szSearchParam, szCharCode );6915 lstrcatA( infoPtr->szSearchParam, szCharCode ); 6636 6916 infoPtr->nSearchParamLength++; 6637 6917 … … 6664 6944 } 6665 6945 } 6666 strcpy( infoPtr->szSearchParam, szCharCode );6946 lstrcpyA( infoPtr->szSearchParam, szCharCode ); 6667 6947 infoPtr->nSearchParamLength = 1; 6668 6948 } 6669 6949 else 6670 6950 { /* Save szCharCode for use in later searches */ 6671 strcpy( infoPtr->szSearchParam, szCharCode );6951 lstrcpyA( infoPtr->szSearchParam, szCharCode ); 6672 6952 infoPtr->nSearchParamLength = 1; 6673 6953 … … 6731 7011 } 6732 7012 } 6733 strcpy( infoPtr->szSearchParam, szCharCode );7013 lstrcpyA( infoPtr->szSearchParam, szCharCode ); 6734 7014 infoPtr->nSearchParamLength = 1; 6735 7015 } … … 6747 7027 } 6748 7028 } 6749 strcpy( infoPtr->szSearchParam, szCharCode );7029 lstrcpyA( infoPtr->szSearchParam, szCharCode ); 6750 7030 infoPtr->nSearchParamLength = 1; 6751 7031 } … … 6753 7033 { 6754 7034 /* append new character to search string */ 6755 strcat( infoPtr->szSearchParam, szCharCode );7035 lstrcatA( infoPtr->szSearchParam, szCharCode ); 6756 7036 infoPtr->nSearchParamLength++; 6757 7037 … … 7574 7854 } 7575 7855 7576 if (GetTextExtentPoint32A(hdc, buffer, strlen(buffer), &sz))7856 if (GetTextExtentPoint32A(hdc, buffer, lstrlenA(buffer), &sz)) 7577 7857 { 7578 7858 TEXTMETRICA textMetric; … … 7678 7958 /* eg. Using a messagebox */ 7679 7959 bIgnoreKillFocus = TRUE; 7680 einfo->EditLblCb(GetParent(hwnd), buffer, einfo->param);7960 einfo->EditLblCb(GetParent(hwnd),buffer,einfo->param,cancel); 7681 7961 7682 7962 if (buffer) … … 7723 8003 7724 8004 /*Get String Lenght in pixels */ 7725 GetTextExtentPoint32A(hdc, text, strlen(text), &sz);8005 GetTextExtentPoint32A(hdc, text, lstrlenA(text), &sz); 7726 8006 7727 8007 /*Add Extra spacing for the next character */ … … 7752 8032 } 7753 8033 8034 static LRESULT LISTVIEW_CreateDragImage(HWND hwnd,WPARAM wParam,LPARAM lParam) 8035 { 8036 //CB: todo 8037 8038 return 0; 8039 } 8040 8041 static LRESULT LISTVIEW_GetISearchString(HWND hwnd,WPARAM wParam,LPARAM lParam,BOOL unicode) 8042 { 8043 //CB: todo 8044 8045 return 0; 8046 } 8047 7754 8048 /*** 7755 8049 * DESCRIPTION: … … 7762 8056 switch (uMsg) 7763 8057 { 7764 case LVM_APPROXIMATEVIEWRECT: 7765 return LISTVIEW_ApproximateViewRect(hwnd, (INT)wParam, 7766 LOWORD(lParam), HIWORD(lParam)); 7767 case LVM_ARRANGE: 7768 return LISTVIEW_Arrange(hwnd, (INT)wParam); 7769 7770 /* case LVM_CREATEDRAGIMAGE: */ 7771 7772 case LVM_DELETEALLITEMS: 7773 return LISTVIEW_DeleteAllItems(hwnd); 7774 7775 case LVM_DELETECOLUMN: 7776 return LISTVIEW_DeleteColumn(hwnd, (INT)wParam); 7777 7778 case LVM_DELETEITEM: 7779 return LISTVIEW_DeleteItem(hwnd, (INT)wParam); 7780 7781 case LVM_EDITLABELA: 7782 return LISTVIEW_EditLabel(hwnd,(INT)wParam,FALSE); 7783 7784 case LVM_EDITLABELW: 7785 return LISTVIEW_EditLabel(hwnd,(INT)wParam,TRUE); 7786 7787 case LVM_ENSUREVISIBLE: 7788 return LISTVIEW_EnsureVisible(hwnd,(INT)wParam,(BOOL)lParam); 7789 7790 case LVM_FINDITEMA: 7791 return LISTVIEW_FindItem(hwnd,(INT)wParam,(LPLVFINDINFOW)lParam,FALSE); 7792 7793 case LVM_FINDITEMW: 7794 return LISTVIEW_FindItem(hwnd,(INT)wParam,(LPLVFINDINFOW)lParam,TRUE); 7795 7796 case LVM_GETBKCOLOR: 7797 return LISTVIEW_GetBkColor(hwnd); 8058 case LVM_APPROXIMATEVIEWRECT: 8059 return LISTVIEW_ApproximateViewRect(hwnd,(INT)wParam,LOWORD(lParam),HIWORD(lParam)); 8060 8061 case LVM_ARRANGE: 8062 return LISTVIEW_Arrange(hwnd, (INT)wParam); 8063 8064 8065 case LVM_CREATEDRAGIMAGE: 8066 return LISTVIEW_CreateDragImage(hwnd,wParam,lParam); 8067 8068 case LVM_DELETEALLITEMS: 8069 return LISTVIEW_DeleteAllItems(hwnd); 8070 8071 case LVM_DELETECOLUMN: 8072 return LISTVIEW_DeleteColumn(hwnd, (INT)wParam); 8073 8074 case LVM_DELETEITEM: 8075 return LISTVIEW_DeleteItem(hwnd, (INT)wParam); 8076 8077 case LVM_EDITLABELA: 8078 return LISTVIEW_EditLabel(hwnd,(INT)wParam,FALSE); 8079 8080 case LVM_EDITLABELW: 8081 return LISTVIEW_EditLabel(hwnd,(INT)wParam,TRUE); 8082 8083 case LVM_ENSUREVISIBLE: 8084 return LISTVIEW_EnsureVisible(hwnd,(INT)wParam,(BOOL)lParam); 8085 8086 case LVM_FINDITEMA: 8087 return LISTVIEW_FindItem(hwnd,(INT)wParam,(LPLVFINDINFOW)lParam,FALSE); 8088 8089 case LVM_FINDITEMW: 8090 return LISTVIEW_FindItem(hwnd,(INT)wParam,(LPLVFINDINFOW)lParam,TRUE); 8091 8092 case LVM_GETBKCOLOR: 8093 return LISTVIEW_GetBkColor(hwnd); 7798 8094 7799 8095 /* case LVM_GETBKIMAGE: */ 7800 8096 7801 case LVM_GETCALLBACKMASK:7802 return LISTVIEW_GetCallbackMask(hwnd);7803 7804 case LVM_GETCOLUMNA:7805 return LISTVIEW_GetColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,FALSE);7806 7807 case LVM_GETCOLUMNW:7808 return LISTVIEW_GetColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,TRUE);7809 7810 case LVM_GETCOLUMNORDERARRAY:7811 return LISTVIEW_GetColumnOrderArray(hwnd, (INT)wParam, (LPINT)lParam);7812 7813 case LVM_GETCOLUMNWIDTH:7814 return LISTVIEW_GetColumnWidth(hwnd, (INT)wParam);7815 7816 case LVM_GETCOUNTPERPAGE:7817 return LISTVIEW_GetCountPerPage(hwnd);7818 7819 case LVM_GETEDITCONTROL:7820 return LISTVIEW_GetEditControl(hwnd);7821 7822 case LVM_GETEXTENDEDLISTVIEWSTYLE:7823 return LISTVIEW_GetExtendedListViewStyle(hwnd);7824 7825 case LVM_GETHEADER:7826 return LISTVIEW_GetHeader(hwnd);8097 case LVM_GETCALLBACKMASK: 8098 return LISTVIEW_GetCallbackMask(hwnd); 8099 8100 case LVM_GETCOLUMNA: 8101 return LISTVIEW_GetColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,FALSE); 8102 8103 case LVM_GETCOLUMNW: 8104 return LISTVIEW_GetColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,TRUE); 8105 8106 case LVM_GETCOLUMNORDERARRAY: 8107 return LISTVIEW_GetColumnOrderArray(hwnd, (INT)wParam, (LPINT)lParam); 8108 8109 case LVM_GETCOLUMNWIDTH: 8110 return LISTVIEW_GetColumnWidth(hwnd, (INT)wParam); 8111 8112 case LVM_GETCOUNTPERPAGE: 8113 return LISTVIEW_GetCountPerPage(hwnd); 8114 8115 case LVM_GETEDITCONTROL: 8116 return LISTVIEW_GetEditControl(hwnd); 8117 8118 case LVM_GETEXTENDEDLISTVIEWSTYLE: 8119 return LISTVIEW_GetExtendedListViewStyle(hwnd); 8120 8121 case LVM_GETHEADER: 8122 return LISTVIEW_GetHeader(hwnd); 7827 8123 7828 8124 /* case LVM_GETHOTCURSOR: */ 7829 8125 7830 case LVM_GETHOTITEM:7831 return LISTVIEW_GetHotItem(hwnd);8126 case LVM_GETHOTITEM: 8127 return LISTVIEW_GetHotItem(hwnd); 7832 8128 7833 8129 /* case LVM_GETHOVERTIME: */ 7834 8130 7835 case LVM_GETIMAGELIST: 7836 return LISTVIEW_GetImageList(hwnd, (INT)wParam); 7837 7838 /* case LVM_GETISEARCHSTRING: */ 7839 7840 case LVM_GETITEMA: 7841 return LISTVIEW_GetItem(hwnd,(LPLVITEMW)lParam,FALSE,FALSE); 7842 7843 case LVM_GETITEMW: 7844 return LISTVIEW_GetItem(hwnd,(LPLVITEMW)lParam,TRUE,FALSE); 7845 7846 case LVM_GETITEMCOUNT: 7847 return LISTVIEW_GetItemCount(hwnd); 7848 7849 case LVM_GETITEMPOSITION: 7850 return LISTVIEW_GetItemPosition(hwnd, (INT)wParam, (LPPOINT)lParam); 7851 7852 case LVM_GETITEMRECT: 7853 return LISTVIEW_GetItemRect(hwnd,(INT)wParam,(LPRECT)lParam,lParam ? ((LPRECT)lParam)->left:0); 7854 7855 case LVM_GETITEMSPACING: 7856 return LISTVIEW_GetItemSpacing(hwnd, (BOOL)wParam); 7857 7858 case LVM_GETITEMSTATE: 7859 return LISTVIEW_GetItemState(hwnd, (INT)wParam, (UINT)lParam); 7860 7861 case LVM_GETITEMTEXTA: 7862 LISTVIEW_GetItemText(hwnd,(INT)wParam,(LPLVITEMW)lParam,FALSE); 7863 break; 7864 7865 case LVM_GETITEMTEXTW: 7866 LISTVIEW_GetItemText(hwnd,(INT)wParam,(LPLVITEMW)lParam,TRUE); 7867 break; 7868 7869 case LVM_GETNEXTITEM: 7870 return LISTVIEW_GetNextItem(hwnd, (INT)wParam, LOWORD(lParam)); 8131 case LVM_GETIMAGELIST: 8132 return LISTVIEW_GetImageList(hwnd, (INT)wParam); 8133 8134 case LVM_GETISEARCHSTRINGA: 8135 return LISTVIEW_GetISearchString(hwnd,wParam,lParam,FALSE); 8136 8137 case LVM_GETISEARCHSTRINGW: 8138 return LISTVIEW_GetISearchString(hwnd,wParam,lParam,TRUE); 8139 8140 case LVM_GETITEMA: 8141 return LISTVIEW_GetItem(hwnd,(LPLVITEMW)lParam,FALSE,FALSE); 8142 8143 case LVM_GETITEMW: 8144 return LISTVIEW_GetItem(hwnd,(LPLVITEMW)lParam,TRUE,FALSE); 8145 8146 case LVM_GETITEMCOUNT: 8147 return LISTVIEW_GetItemCount(hwnd); 8148 8149 case LVM_GETITEMPOSITION: 8150 return LISTVIEW_GetItemPosition(hwnd, (INT)wParam, (LPPOINT)lParam); 8151 8152 case LVM_GETITEMRECT: 8153 return LISTVIEW_GetItemRect(hwnd,(INT)wParam,(LPRECT)lParam,lParam ? ((LPRECT)lParam)->left:0); 8154 8155 case LVM_GETITEMSPACING: 8156 return LISTVIEW_GetItemSpacing(hwnd, (BOOL)wParam); 8157 8158 case LVM_GETITEMSTATE: 8159 return LISTVIEW_GetItemState(hwnd, (INT)wParam, (UINT)lParam); 8160 8161 case LVM_GETITEMTEXTA: 8162 return LISTVIEW_GetItemText(hwnd,(INT)wParam,(LPLVITEMW)lParam,FALSE); 8163 8164 case LVM_GETITEMTEXTW: 8165 return LISTVIEW_GetItemText(hwnd,(INT)wParam,(LPLVITEMW)lParam,TRUE); 8166 8167 case LVM_GETNEXTITEM: 8168 return LISTVIEW_GetNextItem(hwnd, (INT)wParam, LOWORD(lParam)); 7871 8169 7872 8170 /* case LVM_GETNUMBEROFWORKAREAS: */ 7873 8171 7874 case LVM_GETORIGIN:7875 return LISTVIEW_GetOrigin(hwnd, (LPPOINT)lParam);7876 7877 case LVM_GETSELECTEDCOUNT:7878 return LISTVIEW_GetSelectedCount(hwnd);7879 7880 case LVM_GETSELECTIONMARK:7881 return LISTVIEW_GetSelectionMark(hwnd);7882 7883 case LVM_GETSTRINGWIDTHA:7884 return LISTVIEW_GetStringWidth(hwnd,0,(LPWSTR)lParam,FALSE);7885 7886 case LVM_GETSTRINGWIDTHW:7887 return LISTVIEW_GetStringWidth(hwnd,0,(LPWSTR)lParam,TRUE);8172 case LVM_GETORIGIN: 8173 return LISTVIEW_GetOrigin(hwnd, (LPPOINT)lParam); 8174 8175 case LVM_GETSELECTEDCOUNT: 8176 return LISTVIEW_GetSelectedCount(hwnd); 8177 8178 case LVM_GETSELECTIONMARK: 8179 return LISTVIEW_GetSelectionMark(hwnd); 8180 8181 case LVM_GETSTRINGWIDTHA: 8182 return LISTVIEW_GetStringWidth(hwnd,0,(LPWSTR)lParam,FALSE); 8183 8184 case LVM_GETSTRINGWIDTHW: 8185 return LISTVIEW_GetStringWidth(hwnd,0,(LPWSTR)lParam,TRUE); 7888 8186 7889 8187 /* case LVM_GETSUBITEMRECT: */ 7890 8188 7891 case LVM_GETTEXTBKCOLOR:7892 return LISTVIEW_GetTextBkColor(hwnd);7893 7894 case LVM_GETTEXTCOLOR:7895 return LISTVIEW_GetTextColor(hwnd);8189 case LVM_GETTEXTBKCOLOR: 8190 return LISTVIEW_GetTextBkColor(hwnd); 8191 8192 case LVM_GETTEXTCOLOR: 8193 return LISTVIEW_GetTextColor(hwnd); 7896 8194 7897 8195 /* case LVM_GETTOOLTIPS: */ 7898 8196 7899 case LVM_GETTOPINDEX:7900 return LISTVIEW_GetTopIndex(hwnd);7901 7902 case LVM_GETVIEWRECT:7903 return LISTVIEW_GetViewRect(hwnd, (LPRECT)lParam);8197 case LVM_GETTOPINDEX: 8198 return LISTVIEW_GetTopIndex(hwnd); 8199 8200 case LVM_GETVIEWRECT: 8201 return LISTVIEW_GetViewRect(hwnd, (LPRECT)lParam); 7904 8202 7905 8203 /* case LVM_GETWORKAREAS: */ 7906 8204 7907 case LVM_HITTEST:7908 return LISTVIEW_HitTest(hwnd, (LPLVHITTESTINFO)lParam);7909 7910 case LVM_INSERTCOLUMNA:7911 return LISTVIEW_InsertColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,FALSE);7912 7913 case LVM_INSERTCOLUMNW:7914 return LISTVIEW_InsertColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,TRUE);7915 7916 case LVM_INSERTITEMA:7917 return LISTVIEW_InsertItem(hwnd,(LPLVITEMW)lParam,FALSE);7918 7919 case LVM_INSERTITEMW:7920 return LISTVIEW_InsertItem(hwnd,(LPLVITEMW)lParam,TRUE);7921 7922 case LVM_REDRAWITEMS:7923 return LISTVIEW_RedrawItems(hwnd, (INT)wParam, (INT)lParam);7924 7925 /* case LVM_SCROLL: */ 7926 /* return LISTVIEW_Scroll(hwnd, (INT)wParam, (INT)lParam); */ 7927 7928 case LVM_SETBKCOLOR:7929 return LISTVIEW_SetBkColor(hwnd, (COLORREF)lParam);8205 case LVM_HITTEST: 8206 return LISTVIEW_HitTest(hwnd, (LPLVHITTESTINFO)lParam); 8207 8208 case LVM_INSERTCOLUMNA: 8209 return LISTVIEW_InsertColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,FALSE); 8210 8211 case LVM_INSERTCOLUMNW: 8212 return LISTVIEW_InsertColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,TRUE); 8213 8214 case LVM_INSERTITEMA: 8215 return LISTVIEW_InsertItem(hwnd,(LPLVITEMW)lParam,FALSE); 8216 8217 case LVM_INSERTITEMW: 8218 return LISTVIEW_InsertItem(hwnd,(LPLVITEMW)lParam,TRUE); 8219 8220 case LVM_REDRAWITEMS: 8221 return LISTVIEW_RedrawItems(hwnd, (INT)wParam, (INT)lParam); 8222 8223 case LVM_SCROLL: 8224 return LISTVIEW_Scroll(hwnd,wParam,lParam); 8225 8226 case LVM_SETBKCOLOR: 8227 return LISTVIEW_SetBkColor(hwnd, (COLORREF)lParam); 7930 8228 7931 8229 /* case LVM_SETBKIMAGE: */ 7932 8230 7933 case LVM_SETCALLBACKMASK:7934 return LISTVIEW_SetCallbackMask(hwnd, (UINT)wParam);7935 7936 case LVM_SETCOLUMNA:7937 return LISTVIEW_SetColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,FALSE);7938 7939 case LVM_SETCOLUMNW:7940 return LISTVIEW_SetColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,TRUE);7941 7942 case LVM_SETCOLUMNORDERARRAY:7943 return LISTVIEW_SetColumnOrderArray(hwnd, (INT)wParam, (LPINT)lParam);7944 7945 case LVM_SETCOLUMNWIDTH:7946 return LISTVIEW_SetColumnWidth(hwnd, (INT)wParam, (INT)lParam);7947 7948 case LVM_SETEXTENDEDLISTVIEWSTYLE:7949 return LISTVIEW_SetExtendedListViewStyle(hwnd, (DWORD)wParam, (DWORD)lParam);8231 case LVM_SETCALLBACKMASK: 8232 return LISTVIEW_SetCallbackMask(hwnd, (UINT)wParam); 8233 8234 case LVM_SETCOLUMNA: 8235 return LISTVIEW_SetColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,FALSE); 8236 8237 case LVM_SETCOLUMNW: 8238 return LISTVIEW_SetColumn(hwnd,(INT)wParam,(LPLVCOLUMNW)lParam,TRUE); 8239 8240 case LVM_SETCOLUMNORDERARRAY: 8241 return LISTVIEW_SetColumnOrderArray(hwnd, (INT)wParam, (LPINT)lParam); 8242 8243 case LVM_SETCOLUMNWIDTH: 8244 return LISTVIEW_SetColumnWidth(hwnd, (INT)wParam, (INT)lParam); 8245 8246 case LVM_SETEXTENDEDLISTVIEWSTYLE: 8247 return LISTVIEW_SetExtendedListViewStyle(hwnd, (DWORD)wParam, (DWORD)lParam); 7950 8248 7951 8249 /* case LVM_SETHOTCURSOR: */ 7952 8250 7953 case LVM_SETHOTITEM:7954 return LISTVIEW_SetHotItem(hwnd, (INT)wParam);8251 case LVM_SETHOTITEM: 8252 return LISTVIEW_SetHotItem(hwnd, (INT)wParam); 7955 8253 7956 8254 /* case LVM_SETHOVERTIME: */ 7957 8255 /* case LVM_SETICONSPACING: */ 7958 8256 7959 case LVM_SETIMAGELIST:7960 return LISTVIEW_SetImageList(hwnd, (INT)wParam, (HIMAGELIST)lParam);7961 7962 case LVM_SETITEMA:7963 return LISTVIEW_SetItem(hwnd,(LPLVITEMW)lParam,FALSE);7964 7965 case LVM_SETITEMW:7966 return LISTVIEW_SetItem(hwnd,(LPLVITEMW)lParam,TRUE);7967 7968 case LVM_SETITEMCOUNT:7969 return LISTVIEW_SetItemCount(hwnd, (INT)wParam, (DWORD)lParam);7970 7971 case LVM_SETITEMPOSITION:7972 return LISTVIEW_SetItemPosition(hwnd, (INT)wParam, (INT)LOWORD(lParam),7973 (INT)HIWORD(lParam)); 7974 7975 /* case LVM_SETITEMPOSITION32: */ 7976 7977 case LVM_SETITEMSTATE:7978 return LISTVIEW_SetItemState(hwnd, (INT)wParam, (LPLVITEMW)lParam);7979 7980 case LVM_SETITEMTEXTA:7981 return LISTVIEW_SetItemText(hwnd,(INT)wParam,(LPLVITEMW)lParam,FALSE);7982 7983 case LVM_SETITEMTEXTW:7984 return LISTVIEW_SetItemText(hwnd,(INT)wParam,(LPLVITEMW)lParam,TRUE);7985 7986 case LVM_SETSELECTIONMARK:7987 return LISTVIEW_SetSelectionMark(hwnd, (INT)lParam);7988 7989 case LVM_SETTEXTBKCOLOR:7990 return LISTVIEW_SetTextBkColor(hwnd, (COLORREF)lParam);7991 7992 case LVM_SETTEXTCOLOR:7993 return LISTVIEW_SetTextColor(hwnd, (COLORREF)lParam);8257 case LVM_SETIMAGELIST: 8258 return LISTVIEW_SetImageList(hwnd, (INT)wParam, (HIMAGELIST)lParam); 8259 8260 case LVM_SETITEMA: 8261 return LISTVIEW_SetItem(hwnd,(LPLVITEMW)lParam,FALSE); 8262 8263 case LVM_SETITEMW: 8264 return LISTVIEW_SetItem(hwnd,(LPLVITEMW)lParam,TRUE); 8265 8266 case LVM_SETITEMCOUNT: 8267 return LISTVIEW_SetItemCount(hwnd, (INT)wParam, (DWORD)lParam); 8268 8269 case LVM_SETITEMPOSITION: 8270 return LISTVIEW_SetItemPosition(hwnd,(INT)wParam,(INT)LOWORD(lParam),(INT)HIWORD(lParam),FALSE); 8271 8272 case LVM_SETITEMPOSITION32: 8273 return LISTVIEW_SetItemPosition32(hwnd,(INT)wParam,(LPPOINT)lParam); 8274 8275 case LVM_SETITEMSTATE: 8276 return LISTVIEW_SetItemState(hwnd, (INT)wParam, (LPLVITEMW)lParam); 8277 8278 case LVM_SETITEMTEXTA: 8279 return LISTVIEW_SetItemText(hwnd,(INT)wParam,(LPLVITEMW)lParam,FALSE); 8280 8281 case LVM_SETITEMTEXTW: 8282 return LISTVIEW_SetItemText(hwnd,(INT)wParam,(LPLVITEMW)lParam,TRUE); 8283 8284 case LVM_SETSELECTIONMARK: 8285 return LISTVIEW_SetSelectionMark(hwnd, (INT)lParam); 8286 8287 case LVM_SETTEXTBKCOLOR: 8288 return LISTVIEW_SetTextBkColor(hwnd, (COLORREF)lParam); 8289 8290 case LVM_SETTEXTCOLOR: 8291 return LISTVIEW_SetTextColor(hwnd, (COLORREF)lParam); 7994 8292 7995 8293 /* case LVM_SETTOOLTIPS: */ 7996 8294 /* case LVM_SETWORKAREAS: */ 7997 8295 7998 case LVM_SORTITEMS:7999 return LISTVIEW_SortItems(hwnd, wParam, lParam);8296 case LVM_SORTITEMS: 8297 return LISTVIEW_SortItems(hwnd, wParam, lParam); 8000 8298 8001 8299 /* case LVM_SUBITEMHITTEST: */ 8002 8300 8003 case LVM_UPDATE: 8004 return LISTVIEW_Update(hwnd, (INT)wParam); 8005 8006 case WM_CHAR: 8007 return LISTVIEW_ProcessLetterKeys( hwnd, wParam, lParam ); 8008 8009 case WM_COMMAND: 8010 return LISTVIEW_Command(hwnd, wParam, lParam); 8011 8012 case WM_CREATE: 8013 return LISTVIEW_Create(hwnd, wParam, lParam); 8014 8015 case WM_ERASEBKGND: 8016 return LISTVIEW_EraseBackground(hwnd, wParam, lParam); 8017 8018 case WM_GETDLGCODE: 8019 return DLGC_WANTCHARS | DLGC_WANTARROWS; 8020 8021 case WM_GETFONT: 8022 return LISTVIEW_GetFont(hwnd); 8023 8024 case WM_HSCROLL: 8025 return LISTVIEW_HScroll(hwnd, (INT)LOWORD(wParam), 8026 (INT)HIWORD(wParam), (HWND)lParam); 8027 8028 case WM_KEYDOWN: 8029 return LISTVIEW_KeyDown(hwnd, (INT)wParam, (LONG)lParam); 8030 8031 case WM_KILLFOCUS: 8032 return LISTVIEW_KillFocus(hwnd); 8033 8034 case WM_LBUTTONDBLCLK: 8035 return LISTVIEW_LButtonDblClk(hwnd, (WORD)wParam, LOWORD(lParam), 8036 HIWORD(lParam)); 8037 8038 case WM_LBUTTONDOWN: 8039 return LISTVIEW_LButtonDown(hwnd, (WORD)wParam, LOWORD(lParam), 8040 HIWORD(lParam)); 8041 case WM_LBUTTONUP: 8042 return LISTVIEW_LButtonUp(hwnd, (WORD)wParam, LOWORD(lParam), 8043 HIWORD(lParam)); 8301 case LVM_UPDATE: 8302 return LISTVIEW_Update(hwnd, (INT)wParam); 8303 8304 case WM_CHAR: 8305 return LISTVIEW_ProcessLetterKeys( hwnd, wParam, lParam ); 8306 8307 case WM_COMMAND: 8308 return LISTVIEW_Command(hwnd, wParam, lParam); 8309 8310 case WM_CREATE: 8311 return LISTVIEW_Create(hwnd, wParam, lParam); 8312 8313 case WM_ERASEBKGND: 8314 return LISTVIEW_EraseBackground(hwnd, wParam, lParam); 8315 8316 case WM_GETDLGCODE: 8317 return DLGC_WANTCHARS | DLGC_WANTARROWS; 8318 8319 case WM_GETFONT: 8320 return LISTVIEW_GetFont(hwnd); 8321 8322 case WM_HSCROLL: 8323 return LISTVIEW_HScroll(hwnd,(INT)LOWORD(wParam),(INT)HIWORD(wParam),(HWND)lParam); 8324 8325 case WM_KEYDOWN: 8326 return LISTVIEW_KeyDown(hwnd, (INT)wParam, (LONG)lParam); 8327 8328 case WM_KILLFOCUS: 8329 return LISTVIEW_KillFocus(hwnd); 8330 8331 case WM_LBUTTONDBLCLK: 8332 return LISTVIEW_LButtonDblClk(hwnd,(WORD)wParam,LOWORD(lParam),HIWORD(lParam)); 8333 8334 case WM_LBUTTONDOWN: 8335 return LISTVIEW_LButtonDown(hwnd,(WORD)wParam,LOWORD(lParam),HIWORD(lParam)); 8336 8337 case WM_LBUTTONUP: 8338 return LISTVIEW_LButtonUp(hwnd,(WORD)wParam,LOWORD(lParam),HIWORD(lParam)); 8044 8339 8045 8340 /* case WM_MOUSEMOVE: */ 8046 8341 /* return LISTVIEW_MouseMove (hwnd, wParam, lParam); */ 8047 8342 8048 case WM_NCCREATE: 8049 return LISTVIEW_NCCreate(hwnd, wParam, lParam); 8050 8051 case WM_NCDESTROY: 8052 return LISTVIEW_NCDestroy(hwnd); 8053 8054 case WM_NOTIFY: 8055 return LISTVIEW_Notify(hwnd, (INT)wParam, (LPNMHDR)lParam); 8056 8057 case WM_PAINT: 8058 return LISTVIEW_Paint(hwnd, (HDC)wParam); 8059 8060 case WM_RBUTTONDBLCLK: 8061 return LISTVIEW_RButtonDblClk(hwnd, (WORD)wParam, LOWORD(lParam), 8062 HIWORD(lParam)); 8063 8064 case WM_RBUTTONDOWN: 8065 return LISTVIEW_RButtonDown(hwnd, (WORD)wParam, LOWORD(lParam), 8066 HIWORD(lParam)); 8067 8068 case WM_RBUTTONUP: 8069 return LISTVIEW_RButtonUp(hwnd, (WORD)wParam, LOWORD(lParam), 8070 HIWORD(lParam)); 8071 8072 case WM_SETFOCUS: 8073 return LISTVIEW_SetFocus(hwnd, (HWND)wParam); 8074 8075 case WM_SETFONT: 8076 return LISTVIEW_SetFont(hwnd, (HFONT)wParam, (WORD)lParam); 8077 8078 case WM_SETREDRAW: 8079 return LISTVIEW_SetRedraw(hwnd, (BOOL)wParam); 8080 8081 case WM_SIZE: 8082 return LISTVIEW_Size(hwnd, (int)SLOWORD(lParam), (int)SHIWORD(lParam)); 8083 8084 case WM_STYLECHANGED: 8085 return LISTVIEW_StyleChanged(hwnd, wParam, (LPSTYLESTRUCT)lParam); 8086 8087 case WM_TIMER: 8088 return LISTVIEW_Timer(hwnd,wParam,lParam); 8089 8090 case WM_VSCROLL: 8091 return LISTVIEW_VScroll(hwnd,(INT)LOWORD(wParam),(INT)HIWORD(wParam),(HWND)lParam); 8092 8093 case WM_MOUSEWHEEL: 8094 if (wParam & (MK_SHIFT | MK_CONTROL)) 8095 return DefWindowProcA( hwnd, uMsg, wParam, lParam ); 8096 return LISTVIEW_MouseWheel(hwnd, (short int)HIWORD(wParam)); 8343 case WM_NCCREATE: 8344 return LISTVIEW_NCCreate(hwnd, wParam, lParam); 8345 8346 case WM_NCDESTROY: 8347 return LISTVIEW_NCDestroy(hwnd); 8348 8349 case WM_NOTIFY: 8350 return LISTVIEW_Notify(hwnd, (INT)wParam, (LPNMHDR)lParam); 8351 8352 case WM_PAINT: 8353 return LISTVIEW_Paint(hwnd, (HDC)wParam); 8354 8355 case WM_RBUTTONDBLCLK: 8356 return LISTVIEW_RButtonDblClk(hwnd,(WORD)wParam,LOWORD(lParam),HIWORD(lParam)); 8357 8358 case WM_RBUTTONDOWN: 8359 return LISTVIEW_RButtonDown(hwnd,(WORD)wParam,LOWORD(lParam),HIWORD(lParam)); 8360 8361 case WM_RBUTTONUP: 8362 return LISTVIEW_RButtonUp(hwnd,(WORD)wParam,LOWORD(lParam),HIWORD(lParam)); 8363 8364 case WM_SETFOCUS: 8365 return LISTVIEW_SetFocus(hwnd, (HWND)wParam); 8366 8367 case WM_SETFONT: 8368 return LISTVIEW_SetFont(hwnd, (HFONT)wParam, (WORD)lParam); 8369 8370 case WM_SETREDRAW: 8371 return LISTVIEW_SetRedraw(hwnd, (BOOL)wParam); 8372 8373 case WM_SIZE: 8374 return LISTVIEW_Size(hwnd, (int)SLOWORD(lParam), (int)SHIWORD(lParam)); 8375 8376 case WM_STYLECHANGED: 8377 return LISTVIEW_StyleChanged(hwnd, wParam, (LPSTYLESTRUCT)lParam); 8378 8379 case WM_TIMER: 8380 return LISTVIEW_Timer(hwnd,wParam,lParam); 8381 8382 case WM_VSCROLL: 8383 return LISTVIEW_VScroll(hwnd,(INT)LOWORD(wParam),(INT)HIWORD(wParam),(HWND)lParam); 8384 8385 case WM_MOUSEWHEEL: 8386 return LISTVIEW_MouseWheel(hwnd,wParam,lParam); 8097 8387 8098 8388 /* case WM_WINDOWPOSCHANGED: */ 8099 8389 /* case WM_WININICHANGE: */ 8100 8390 8101 default:8102 //if (uMsg >= WM_USER)8103 //{8104 // ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam,8105 // lParam);8106 //}8107 8108 /* call default window procedure */8109 return defComCtl32ProcA(hwnd, uMsg, wParam, lParam);8391 default: 8392 //if (uMsg >= WM_USER) 8393 //{ 8394 // ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, 8395 // lParam); 8396 //} 8397 8398 /* call default window procedure */ 8399 return defComCtl32ProcA(hwnd, uMsg, wParam, lParam); 8110 8400 } 8111 8401
Note:
See TracChangeset
for help on using the changeset viewer.