Changeset 653 in dev


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

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

Location:
trunk/ab5.0/abdev/abdev
Files:
6 edited

Legend:

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

    r651 r653  
    6464    return 0;
    6565}
    66 void CDBFileInfo::SetTreeItem(int index,HTREEITEM hTreeItem){
    67     ppobj_FileInfo[index]->m_hTreeItem=hTreeItem;
    68 }
    69 void CDBFileInfo::ResetTree(void){
    70     TV_INSERTSTRUCT tv;
    71 
    72     pobj_FileTree->DeleteAllItems();
    73 
    74     tv.hInsertAfter=TVI_SORT;
    75     tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
    76 
    77     tv.hParent=TVI_ROOT;
    78     tv.item.iImage=0;
    79     tv.item.iSelectedImage=0;
    80     tv.item.pszText="Source Files";
    81     tv.hParent = pobj_FileTree->InsertItem( &tv );
    82 
    83     int i;
    84     char temporary[MAX_PATH],temp2[MAX_PATH];
    85     for(i=0;i<iNum;i++){
    86         _splitpath(ppobj_FileInfo[i]->GetPath().c_str(),0,0,temporary,temp2);
    87         lstrcat(temporary,temp2);
    88         tv.item.iImage=2;
    89         tv.item.iSelectedImage=2;
    90         tv.item.pszText=temporary;
    91         ppobj_FileInfo[i]->m_hTreeItem = pobj_FileTree->InsertItem( &tv );
    92     }
    93 }
    9466BOOL CDBFileInfo::dupli_check(char *path){
    9567    //重複チェック
  • trunk/ab5.0/abdev/abdev/Common.h

    r652 r653  
    431431    const std::string &GetPath(HTREEITEM hTreeItem);
    432432    BOOL IsMainFile(HTREEITEM hTreeItem);
    433 
    434     void SetTreeItem(int index,HTREEITEM hTreeItem);
    435     void ResetTree(void);
    436433
    437434    BOOL dupli_check(char *path);
  • 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}
  • trunk/ab5.0/abdev/abdev/FileTree.h

    r651 r653  
    11
     2class CDBFileInfo;
    23
    34class FileListTreeViewCtrl
     
    1112    void ContextMenu(POINT *pPos);
    1213
    13     HTREEITEM insert(char *str);
     14    HTREEITEM Insert( const std::string &str );
     15    void Reset( CDBFileInfo *pFileInfos );
    1416};
    1517
  • trunk/ab5.0/abdev/abdev/ProjectControl.cpp

    r651 r653  
    665665    _splitpath(path,0,0,temporary,temp2);
    666666    lstrcat(temporary,temp2);
    667     hTreeItem=pobj_FileTree->insert(temporary);
     667    hTreeItem=pobj_FileTree->Insert( temporary );
    668668
    669669
     
    11271127
    11281128    //ファイル ツリー
    1129     projectInfo.pobj_DBFileInfo->ResetTree();
     1129    pobj_FileTree->Reset( projectInfo.pobj_DBFileInfo );
    11301130
    11311131    //関数ツリー
  • trunk/ab5.0/abdev/abdev/include/ProjectManager/FileManager.h

    r651 r653  
    2828{
    2929    Files files;
    30     Folders folders;
     30    //Folders folders;
    3131};
    3232
Note: See TracChangeset for help on using the changeset viewer.