Ignore:
Timestamp:
Jun 17, 2008, 10:14:51 PM (16 years ago)
Author:
dai_9181
Message:

FileTreeView周りをリファクタリング

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/FileTree.cpp

    r651 r653  
    189189}
    190190
    191 HTREEITEM FileListTreeViewCtrl::insert(char *str){
    192     //////////////////////
    193     //ツリービューに追加
    194 
     191HTREEITEM FileListTreeViewCtrl::Insert( const std::string &str )
     192{
     193    return this->InsertItem( str.c_str(), 2, 2, this->GetRootItem(), TVI_SORT );
     194}
     195
     196void FileListTreeViewCtrl::Reset( CDBFileInfo *pFileInfos )
     197{
    195198    TV_INSERTSTRUCT tv;
     199
     200    this->DeleteAllItems();
     201
    196202    tv.hInsertAfter=TVI_SORT;
    197203    tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
    198     tv.item.iImage=2;
    199     tv.item.iSelectedImage=2;
    200     tv.hParent=this->GetRootItem();
    201     tv.item.pszText=str;
    202 
    203     return this->InsertItem(&tv);
    204 }
     204
     205    tv.hParent=TVI_ROOT;
     206    tv.item.iImage=0;
     207    tv.item.iSelectedImage=0;
     208    tv.item.pszText="Source Files";
     209    tv.hParent = this->InsertItem( &tv );
     210
     211    int i;
     212    char temporary[MAX_PATH],temp2[MAX_PATH];
     213    for(i=0;i<pFileInfos->iNum;i++){
     214        _splitpath(pFileInfos->ppobj_FileInfo[i]->GetPath().c_str(),0,0,temporary,temp2);
     215        lstrcat(temporary,temp2);
     216        tv.item.iImage=2;
     217        tv.item.iSelectedImage=2;
     218        tv.item.pszText=temporary;
     219        pFileInfos->ppobj_FileInfo[i]->m_hTreeItem = this->InsertItem( &tv );
     220    }
     221}
Note: See TracChangeset for help on using the changeset viewer.