Ignore:
Timestamp:
Jan 8, 2000, 3:28:54 AM (26 years ago)
Author:
phaller
Message:

Updated to WINE 2000/01/08

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:10 phaller Exp $ */
     1/* $Id: shlview.cpp,v 1.6 2000-01-08 02:24:13 phaller Exp $ */
    22/*
    33 * ShellView
     
    6868   ICOM_VTABLE(IViewObject)*             lpvtblViewObject;
    6969   IShellFolder*  pSFParent;
     70   IShellFolder2*  pSF2Parent;
    7071   IShellBrowser* pShellBrowser;
    7172   ICommDlgBrowser*                      pCommDlgBrowser;
     
    159160
    160161   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);
    164164
    165165   TRACE("(%p)->(%p)\n",sv, pFolder);
     
    227227   TRACE("\n");
    228228
    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  }
    237240}
    238241
     
    306309{
    307310   LVCOLUMNA lvColumn;
    308    CHAR        szString[50];
     311   SHELLDETAILS sd;
     312   int  i;
     313   char szTemp[50];
    309314
    310315   TRACE("%p\n",This);
     
    312317   ListView_DeleteAllItems(This->hWndList);
    313318
    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   }
    334338
    335339   ListView_SetImageList(This->hWndList, ShellSmallIconList, LVSIL_SMALL);
     
    355359   return ret;
    356360}
    357 
    358361
    359362/*************************************************************************
     
    380383 * the way this function works is only usable if we had only
    381384 * filesystemfolders  (25/10/99 jsch)
    382  *
    383385 */
    384386static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData)
     
    657659*   ShellView_GetSelections()
    658660*
     661* - fills the this->apidl list with the selected objects
     662*
    659663* RETURNS
    660664*  number of selected items
     
    970974       This->FolderSettings.ViewMode = FVM_SMALLICON;
    971975       SetStyle (This, LVS_SMALLICON, LVS_TYPEMASK);
     976       CheckToolbar(This);
    972977       break;
    973978
     
    975980       This->FolderSettings.ViewMode = FVM_ICON;
    976981       SetStyle (This, LVS_ICON, LVS_TYPEMASK);
     982       CheckToolbar(This);
    977983       break;
    978984
     
    980986       This->FolderSettings.ViewMode = FVM_LIST;
    981987       SetStyle (This, LVS_LIST, LVS_TYPEMASK);
     988       CheckToolbar(This);
    982989       break;
    983990
     
    985992       This->FolderSettings.ViewMode = FVM_DETAILS;
    986993       SetStyle (This, LVS_REPORT, LVS_TYPEMASK);
     994       CheckToolbar(This);
    987995       break;
    988996
     
    9961004       This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
    9971005       ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
    998        CheckToolbar(This);
    9991006       break;
    10001007
     
    10131020   NMLVDISPINFOA *lpdi = (NMLVDISPINFOA *)lpnmh;
    10141021   LPITEMIDLIST pidl;
    1015    STRRET   str;
    10161022
    10171023   TRACE("%p CtlID=%u lpnmh->code=%x\n",This,CtlID,lpnmh->code);
     
    10671073       pidl = (LPITEMIDLIST)lpdi->item.lParam;
    10681074
    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 */
    11241090         {
    11251091           lpdi->item.iImage = SHMapPIDLToSystemImageListIndex(This->pSFParent, pidl, 0);
    1126          }
    1127        }
     1092         }       
    11281093       break;
    11291094
     
    13051270     if(This->pSFParent)
    13061271       IShellFolder_Release(This->pSFParent);
     1272
     1273     if(This->pSF2Parent)
     1274       IShellFolder2_Release(This->pSF2Parent);
    13071275
    13081276     if (This->apidl)
Note: See TracChangeset for help on using the changeset viewer.