Changeset 2354 for trunk/src/shell32/shlview.cpp
- Timestamp:
- Jan 8, 2000, 3:28:54 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/shlview.cpp
r1695 r2354 1 /* $Id: shlview.cpp,v 1. 5 1999-11-10 22:13:10phaller Exp $ */1 /* $Id: shlview.cpp,v 1.6 2000-01-08 02:24:13 phaller Exp $ */ 2 2 /* 3 3 * ShellView … … 68 68 ICOM_VTABLE(IViewObject)* lpvtblViewObject; 69 69 IShellFolder* pSFParent; 70 IShellFolder2* pSF2Parent; 70 71 IShellBrowser* pShellBrowser; 71 72 ICommDlgBrowser* pCommDlgBrowser; … … 159 160 160 161 sv->pSFParent = pFolder; 161 162 if(pFolder) 163 IShellFolder_AddRef(pFolder); 162 if(pFolder) IShellFolder_AddRef(pFolder); 163 IShellFolder_QueryInterface(sv->pSFParent, &IID_IShellFolder2, (LPVOID*)&sv->pSF2Parent); 164 164 165 165 TRACE("(%p)->(%p)\n",sv, pFolder); … … 227 227 TRACE("\n"); 228 228 229 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, 230 FCIDM_TB_SMALLICON, (This->FolderSettings.ViewMode==FVM_LIST)? TRUE : FALSE, &result); 231 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, 232 FCIDM_TB_REPORTVIEW, (This->FolderSettings.ViewMode==FVM_DETAILS)? TRUE : FALSE, &result); 233 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, 234 FCIDM_TB_SMALLICON, TRUE, &result); 235 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, 236 FCIDM_TB_REPORTVIEW, TRUE, &result); 229 if (IsInCommDlg(This)) 230 { 231 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, 232 FCIDM_TB_SMALLICON, (This->FolderSettings.ViewMode==FVM_LIST)? TRUE : FALSE, &result); 233 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, 234 FCIDM_TB_REPORTVIEW, (This->FolderSettings.ViewMode==FVM_DETAILS)? TRUE : FALSE, &result); 235 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, 236 FCIDM_TB_SMALLICON, TRUE, &result); 237 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON, 238 FCIDM_TB_REPORTVIEW, TRUE, &result); 239 } 237 240 } 238 241 … … 306 309 { 307 310 LVCOLUMNA lvColumn; 308 CHAR szString[50]; 311 SHELLDETAILS sd; 312 int i; 313 char szTemp[50]; 309 314 310 315 TRACE("%p\n",This); … … 312 317 ListView_DeleteAllItems(This->hWndList); 313 318 314 /*initialize the columns */ 315 lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; /* | LVCF_SUBITEM;*/ 316 lvColumn.fmt = LVCFMT_LEFT; 317 lvColumn.pszText = szString; 318 319 lvColumn.cx = 120; 320 LoadStringA(shell32_hInstance, IDS_SHV_COLUMN1, szString, sizeof(szString)); 321 ListView_InsertColumnA(This->hWndList, 0, &lvColumn); 322 323 lvColumn.cx = 60; 324 LoadStringA(shell32_hInstance, IDS_SHV_COLUMN2, szString, sizeof(szString)); 325 ListView_InsertColumnA(This->hWndList, 1, &lvColumn); 326 327 lvColumn.cx = 120; 328 LoadStringA(shell32_hInstance, IDS_SHV_COLUMN3, szString, sizeof(szString)); 329 ListView_InsertColumnA(This->hWndList, 2, &lvColumn); 330 331 lvColumn.cx = 60; 332 LoadStringA(shell32_hInstance, IDS_SHV_COLUMN4, szString, sizeof(szString)); 333 ListView_InsertColumnA(This->hWndList, 3, &lvColumn); 319 lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; 320 lvColumn.pszText = szTemp; 321 322 if (This->pSF2Parent) 323 { 324 for (i=0; 1; i++) 325 { 326 if (!SUCCEEDED(IShellFolder2_GetDetailsOf(This->pSF2Parent, NULL, i, &sd))) 327 break; 328 lvColumn.fmt = sd.fmt; 329 lvColumn.cx = sd.cxChar*8; /* chars->pixel */ 330 StrRetToStrNA( szTemp, 50, &sd.str, NULL); 331 ListView_InsertColumnA(This->hWndList, i, &lvColumn); 332 } 333 } 334 else 335 { 336 FIXME("no SF2\n"); 337 } 334 338 335 339 ListView_SetImageList(This->hWndList, ShellSmallIconList, LVSIL_SMALL); … … 355 359 return ret; 356 360 } 357 358 361 359 362 /************************************************************************* … … 380 383 * the way this function works is only usable if we had only 381 384 * filesystemfolders (25/10/99 jsch) 382 *383 385 */ 384 386 static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData) … … 657 659 * ShellView_GetSelections() 658 660 * 661 * - fills the this->apidl list with the selected objects 662 * 659 663 * RETURNS 660 664 * number of selected items … … 970 974 This->FolderSettings.ViewMode = FVM_SMALLICON; 971 975 SetStyle (This, LVS_SMALLICON, LVS_TYPEMASK); 976 CheckToolbar(This); 972 977 break; 973 978 … … 975 980 This->FolderSettings.ViewMode = FVM_ICON; 976 981 SetStyle (This, LVS_ICON, LVS_TYPEMASK); 982 CheckToolbar(This); 977 983 break; 978 984 … … 980 986 This->FolderSettings.ViewMode = FVM_LIST; 981 987 SetStyle (This, LVS_LIST, LVS_TYPEMASK); 988 CheckToolbar(This); 982 989 break; 983 990 … … 985 992 This->FolderSettings.ViewMode = FVM_DETAILS; 986 993 SetStyle (This, LVS_REPORT, LVS_TYPEMASK); 994 CheckToolbar(This); 987 995 break; 988 996 … … 996 1004 This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID; 997 1005 ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo))); 998 CheckToolbar(This);999 1006 break; 1000 1007 … … 1013 1020 NMLVDISPINFOA *lpdi = (NMLVDISPINFOA *)lpnmh; 1014 1021 LPITEMIDLIST pidl; 1015 STRRET str;1016 1022 1017 1023 TRACE("%p CtlID=%u lpnmh->code=%x\n",This,CtlID,lpnmh->code); … … 1067 1073 pidl = (LPITEMIDLIST)lpdi->item.lParam; 1068 1074 1069 1070 if(lpdi->item.iSubItem) /*is the sub-item information being requested?*/ 1071 { if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/ 1072 { if(_ILIsValue(pidl)) /*is This a value or a folder?*/ 1073 { switch (lpdi->item.iSubItem) 1074 { case 1: /* size */ 1075 _ILGetFileSize (pidl, lpdi->item.pszText, lpdi->item.cchTextMax); 1076 break; 1077 case 2: /* extension */ 1078 { char sTemp[64]; 1079 if (_ILGetExtension (pidl, sTemp, 64)) 1080 { if (!( HCR_MapTypeToValue(sTemp, sTemp, 64, TRUE) 1081 && HCR_MapTypeToValue(sTemp, lpdi->item.pszText, lpdi->item.cchTextMax, FALSE ))) 1082 { lstrcpynA (lpdi->item.pszText, sTemp, lpdi->item.cchTextMax); 1083 strncat (lpdi->item.pszText, "-file", lpdi->item.cchTextMax); 1084 } 1085 } 1086 else /* no extension found */ 1087 { lpdi->item.pszText[0]=0x00; 1088 } 1089 } 1090 break; 1091 case 3: /* date */ 1092 _ILGetFileDate (pidl, lpdi->item.pszText, lpdi->item.cchTextMax); 1093 break; 1094 } 1095 } 1096 else /*its a folder*/ 1097 { switch (lpdi->item.iSubItem) 1098 { case 1: 1099 strcpy(lpdi->item.pszText, ""); 1100 break; 1101 case 2: 1102 lstrcpynA (lpdi->item.pszText, "Folder", lpdi->item.cchTextMax); 1103 break; 1104 case 3: 1105 _ILGetFileDate (pidl, lpdi->item.pszText, lpdi->item.cchTextMax); 1106 break; 1107 } 1108 } 1109 TRACE("-- text=%s\n",lpdi->item.pszText); 1110 } 1111 } 1112 else /*the item text is being requested*/ 1113 { 1114 if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/ 1115 { 1116 if(SUCCEEDED(IShellFolder_GetDisplayNameOf(This->pSFParent,pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &str))) 1117 { 1118 StrRetToStrNA(lpdi->item.pszText, lpdi->item.cchTextMax, &str, pidl); 1119 } 1120 TRACE("-- text=%s\n",lpdi->item.pszText); 1121 } 1122 1123 if(lpdi->item.mask & LVIF_IMAGE) /*is the image being requested?*/ 1075 if(lpdi->item.mask & LVIF_TEXT) /* text requested */ 1076 { 1077 if (This->pSF2Parent) 1078 { 1079 SHELLDETAILS sd; 1080 IShellFolder2_GetDetailsOf(This->pSF2Parent, pidl, lpdi->item.iSubItem, &sd); 1081 StrRetToStrNA( lpdi->item.pszText, lpdi->item.cchTextMax, &sd.str, NULL); 1082 TRACE("-- text=%s\n",lpdi->item.pszText); 1083 } 1084 else 1085 { 1086 FIXME("no SF2\n"); 1087 } 1088 } 1089 if(lpdi->item.mask & LVIF_IMAGE) /* image requested */ 1124 1090 { 1125 1091 lpdi->item.iImage = SHMapPIDLToSystemImageListIndex(This->pSFParent, pidl, 0); 1126 } 1127 } 1092 } 1128 1093 break; 1129 1094 … … 1305 1270 if(This->pSFParent) 1306 1271 IShellFolder_Release(This->pSFParent); 1272 1273 if(This->pSF2Parent) 1274 IShellFolder2_Release(This->pSF2Parent); 1307 1275 1308 1276 if (This->apidl)
Note:
See TracChangeset
for help on using the changeset viewer.