- Timestamp:
- Mar 24, 2000, 6:16:27 PM (25 years ago)
- Location:
- trunk/src
- Files:
-
- 4 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 { -
trunk/src/comdlg32/comdlg32.cpp
r3192 r3216 1 /* $Id: comdlg32.cpp,v 1.2 3 2000-03-22 16:55:00cbratschi Exp $ */1 /* $Id: comdlg32.cpp,v 1.24 2000-03-24 17:16:26 cbratschi Exp $ */ 2 2 3 3 /* … … 26 26 ODINDEBUGCHANNEL(COMDLG32-COMDLG32) 27 27 28 BOOL useWinFileDlg = FALSE;28 BOOL useWinFileDlg = TRUE; 29 29 30 30 #if 0 -
trunk/src/comdlg32/filedlg95.c
r3202 r3216 1204 1204 /* Browse to the right directory */ 1205 1205 COMDLG32_SHGetDesktopFolder(&psfDesktop); 1206 if((browsePidl = GetPidlFromName(psfDesktop,lpstrPathSpec))) 1206 browsePidl = GetPidlFromName(psfDesktop,lpstrPathSpec); 1207 if(browsePidl) 1207 1208 { 1208 1209 /* Browse to directory */ … … 1293 1294 { 1294 1295 int i; 1295 if ((lpstrExt = strchr(lpOrg, ';'))) 1296 lpstrExt = strchr(lpOrg, ';'); 1297 if (lpstrExt) 1296 1298 { 1297 1299 i = lpstrExt - lpOrg; … … 1442 1444 if((LPSTR)-1 != lpstrTemp) 1443 1445 { 1444 if((lpstrExt = strchr(lpstrTemp,';'))) 1446 lpstrExt = strchr(lpstrTemp,';'); 1447 if(lpstrExt) 1445 1448 { 1446 1449 int i = lpstrExt - lpstrTemp; … … 1948 1951 INT len; 1949 1952 1953 //CB: skip A:,B: SHGFI_DISPLAYNAME for faster handling? 1954 1950 1955 tmpFolder->ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR)tmpFolder->pidlItem, 1951 1956 0, -
trunk/src/comdlg32/filedlgbrowser.c
r2607 r3216 1 1 /* 2 2 * Implementation of IShellBrowser for the File Open common dialog 3 *4 3 * 5 4 */ … … 90 89 * External Prototypes 91 90 */ 92 extern const char *FileOpenDlgInfosStr; 91 extern const char *FileOpenDlgInfosStr; 93 92 94 93 extern HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrFileName); … … 149 148 */ 150 149 HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface, 151 REFIID riid, 150 REFIID riid, 152 151 LPVOID *ppvObj) 153 152 { … … 159 158 160 159 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 161 { *ppvObj = This; 160 { *ppvObj = This; 162 161 } 163 162 else if(IsEqualIID(riid, &IID_IOleWindow)) /*IOleWindow*/ … … 201 200 TRACE("(%p)\n", This); 202 201 203 if (!--(This->ref)) 204 { 202 if (!--(This->ref)) 203 { 205 204 COMDLG32_SHFree(This); 206 205 return 0; … … 221 220 * 222 221 * Note : We will never be window less in the File Open dialog 223 * 224 */ 225 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, 222 * 223 */ 224 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, 226 225 HWND * phwnd) 227 226 { … … 235 234 *phwnd = This->hwndOwner; 236 235 237 return (*phwnd) ? S_OK : E_UNEXPECTED; 236 return (*phwnd) ? S_OK : E_UNEXPECTED; 238 237 239 238 } … … 262 261 * See Windows documentation on IShellBrowser::BrowseObject for more details 263 262 * 264 * This function will override user specified flags and will always 265 * use SBSP_DEFBROWSER and SBSP_DEFMODE. 266 */ 267 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 268 LPCITEMIDLIST pidl, 263 * This function will override user specified flags and will always 264 * use SBSP_DEFBROWSER and SBSP_DEFMODE. 265 */ 266 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 267 LPCITEMIDLIST pidl, 269 268 UINT wFlags) 270 269 { … … 284 283 if(wFlags & SBSP_RELATIVE) 285 284 { 286 285 287 286 /* SBSP_RELATIVE A relative pidl (relative from the current folder) */ 288 287 hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder, … … 298 297 pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent, 299 298 (LPITEMIDLIST)pidl); 300 299 301 300 } 302 301 else if(wFlags & SBSP_PARENT) 303 302 { 304 303 /* Browse the parent folder (ignores the pidl) */ 305 304 306 305 pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent); 307 306 psfTmp = GetShellFolderFromPidl(pidlTmp); … … 315 314 } 316 315 317 316 318 317 /* Retrieve the IShellFolder interface of the pidl specified folder */ 319 318 if(!psfTmp) 320 319 return E_FAIL; 321 320 322 /* If the pidl to browse to is equal to the actual pidl ... 321 /* If the pidl to browse to is equal to the actual pidl ... 323 322 do nothing and pretend you did it*/ 324 323 if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent)) 325 324 { 326 325 IShellFolder_Release(psfTmp); 327 326 COMDLG32_SHFree(pidlTmp); 328 327 return NOERROR; 329 328 } … … 342 341 /* Get the foldersettings from the old view */ 343 342 if(fodInfos->Shell.FOIShellView) 344 { 345 IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, 343 { 344 IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, 346 345 &fodInfos->ShellInfos.folderSettings); 347 346 } … … 364 363 365 364 /* Select the new folder in the Look In combo box of the Open file dialog */ 366 365 367 366 FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,pidlTmp); 368 367 … … 383 382 384 383 fodInfos->ShellInfos.hwndView = hwndView; 385 384 386 385 return NOERROR; 387 386 } … … 389 388 390 389 FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent); 391 return hRes; 390 return hRes; 392 391 } 393 392 … … 395 394 * IShellBrowserImpl_EnableModelessSB 396 395 */ 397 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, 396 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, 398 397 BOOL fEnable) 399 398 400 399 { 401 400 ICOM_THIS(IShellBrowserImpl, iface); … … 410 409 * IShellBrowserImpl_GetControlWindow 411 410 */ 412 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, 413 UINT id, 411 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, 412 UINT id, 414 413 HWND *lphwnd) 415 414 416 415 { 417 416 ICOM_THIS(IShellBrowserImpl, iface); … … 426 425 */ 427 426 HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface, 428 DWORD grfMode, 427 DWORD grfMode, 429 428 LPSTREAM *ppStrm) 430 431 { 432 ICOM_THIS(IShellBrowserImpl, iface); 433 434 TRACE("(%p)\n", This); 435 436 /* Feature not implemented */ 437 return E_NOTIMPL; 438 } 429 430 { 431 ICOM_THIS(IShellBrowserImpl, iface); 432 433 TRACE("(%p)\n", This); 434 435 /* Feature not implemented */ 436 return E_NOTIMPL; 437 } 439 438 /************************************************************************** 440 439 * IShellBrowserImpl_InsertMenusSB … … 443 442 HMENU hmenuShared, 444 443 LPOLEMENUGROUPWIDTHS lpMenuWidths) 445 444 446 445 { 447 446 ICOM_THIS(IShellBrowserImpl, iface); … … 457 456 HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface, 458 457 IShellView *ppshv) 459 460 { 461 ICOM_THIS(IShellBrowserImpl, iface); 462 463 TRACE("(%p)\n", This); 464 465 /* Feature not implemented */ 466 return E_NOTIMPL; 467 } 458 459 { 460 ICOM_THIS(IShellBrowserImpl, iface); 461 462 TRACE("(%p)\n", This); 463 464 /* Feature not implemented */ 465 return E_NOTIMPL; 466 } 468 467 /************************************************************************** 469 468 * IShellBrowserImpl_QueryActiveShellView … … 471 470 HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface, 472 471 IShellView **ppshv) 473 472 474 473 { 475 474 ICOM_THIS(IShellBrowserImpl, iface); … … 487 486 IShellView_AddRef(fodInfos->Shell.FOIShellView); 488 487 return NOERROR; 489 } 488 } 490 489 /************************************************************************** 491 490 * IShellBrowserImpl_RemoveMenusSB … … 493 492 HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface, 494 493 HMENU hmenuShared) 495 496 { 497 ICOM_THIS(IShellBrowserImpl, iface); 498 499 TRACE("(%p)\n", This); 500 501 /* Feature not implemented */ 502 return E_NOTIMPL; 503 } 494 495 { 496 ICOM_THIS(IShellBrowserImpl, iface); 497 498 TRACE("(%p)\n", This); 499 500 /* Feature not implemented */ 501 return E_NOTIMPL; 502 } 504 503 /************************************************************************** 505 504 * IShellBrowserImpl_SendControlMsg 506 505 */ 507 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, 508 UINT id, 509 UINT uMsg, 510 WPARAM wParam, 506 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, 507 UINT id, 508 UINT uMsg, 509 WPARAM wParam, 511 510 LPARAM lParam, 512 511 LRESULT *pret) 513 512 514 513 { 515 514 ICOM_THIS(IShellBrowserImpl, iface); 516 515 LRESULT lres; 517 516 518 517 TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret); 519 518 … … 522 521 case FCW_TOOLBAR: 523 522 lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam); 524 523 break; 525 524 default: 526 525 FIXME("ctrl id: %x\n", id); … … 534 533 */ 535 534 HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface, 536 HMENU hmenuShared, 535 HMENU hmenuShared, 537 536 HOLEMENU holemenuReserved, 538 537 HWND hwndActiveObject) 539 540 { 541 ICOM_THIS(IShellBrowserImpl, iface); 542 543 TRACE("(%p)\n", This); 544 545 /* Feature not implemented */ 546 return E_NOTIMPL; 547 } 538 539 { 540 ICOM_THIS(IShellBrowserImpl, iface); 541 542 TRACE("(%p)\n", This); 543 544 /* Feature not implemented */ 545 return E_NOTIMPL; 546 } 548 547 /************************************************************************** 549 548 * IShellBrowserImpl_SetStatusTextSB … … 551 550 HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface, 552 551 LPCOLESTR lpszStatusText) 553 554 { 555 ICOM_THIS(IShellBrowserImpl, iface); 556 557 TRACE("(%p)\n", This); 558 559 /* Feature not implemented */ 560 return E_NOTIMPL; 561 } 552 553 { 554 ICOM_THIS(IShellBrowserImpl, iface); 555 556 TRACE("(%p)\n", This); 557 558 /* Feature not implemented */ 559 return E_NOTIMPL; 560 } 562 561 /************************************************************************** 563 562 * IShellBrowserImpl_SetToolbarItems 564 563 */ 565 564 HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface, 566 LPTBBUTTON lpButtons, 567 UINT nButtons, 565 LPTBBUTTON lpButtons, 566 UINT nButtons, 568 567 UINT uFlags) 569 570 { 571 ICOM_THIS(IShellBrowserImpl, iface); 572 573 TRACE("(%p)\n", This); 574 575 /* Feature not implemented */ 576 return E_NOTIMPL; 577 } 568 569 { 570 ICOM_THIS(IShellBrowserImpl, iface); 571 572 TRACE("(%p)\n", This); 573 574 /* Feature not implemented */ 575 return E_NOTIMPL; 576 } 578 577 /************************************************************************** 579 578 * IShellBrowserImpl_TranslateAcceleratorSB 580 579 */ 581 580 HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface, 582 LPMSG lpmsg, 581 LPMSG lpmsg, 583 582 WORD wID) 584 583 585 584 { 586 585 ICOM_THIS(IShellBrowserImpl, iface); … … 600 599 */ 601 600 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(ICommDlgBrowser *iface, 602 REFIID riid, 601 REFIID riid, 603 602 LPVOID *ppvObj) 604 603 { … … 648 647 TRACE("(%p)\n", This); 649 648 650 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 651 649 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 650 652 651 /* If the selected object is not a folder, send a IDOK command to parent window */ 653 if((pidl = GetSelectedPidl(ppshv))) 652 pidl = GetSelectedPidl(ppshv); 653 if (pidl) 654 654 { 655 655 HRESULT hRes; … … 657 657 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; 658 658 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); 659 659 if (ulAttr) 660 660 hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE); 661 661 /* Tell the dialog that the user selected a file */ 662 662 else 663 663 { 664 664 hRes = FILEDLG95_OnOpen(This->hwndOwner); 665 665 } 666 666 667 667 /* Free memory used by pidl */ … … 690 690 case CDBOSC_SETFOCUS: 691 691 break; 692 case CDBOSC_KILLFOCUS: 693 694 695 696 692 case CDBOSC_KILLFOCUS: 693 { 694 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 695 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 696 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save"); 697 697 } 698 698 break; … … 703 703 } 704 704 705 return NOERROR; 705 return NOERROR; 706 706 } 707 707 /************************************************************************** 708 708 * IShellBrowserImpl_ICommDlgBrowser_IncludeObject 709 709 */ 710 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 710 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 711 711 IShellView * ppshv, 712 712 LPCITEMIDLIST pidl) … … 725 725 ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK; 726 726 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); 727 728 729 if( (ulAttr & SFGAO_HIDDEN) 730 | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) 727 728 729 if( (ulAttr & SFGAO_HIDDEN) /* hidden */ 730 | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */ 731 731 return S_FALSE; 732 732 /* always include directorys and links */ 733 if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK)) 733 if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK)) 734 734 return S_OK; 735 735 /* Check if there is a mask to apply if not */ … … 741 741 { if (SUCCEEDED(StrRetToBufW(&str, pidl,szPathW, MAX_PATH))) 742 742 { 743 743 if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter)) 744 744 return S_OK; 745 745 } … … 751 751 /************************************************************************** 752 752 * IShellBrowserImpl_ICommDlgBrowser_OnSelChange 753 */ 753 */ 754 754 HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv) 755 755 { … … 761 761 TRACE("(%p)\n", This); 762 762 763 if((pidl = GetSelectedPidl(ppshv))) 763 pidl = GetSelectedPidl(ppshv); 764 if (pidl) 764 765 { 765 766 HRESULT hRes = E_FAIL; 766 767 char lpstrFileName[MAX_PATH]; 767 768 768 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; 769 769 770 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); 770 771 if (!ulAttr) … … 772 773 if(SUCCEEDED(hRes = GetName(fodInfos->Shell.FOIShellFolder,pidl,SHGDN_NORMAL,lpstrFileName))) 773 774 SetWindowTextA(fodInfos->DlgInfos.hwndFileName,lpstrFileName); 774 775 775 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 776 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save"); 776 777 } 777 778 779 780 778 else 779 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Open"); 780 781 fodInfos->DlgInfos.dwDlgProp |= FODPROP_USEVIEW; 781 782 782 783 COMDLG32_SHFree((LPVOID)pidl); … … 785 786 } 786 787 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 787 788 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save"); 788 789 789 790 fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW; … … 812 813 STGMEDIUM medium; 813 814 FORMATETC formatetc; 814 815 815 816 /* Set the FORMATETC structure*/ 816 817 SETDefFormatEtc(formatetc, … … 822 823 { 823 824 LPIDA cida = GlobalLock(medium.u.hGlobal); 824 825 TRACE("cida=%p\n", cida); 825 826 pidlSelected = COMDLG32_PIDL_ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[1]])); 826 827 … … 828 829 IUnknown_Release(medium.pUnkForRelease); 829 830 else 830 831 832 833 831 { 832 GlobalUnlock(medium.u.hGlobal); 833 GlobalFree(medium.u.hGlobal); 834 } 834 835 } 835 836 IDataObject_Release(doSelected);
Note:
See TracChangeset
for help on using the changeset viewer.