Changeset 655 in dev for trunk/ab5.0
- Timestamp:
- Jun 18, 2008, 11:03:59 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev/abdev
- Files:
-
- 1 added
- 1 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/Caret.cpp
r629 r655 155 155 } 156 156 157 void GetScrollBaseCaretPos(int WndNum,int *pNaturalBaseX,int *pNaturalBaseY){ 158 159 HWND hEdit; 160 hEdit=MdiInfo[WndNum]->pMdiTextEdit->hEdit; 157 void GetScrollBaseCaretPos(MDIINFO *pMdiInfo,int *pNaturalBaseX,int *pNaturalBaseY) 158 { 159 HWND hEdit = pMdiInfo->pMdiTextEdit->hEdit; 161 160 162 161 //垂直スクロールバーの位置 … … 236 235 x=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x; 237 236 y=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y; 238 GetScrollBaseCaretPos( WndNum,&x,&y);237 GetScrollBaseCaretPos(MdiInfo[WndNum],&x,&y); 239 238 240 239 //エディタ画面左端のコントロールタブ … … 466 465 x=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.x; 467 466 y=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos.y; 468 GetScrollBaseCaretPos( WndNum,&x,&y);467 GetScrollBaseCaretPos(MdiInfo[WndNum],&x,&y); 469 468 470 469 //垂直方向 -
trunk/ab5.0/abdev/abdev/ClassTree.cpp
r629 r655 20 20 return lpdata%MAX_HASH; 21 21 } 22 void CClassTreeView::AddValidItem(HTREEITEM hItem, int iFileNum){22 void CClassTreeView::AddValidItem(HTREEITEM hItem,HTREEITEM hFileTreeItem){ 23 23 //ハッシュ値を取得 24 24 int key; … … 42 42 43 43 pth->hItem=hItem; 44 pth-> iFileNum=iFileNum;44 pth->hFileTreeItem = hFileTreeItem; 45 45 pth->pNextData=0; 46 46 } … … 85 85 86 86 void CClassTreeView::DeleteTreeHash(TREEHASH *pth){ 87 if(pth->hItem && ( iNowFile==-1 || iNowFile==pth->iFileNum)){87 if(pth->hItem && (hNowFileTreeItem==(HTREEITEM)-1 || hNowFileTreeItem==pth->hFileTreeItem)){ 88 88 if(pth->pNextData){ 89 89 DeleteTreeHash(pth->pNextData); … … 96 96 97 97 98 HTREEITEM CClassTreeView::insert(HTREEITEM hParentItem,int flag,char *lpszName, int iFileNum){98 HTREEITEM CClassTreeView::insert(HTREEITEM hParentItem,int flag,char *lpszName,HTREEITEM hFileTreeItem){ 99 99 char temporary[255]; 100 100 … … 110 110 if(lstrcmp(lpszName,tvItem.pszText)==0){ 111 111 //既に挿入済みの場合 112 AddValidItem(hNextItem, iFileNum);112 AddValidItem(hNextItem,hFileTreeItem); 113 113 return hNextItem; 114 114 } … … 158 158 159 159 hNextItem=TreeView_InsertItem(hTreeWnd,&tv); 160 AddValidItem(hNextItem, iFileNum);160 AddValidItem(hNextItem,hFileTreeItem); 161 161 return hNextItem; 162 162 } … … 170 170 while(bSearchingClasses) Sleep(10); 171 171 172 iNowFile=-1;172 this->hNowFileTreeItem = (HTREEITEM)-1; 173 173 174 174 int i; … … 186 186 } 187 187 } 188 void CClassTreeView::init(HWND hwnd, int iFileNum){188 void CClassTreeView::init(HWND hwnd,HTREEITEM hFileTreeItem){ 189 189 hTreeWnd=hwnd; 190 190 191 iNowFile=iFileNum;191 this->hNowFileTreeItem = hFileTreeItem; 192 192 193 193 int i; … … 203 203 TVI_ROOT, 204 204 CTV_ROOT, 205 temporary, -1);205 temporary,(HTREEITEM)-1); 206 206 } 207 207 void CClassTreeView::InsertGlobalProcedureFolder(void){ … … 209 209 hRootFolder, 210 210 CTV_FOLDER, 211 "グローバル関数", -1);212 } 213 214 HTREEITEM CClassTreeView::InsertGlobalProcedure(int flag,char *lpszName, int iFileNum){211 "グローバル関数",(HTREEITEM)-1); 212 } 213 214 HTREEITEM CClassTreeView::InsertGlobalProcedure(int flag,char *lpszName,HTREEITEM hFileTreeItem){ 215 215 return pobj_ClassTreeView->insert( 216 216 hGlobalProcedureFolder, 217 217 CTV_GLOBAL_PROC, 218 218 lpszName, 219 iFileNum);220 } 221 222 HTREEITEM CClassTreeView::insert_code_item(HTREEITEM hParentItem,int flag,char *lpszName, int iFileNum,char *pBuf,int p){219 hFileTreeItem); 220 } 221 222 HTREEITEM CClassTreeView::insert_code_item(HTREEITEM hParentItem,int flag,char *lpszName,HTREEITEM hFileTreeItem,char *pBuf,int p){ 223 223 int i4; 224 224 i4=NumberOfProcedures; … … 226 226 pProcInfo[i4].name=(char *)HeapAlloc(hHeap,0,lstrlen(lpszName)+1); 227 227 lstrcpy(pProcInfo[i4].name,lpszName); 228 pProcInfo[i4]. FileNum=iFileNum;228 pProcInfo[i4].hFileTreeItem = hFileTreeItem; 229 229 230 230 //コード位置 … … 237 237 flag, 238 238 lpszName, 239 iFileNum);239 hFileTreeItem); 240 240 241 241 pProcInfo[i4].hTreeItem=hTempItem; … … 246 246 } 247 247 248 void CClassTreeView::InsertClassFolder(char *lpszName, int iFileNum,char *pBuf,int p){249 hNowClassFolder=insert_code_item(hRootFolder,CTV_CLASS,lpszName, iFileNum,pBuf,p);250 } 251 void CClassTreeView::InsertClassMember(int flag,char *lpszName, int iFileNum,char *pBuf,int p){252 insert_code_item(hNowClassFolder,flag,lpszName, iFileNum,pBuf,p);248 void CClassTreeView::InsertClassFolder(char *lpszName,HTREEITEM hFileTreeItem,char *pBuf,int p){ 249 hNowClassFolder=insert_code_item(hRootFolder,CTV_CLASS,lpszName,hFileTreeItem,pBuf,p); 250 } 251 void CClassTreeView::InsertClassMember(int flag,char *lpszName,HTREEITEM hFileTreeItem,char *pBuf,int p){ 252 insert_code_item(hNowClassFolder,flag,lpszName,hFileTreeItem,pBuf,p); 253 253 } 254 254 … … 258 258 259 259 260 void AnalysisClass(char *pBuf,int *p, int iFileNum){260 void AnalysisClass(char *pBuf,int *p,HTREEITEM hFileTreeItem){ 261 261 int i2; 262 262 i2=*p; … … 272 272 pobj_ClassTreeView->InsertClassFolder( 273 273 pobj_ClassInfo->ClassName, 274 iFileNum,274 hFileTreeItem, 275 275 pBuf, 276 276 i2); … … 307 307 } 308 308 } 309 pobj_ClassTreeView->InsertClassMember(flag,pobj_ClassInfo->pMemberInfo[i].pName, iFileNum,pBuf,pobj_ClassInfo->pMemberInfo[i].code_pos);309 pobj_ClassTreeView->InsertClassMember(flag,pobj_ClassInfo->pMemberInfo[i].pName,hFileTreeItem,pBuf,pobj_ClassInfo->pMemberInfo[i].code_pos); 310 310 } 311 311 … … 316 316 317 317 318 void SetClassTreeFromOneFile_Buf( char *pBuf, int iFileNum ){318 void SetClassTreeFromOneFile_Buf( char *pBuf, HTREEITEM hFileTreeItem ){ 319 319 int i2,i3,i4; 320 320 char temporary[GENERAL_SIZE]; … … 345 345 // クラスの解析 346 346 ///////////////////////////// 347 AnalysisClass(pBuf,&i4, iFileNum);347 AnalysisClass(pBuf,&i4,hFileTreeItem); 348 348 349 349 i2=i4-1; … … 384 384 pobj_ClassTreeView->pProcInfo[i4].name=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1); 385 385 lstrcpy(pobj_ClassTreeView->pProcInfo[i4].name,temporary); 386 pobj_ClassTreeView->pProcInfo[i4]. FileNum=iFileNum;386 pobj_ClassTreeView->pProcInfo[i4].hFileTreeItem = hFileTreeItem; 387 387 388 388 //定義行の選択範囲 … … 433 433 CTV_GLOBAL_PROC, 434 434 pobj_ClassTreeView->pProcInfo[i4].name, 435 iFileNum);435 hFileTreeItem); 436 436 pobj_ClassTreeView->pProcInfo[i4].hTreeItem=hTempItem; 437 437 … … 443 443 } 444 444 } 445 void SetClassTreeFromOneFile( char *lpszFilePath,int iFileNum){445 void SetClassTreeFromOneFile( const ActiveBasic::PM::FM::File &file){ 446 446 int WndNum; 447 447 HWND hChild=GetWindow(hClient,GW_CHILD); … … 451 451 { 452 452 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){ 453 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(), lpszFilePath)==0) break;453 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),file.GetFullPath().c_str())==0) break; 454 454 } 455 455 hChild=GetNextWindow(hChild,GW_HWNDNEXT); … … 464 464 else{ 465 465 //開かれていない場合 466 pBuf=ReadBuffer( lpszFilePath);466 pBuf=ReadBuffer(file.GetFullPath()); 467 467 if(!pBuf) pBuf=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1); 468 468 } 469 469 470 SetClassTreeFromOneFile_Buf( pBuf, iFileNum);470 SetClassTreeFromOneFile_Buf( pBuf, file.GetTreeItemHandle() ); 471 471 472 472 if(!hChild) HeapDefaultFree(pBuf); 473 473 } 474 475 void SetProcedureTreeData(void *temp_iFileNum){ 476 int i; 477 char temporary[MAX_PATH]; 474 void SetClassTreeFromAllFile( ActiveBasic::PM::FM::Folder &folder ) 475 { 476 BOOST_FOREACH( ActiveBasic::PM::FM::Folder &childFolder, folder.folders ) 477 { 478 SetClassTreeFromAllFile( childFolder ); 479 } 480 481 BOOST_FOREACH( ActiveBasic::PM::FM::File &file, folder.files ) 482 { 483 SetClassTreeFromOneFile( file ); 484 } 485 } 486 487 void SetProcedureTreeData(void *temp_hFileTreeItem) 488 { 478 489 BOOL bExpand; 479 490 TVITEM tvItem; 480 491 SCROLLINFO si; 481 492 482 int iFileNum; 483 iFileNum=(int)temp_iFileNum; 493 HTREEITEM hFileTreeItem = (HTREEITEM)temp_hFileTreeItem; 484 494 485 495 if(bSearchingClasses){ … … 504 514 505 515 //プロシージャ情報のメモリを解放 506 for(i =0;i<pobj_ClassTreeView->NumberOfProcedures;i++){507 if( iFileNum==-1 || iFileNum==pobj_ClassTreeView->pProcInfo[i].FileNum){516 for(int i=0;i<pobj_ClassTreeView->NumberOfProcedures;i++){ 517 if(hFileTreeItem==(HTREEITEM)-1 || hFileTreeItem==pobj_ClassTreeView->pProcInfo[i].hFileTreeItem){ 508 518 HeapDefaultFree(pobj_ClassTreeView->pProcInfo[i].name); 509 519 } … … 539 549 540 550 541 pobj_ClassTreeView->init(hProcedureTreeView, iFileNum);551 pobj_ClassTreeView->init(hProcedureTreeView,hFileTreeItem); 542 552 543 553 //ルートフォルダ … … 553 563 if( projectInfo.IsOpened() ){ 554 564 // プロジェクトが開かれているとき 555 if(iFileNum==-1){ 565 if(hFileTreeItem==(HTREEITEM)-1){ 566 boost::mutex::scoped_lock lock( projectInfo.fileSystem.mutex ); 567 556 568 //プロジェクトのすべてのファイルを解析 557 for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){ 558 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary); 559 560 SetClassTreeFromOneFile(temporary,i); 561 } 569 SetClassTreeFromAllFile( projectInfo.fileSystem.root ); 562 570 563 571 //不要になったアイテムを除去 … … 569 577 ///////////////////////////////// 570 578 571 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[iFileNum]->GetFullPath(temporary); 572 573 SetClassTreeFromOneFile(temporary,iFileNum); 579 SetClassTreeFromOneFile( projectInfo.fileSystem.root.FindFile( hFileTreeItem ) ); 574 580 } 575 581 } … … 580 586 int WndNum=GetWndNum(hChild); 581 587 char *pBuf=MdiInfo[WndNum]->pMdiTextEdit->buffer; 582 SetClassTreeFromOneFile_Buf( pBuf, -1 );588 SetClassTreeFromOneFile_Buf( pBuf, (HTREEITEM)-1 ); 583 589 584 590 } … … 601 607 if(bRetrySearchingClasses){ 602 608 bRetrySearchingClasses=0; 603 ResetClassTree( iFileNum);609 ResetClassTree(hFileTreeItem); 604 610 } 605 611 … … 617 623 _endthread(); 618 624 } 619 void ResetClassTree( int iFileNum){620 _beginthread(SetProcedureTreeData,0,(void *) iFileNum);621 } 625 void ResetClassTree(HTREEITEM hFileTreeItem){ 626 _beginthread(SetProcedureTreeData,0,(void *)hFileTreeItem); 627 } -
trunk/ab5.0/abdev/abdev/Common.h
r653 r655 406 406 #define PROJECT_VERSION 10 407 407 408 class CFileInfo{409 std::string filepath;410 public:411 HTREEITEM m_hTreeItem;412 CFileInfo( const std::string &filepath, HTREEITEM hTreeItem );413 414 const std::string &GetPath() const415 {416 return filepath;417 }418 419 void GetFullPath(char *buffer);420 };421 class CDBFileInfo{422 public:423 int iNum;424 CFileInfo **ppobj_FileInfo;425 426 CDBFileInfo();427 ~CDBFileInfo();428 429 void add(char *path,HTREEITEM hTreeItem);430 void del(HTREEITEM hTreeItem);431 const std::string &GetPath(HTREEITEM hTreeItem);432 BOOL IsMainFile(HTREEITEM hTreeItem);433 434 BOOL dupli_check(char *path);435 };436 437 408 struct PROCINFO{ 438 409 char *name; 439 int FileNum;440 410 HTREEITEM hTreeItem; 411 412 HTREEITEM hFileTreeItem; 441 413 442 414 int code_pos; … … 597 569 int GetWndNum(HWND hChild); 598 570 int GetNowWndNum(void); 599 int GetFileNum(int WndNum);600 571 void SendTextEditResizeEvent(HWND hwnd); 601 572 void RedrawAllWindow(void); … … 761 732 void TextEdit_GetSel(int WndNum,CHARRANGE *pCharRange); 762 733 void TextEdit_GetSelText(int WndNum,CHARRANGE *pCharRange,char *buffer); 763 void GetScrollBaseCaretPos( int WndNum,int *pNaturalBaseX,int *pNaturalBaseY);734 void GetScrollBaseCaretPos(MDIINFO *pMdiInfo,int *pNaturalBaseX,int *pNaturalBaseY); 764 735 void GetNaturalBaseCaretPos(int WndNum,int *pScrollBaseX,int *pScrollBaseY); 765 736 void TextEdit_SetSel(int WndNum,int StartIndex,int EndIndex,BOOL bShowCenter=0); … … 883 854 struct TREEHASH{ 884 855 HTREEITEM hItem; 885 int iFileNum;856 HTREEITEM hFileTreeItem; 886 857 TREEHASH *pNextData; 887 858 }; … … 896 867 class CClassTreeView{ 897 868 HWND hTreeWnd; 898 int iNowFile;869 HTREEITEM hNowFileTreeItem; 899 870 TREEHASH tree_data[MAX_HASH]; 900 871 … … 904 875 int hash_default(LONG_PTR lpdata); 905 876 906 void AddValidItem(HTREEITEM hItem, int iFileNum);877 void AddValidItem(HTREEITEM hItem,HTREEITEM hFileTreeItem); 907 878 BOOL delete_check(HTREEITEM hItem); 908 879 void DeleteInvalidItems(HTREEITEM hItem); 909 880 void DeleteTreeHash(TREEHASH *pth); 910 881 911 HTREEITEM insert(HTREEITEM hParentItem,int flag,char *lpszName, int iFileNum);882 HTREEITEM insert(HTREEITEM hParentItem,int flag,char *lpszName,HTREEITEM hFileTreeItem); 912 883 913 884 public: … … 922 893 CClassTreeView(); 923 894 ~CClassTreeView(); 924 void init(HWND hwnd, int iFileNum);895 void init(HWND hwnd,HTREEITEM hFileTreeItem); 925 896 926 897 void InsertRootFolder(void); 927 898 void InsertGlobalProcedureFolder(void); 928 HTREEITEM InsertGlobalProcedure(int flag,char *lpszName, int iFileNum);929 HTREEITEM insert_code_item(HTREEITEM hParentItem,int flag,char *lpszName, int iFileNum,char *pBuf,int p);930 void InsertClassFolder(char *lpszName, int iFileNum,char *pBuf,int p);931 void InsertClassMember(int flag,char *lpszName, int iFileNum,char *pBuf,int p);899 HTREEITEM InsertGlobalProcedure(int flag,char *lpszName,HTREEITEM hFileTreeItem); 900 HTREEITEM insert_code_item(HTREEITEM hParentItem,int flag,char *lpszName,HTREEITEM hFileTreeItem,char *pBuf,int p); 901 void InsertClassFolder(char *lpszName,HTREEITEM hFileTreeItem,char *pBuf,int p); 902 void InsertClassMember(int flag,char *lpszName,HTREEITEM hFileTreeItem,char *pBuf,int p); 932 903 void finish(); 933 904 }; 934 905 extern CClassTreeView *pobj_ClassTreeView; 935 void ResetClassTree( int iFileNum);906 void ResetClassTree(HTREEITEM hFileTreeItem); 936 907 937 908 //ProjectControl.cpp -
trunk/ab5.0/abdev/abdev/Complement.cpp
r629 r655 391 391 POINT pos; 392 392 pos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos; 393 GetScrollBaseCaretPos( WndNum,(int *)&pos.x,(int *)&pos.y);393 GetScrollBaseCaretPos(MdiInfo[WndNum],(int *)&pos.x,(int *)&pos.y); 394 394 395 395 pos.x=(pos.x-1)*font_width +iControlTabSpace; -
trunk/ab5.0/abdev/abdev/DrawBuffer.cpp
r651 r655 311 311 BaseX=0; 312 312 BaseY=0; 313 GetScrollBaseCaretPos( WndNum,&BaseX,&BaseY);313 GetScrollBaseCaretPos(MdiInfo[WndNum],&BaseX,&BaseY); 314 314 315 315 if(pobj_nv->bEditor_CaretLine_BackGround){ -
trunk/ab5.0/abdev/abdev/FileTree.cpp
r653 r655 22 22 hTreeItem = pobj_FileTree->GetSelectedItem(); 23 23 24 std::string tempPath = projectInfo. pobj_DBFileInfo->GetPath(hTreeItem);24 std::string tempPath = projectInfo.fileSystem.root.FindFile( hTreeItem ).GetRelationalPath(); 25 25 26 26 //絶対パス、相対パスを表示 … … 107 107 hTreeItem=TreeView_GetSelection(hwnd); 108 108 109 std::string tempPath = projectInfo. pobj_DBFileInfo->GetPath(hTreeItem);109 std::string tempPath = projectInfo.fileSystem.root.FindFile( hTreeItem ).GetRelationalPath(); 110 110 111 111 lstrcpy( temporary, tempPath.c_str() ); … … 194 194 } 195 195 196 void FileListTreeViewCtrl::Reset( CDBFileInfo *pFileInfos ) 197 { 196 void FileListTreeViewCtrl::Reset( HTREEITEM hParent, ActiveBasic::PM::FM::Folder &folder ) 197 { 198 char temporary[MAX_PATH],temp2[MAX_PATH]; 199 200 lstrcpy( temporary, folder.GetName().c_str() ); 201 198 202 TV_INSERTSTRUCT tv; 199 200 this->DeleteAllItems();201 202 203 tv.hInsertAfter=TVI_SORT; 203 204 tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE; 204 205 tv.hParent=TVI_ROOT; 205 tv.hParent = hParent; 206 206 tv.item.iImage=0; 207 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); 208 tv.item.pszText = temporary; 209 HTREEITEM hFolder = this->InsertItem( &tv ); 210 211 BOOST_FOREACH( ActiveBasic::PM::FM::Folder &childFolder, folder.folders ) 212 { 213 this->Reset( hFolder, childFolder ); 214 } 215 216 BOOST_FOREACH( ActiveBasic::PM::FM::File &file, folder.files ) 217 { 218 _splitpath(file.GetRelationalPath().c_str(),0,0,temporary,temp2); 215 219 lstrcat(temporary,temp2); 220 221 TV_INSERTSTRUCT tv; 222 tv.hInsertAfter=TVI_SORT; 223 tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE; 224 tv.hParent = hFolder; 216 225 tv.item.iImage=2; 217 226 tv.item.iSelectedImage=2; 218 227 tv.item.pszText=temporary; 219 pFileInfos->ppobj_FileInfo[i]->m_hTreeItem = this->InsertItem( &tv ); 220 } 221 } 228 file.SetTreeViewHandle( this->InsertItem( &tv ) ); 229 } 230 } 231 void FileListTreeViewCtrl::Reset( ActiveBasic::PM::FM::FileSystem &fileSystem ) 232 { 233 this->DeleteAllItems(); 234 235 this->Reset( TVI_ROOT, fileSystem.root ); 236 } -
trunk/ab5.0/abdev/abdev/FileTree.h
r653 r655 1 2 class CDBFileInfo;3 1 4 2 class FileListTreeViewCtrl … … 13 11 14 12 HTREEITEM Insert( const std::string &str ); 15 void Reset( CDBFileInfo *pFileInfos ); 13 private: 14 void Reset( HTREEITEM hParent, ActiveBasic::PM::FM::Folder &folder ); 15 public: 16 void Reset( ActiveBasic::PM::FM::FileSystem &fileSystem ); 16 17 }; 17 18 -
trunk/ab5.0/abdev/abdev/ParameterHint.cpp
r651 r655 35 35 if( projectInfo.IsOpened() ){ 36 36 //プロジェクトが開かれているとき 37 lstrcpy(temporary,projectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetPath().c_str()); 38 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 37 lstrcpy(temporary,projectInfo.fileSystem.root.files[0].GetFullPath().c_str()); 39 38 40 39 for(i=0;i<MdiInfo.size();i++){ -
trunk/ab5.0/abdev/abdev/ProjectControl.cpp
r653 r655 135 135 // 対象ファイルを開く 136 136 lstrcpy(temporary, 137 projectInfo. pobj_DBFileInfo->ppobj_FileInfo[pobj_ClassTreeView->pProcInfo[i].FileNum]->GetPath().c_str());137 projectInfo.fileSystem.root.FindFile( pobj_ClassTreeView->pProcInfo[i].hFileTreeItem ).GetRelationalPath().c_str()); 138 138 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 139 139 hChild=OpenFileWithExtension(temporary); … … 652 652 653 653 //重複チェック 654 if(projectInfo.pobj_DBFileInfo->dupli_check(path)){ 654 if( projectInfo.fileSystem.root.IsExistFile( path ) ) 655 { 655 656 //"\"%s\" ファイルは既にプロジェクト内に存在します。" 656 657 sprintf(temporary,STRING_DUPLICATIONERROR_FILE_IN_PROJECT,path); … … 669 670 670 671 //projectInfo.ppobj_DBFileInfoオブジェクトに追加 671 projectInfo. pobj_DBFileInfo->add(path,hTreeItem);672 projectInfo.fileSystem.root.files.push_back( ActiveBasic::PM::FM::File( path, hTreeItem ) ); 672 673 673 674 … … 675 676 676 677 //ファイル操作によるクラスビューの再表示 677 ResetClassTree( -1);678 ResetClassTree((HTREEITEM)-1); 678 679 } 679 680 void Project_File_Delete(HTREEITEM hTreeItem){ 680 681 extern HANDLE hHeap; 681 682 682 if(projectInfo.pobj_DBFileInfo->IsMainFile(hTreeItem)){683 /*if(projectInfo.pobj_DBFileInfo->IsMainFile(hTreeItem)){ 683 684 //"このファイルはプロジェクトのメイン ファイルです。プロジェクト内から削除することはできません。" 684 685 MessageBox(hOwner,STRING_ERROR_CANT_MAINFILE,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); 685 686 return; 686 } 687 }*/ 687 688 688 689 //ツリービューから削除 689 690 pobj_FileTree->DeleteItem( hTreeItem ); 690 691 691 // projectInfo.pobj_DBFileInfoオブジェクトから削除692 projectInfo. pobj_DBFileInfo->del(hTreeItem);692 // オブジェクトから削除 693 projectInfo.fileSystem.root.Remove( hTreeItem ); 693 694 694 695 projectInfo.modify=1; 695 696 696 697 //ファイル操作によるクラスビューの再表示 697 ResetClassTree( -1);698 ResetClassTree((HTREEITEM)-1); 698 699 } 699 700 … … 1127 1128 1128 1129 //ファイル ツリー 1129 pobj_FileTree->Reset( projectInfo. pobj_DBFileInfo);1130 pobj_FileTree->Reset( projectInfo.fileSystem ); 1130 1131 1131 1132 //関数ツリー 1132 ResetClassTree( -1);1133 ResetClassTree((HTREEITEM)-1); 1133 1134 1134 1135 ///////////////////// … … 1599 1600 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){ 1600 1601 if( MdiInfo[WndNum]->pMdiTextEdit->IsModified() ){ 1601 for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){ 1602 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary); 1603 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),temporary)==0) sw=1; 1604 } 1602 sw = projectInfo.fileSystem.root.IsExistFile( MdiInfo[WndNum]->path ); 1605 1603 } 1606 1604 } … … 1638 1636 return 2; 1639 1637 } 1638 1639 void MakeTextMdiWindowBuffer( ActiveBasic::PM::FM::Folder &folder, int WndNum, char *buffer ) 1640 { 1641 BOOST_FOREACH( ActiveBasic::PM::FM::Folder &childFolder, folder.folders ) 1642 { 1643 MakeTextMdiWindowBuffer( childFolder, WndNum, buffer ); 1644 } 1645 1646 BOOST_FOREACH( ActiveBasic::PM::FM::File &file, folder.files ) 1647 { 1648 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),file.GetFullPath().c_str())==0){ 1649 CHARRANGE CharRange; 1650 TextEdit_GetSel(WndNum,&CharRange); 1651 1652 SCROLLINFO si; 1653 POINT pos; 1654 si.cbSize=sizeof(SCROLLINFO); 1655 si.fMask=SIF_POS; 1656 GetScrollInfo(MdiInfo[WndNum]->pMdiTextEdit->hEdit,SB_HORZ,&si); 1657 pos.x=si.nPos; 1658 GetScrollInfo(MdiInfo[WndNum]->pMdiTextEdit->hEdit,SB_VERT,&si); 1659 pos.y=si.nPos; 1660 1661 char temporary[1024]; 1662 sprintf(temporary,"text,\"%s\",%d,%d,%d,%d\r\n", 1663 file.GetRelationalPath().c_str(), 1664 pos.x, 1665 pos.y, 1666 CharRange.cpMin, 1667 CharRange.cpMax); 1668 1669 lstrcat( buffer, temporary ); 1670 break; 1671 } 1672 } 1673 } 1674 1640 1675 void MakeWorkFile(void){ 1641 1676 int i,i2,WndNum; 1642 1677 char temporary[MAX_PATH],buffer[32767]; 1643 1678 HWND hChild; 1644 CHARRANGE CharRange;1645 1679 1646 1680 //ワークファイル(*.wrk)を作成 … … 1655 1689 WndNum=GetWndNum(hChild); 1656 1690 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){ 1657 for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){ 1658 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary); 1659 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),temporary)==0){ 1660 TextEdit_GetSel(WndNum,&CharRange); 1661 1662 SCROLLINFO si; 1663 POINT pos; 1664 si.cbSize=sizeof(SCROLLINFO); 1665 si.fMask=SIF_POS; 1666 GetScrollInfo(MdiInfo[WndNum]->pMdiTextEdit->hEdit,SB_HORZ,&si); 1667 pos.x=si.nPos; 1668 GetScrollInfo(MdiInfo[WndNum]->pMdiTextEdit->hEdit,SB_VERT,&si); 1669 pos.y=si.nPos; 1670 1671 sprintf(buffer+i2,"text,\"%s\",%d,%d,%d,%d\r\n", 1672 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetPath().c_str(), 1673 pos.x, 1674 pos.y, 1675 CharRange.cpMin, 1676 CharRange.cpMax); 1677 i2+=lstrlen(buffer+i2); 1678 break; 1679 } 1680 } 1691 MakeTextMdiWindowBuffer( projectInfo.fileSystem.root, WndNum, buffer ); 1692 i2 = lstrlen( buffer ); 1681 1693 } 1682 1694 else if(MdiInfo[WndNum]->DocType==WNDTYPE_RAD){ … … 1763 1775 WIN32_FIND_DATA wfd; 1764 1776 1765 if(projectInfo.pobj_DBFileInfo->iNum==0){ 1777 if( projectInfo.fileSystem.root.IsEmpty() ) 1778 { 1766 1779 //"プログラム ファイルがプロジェクトに存在しません。" 1767 1780 MessageBox(hOwner,STRING_ERROR_NOFILE,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); … … 1787 1800 return 1; 1788 1801 } 1802 bool IsNeedCompileForProject( const ActiveBasic::PM::FM::Folder &folder, const FILETIME &exeTime ) 1803 { 1804 BOOST_FOREACH( const ActiveBasic::PM::FM::Folder &childFolder, folder.folders ) 1805 { 1806 if( IsNeedCompileForProject( childFolder, exeTime ) ) 1807 { 1808 return true; 1809 } 1810 } 1811 1812 BOOST_FOREACH( const ActiveBasic::PM::FM::File &file, folder.files ) 1813 { 1814 HANDLE hFile=CreateFile(file.GetFullPath().c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 1815 FILETIME sourceTime; 1816 GetFileTime(hFile,NULL,NULL,&sourceTime); 1817 CloseHandle(hFile); 1818 1819 if(sourceTime.dwHighDateTime>exeTime.dwHighDateTime|| 1820 sourceTime.dwHighDateTime==exeTime.dwHighDateTime&& 1821 sourceTime.dwLowDateTime>exeTime.dwLowDateTime) return true; 1822 } 1823 1824 return false; 1825 } 1826 1789 1827 BOOL IsNeedCompileForProject(BOOL bDebug){ 1790 int i2;1791 1828 char temporary[MAX_PATH]; 1792 1829 HANDLE hFind,hFile; … … 1806 1843 CloseHandle(hFile); 1807 1844 1808 for(i2=0;i2<projectInfo.pobj_DBFileInfo->iNum;i2++){ 1809 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i2]->GetFullPath(temporary); 1810 hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 1811 GetFileTime(hFile,NULL,NULL,&SourceTime); 1812 CloseHandle(hFile); 1813 1814 if(SourceTime.dwHighDateTime>ExeTime.dwHighDateTime|| 1815 SourceTime.dwHighDateTime==ExeTime.dwHighDateTime&& 1816 SourceTime.dwLowDateTime>ExeTime.dwLowDateTime) return 1; 1845 if( IsNeedCompileForProject( projectInfo.fileSystem.root, ExeTime ) ) 1846 { 1847 return 1; 1817 1848 } 1818 1849 if( !projectInfo.windowInfos.empty() ) -
trunk/ab5.0/abdev/abdev/Replace.cpp
r629 r655 182 182 if(MdiInfo[WndNum]->DocType==WNDTYPE_BASIC){ 183 183 //クラスツリーを再表示 184 ResetClassTree(GetFileNum(WndNum)); 184 HTREEITEM hFileTreeItem = projectInfo.fileSystem.root.IsExistFile( MdiInfo[WndNum]->path ) 185 ? projectInfo.fileSystem.root.FindFile( MdiInfo[WndNum]->path ).GetTreeItemHandle() 186 : (HTREEITEM)-1; 187 ResetClassTree( hFileTreeItem ); 185 188 } 186 189 //} -
trunk/ab5.0/abdev/abdev/Ruler.cpp
r629 r655 21 21 } 22 22 23 CRuler::CRuler(HWND hParent, int WndNum){24 m_WndNum=WndNum;25 23 CRuler::CRuler(HWND hParent,MDIINFO *pMdiInfo) 24 : pMdiInfo( pMdiInfo ) 25 { 26 26 hRulerWnd=CreateWindowEx(0,"Ruler","Ruler", 27 27 WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE, … … 56 56 BaseX=0; 57 57 BaseY=0; 58 GetScrollBaseCaretPos( m_WndNum,&BaseX,&BaseY);58 GetScrollBaseCaretPos(this->pMdiInfo,&BaseX,&BaseY); 59 59 60 60 int iControlTabSpace; 61 iControlTabSpace= MdiInfo[m_WndNum]->pMdiTextEdit->iWidth_ControlTabSpace;61 iControlTabSpace=this->pMdiInfo->pMdiTextEdit->iWidth_ControlTabSpace; 62 62 63 63 HBRUSH hBrush,hOldBrush; -
trunk/ab5.0/abdev/abdev/Ruler.h
r3 r655 4 4 LRESULT CALLBACK RulerProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam); 5 5 6 class CRuler{ 7 int m_WndNum; 6 class MDIINFO; 7 8 class CRuler 9 { 10 MDIINFO *pMdiInfo; 8 11 HDC memdc; 9 12 HBITMAP hMemBmp; 10 13 public: 11 14 HWND hRulerWnd; 12 CRuler(HWND hParent, int WndNum);15 CRuler(HWND hParent,MDIINFO *pMdiInfo); 13 16 ~CRuler(); 14 17 -
trunk/ab5.0/abdev/abdev/SubOperation.cpp
r629 r655 1371 1371 HeapDestroy(hHeap); 1372 1372 1373 //DLLを解放1374 FreeLibrary(hResInst);1375 FreeLibrary(hIconResInst);1376 FreeLibrary(hLib_LuxCtrl);1377 1378 //アルファブレンド用のAPIを解放1379 extern HINSTANCE hUser32Lib;1380 FreeLibrary(hUser32Lib);1381 1382 1383 1384 1385 1373 ////////////////////////////////////// 1386 1374 // バックアップ用ファイルを削除 … … 1389 1377 RemoveDirectoryStrong(szBackupDirPath); 1390 1378 1379 //DLLを解放 1380 FreeLibrary(hResInst); 1381 FreeLibrary(hIconResInst); 1382 FreeLibrary(hLib_LuxCtrl); 1383 1384 //アルファブレンド用のAPIを解放 1385 extern HINSTANCE hUser32Lib; 1386 FreeLibrary(hUser32Lib); 1391 1387 } 1392 1388 -
trunk/ab5.0/abdev/abdev/TextEditor_ImeEvent.cpp
r629 r655 21 21 CompForm.dwStyle=CFS_POINT; 22 22 pos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos; 23 GetScrollBaseCaretPos( WndNum,(int *)&pos.x,(int *)&pos.y);23 GetScrollBaseCaretPos(MdiInfo[WndNum],(int *)&pos.x,(int *)&pos.y); 24 24 CompForm.ptCurrentPos.x=pos.x*font_width+iControlTabSpace; 25 25 CompForm.ptCurrentPos.y=pos.y*font_height; … … 63 63 CompForm.dwStyle=CFS_POINT; 64 64 pos=MdiInfo[WndNum]->pMdiTextEdit->StartCaretPos; 65 GetScrollBaseCaretPos( WndNum,(int *)&pos.x,(int *)&pos.y);65 GetScrollBaseCaretPos(MdiInfo[WndNum],(int *)&pos.x,(int *)&pos.y); 66 66 CompForm.ptCurrentPos.x=pos.x*font_width+iControlTabSpace; 67 67 CompForm.ptCurrentPos.y=pos.y*font_height; -
trunk/ab5.0/abdev/abdev/WindowControl.cpp
r629 r655 2176 2176 //重複チェック 2177 2177 sprintf(temporary,"%s.sbp",NewWindow.name); 2178 if(projectInfo. pobj_DBFileInfo->dupli_check(temporary)){2178 if(projectInfo.fileSystem.root.IsExistFile(temporary)){ 2179 2179 sprintf(temp2,"\"%s\" ファイルは既にプロジェクト内に存在します。",temporary); 2180 2180 MessageBox(hOwner,temp2,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION); -
trunk/ab5.0/abdev/abdev/abdev.cpp
r629 r655 113 113 } 114 114 115 int i; 116 char temporary[MAX_PATH]; 117 for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){ 118 119 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary); 120 121 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),temporary)==0) return i; 115 for(int i=0;i<projectInfo.fileSystem.root.files.size();i++) 116 { 117 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),projectInfo.fileSystem.root.files[i].GetFullPath().c_str())==0) return i; 122 118 } 123 119 return -1; … … 916 912 MdiInfo[i]->pMdiTextEdit->hEdit=hEdit; 917 913 MdiInfo[i]->pMdiTextEdit->pobj_WebResult=new CWebResult(hChild); 918 MdiInfo[i]->pMdiTextEdit->pobj_Ruler=new CRuler(hChild, i);914 MdiInfo[i]->pMdiTextEdit->pobj_Ruler=new CRuler(hChild,MdiInfo[i]); 919 915 MdiInfo[i]->pMdiTextEdit->hIcon=shfi.hIcon; 920 916 MdiInfo[i]->pMdiTextEdit->buffer=buffer; … … 970 966 971 967 // クラスビューを更新 972 ResetClassTree( -1);968 ResetClassTree((HTREEITEM)-1); 973 969 } 974 970 } … … 1163 1159 1164 1160 if( !projectInfo.IsOpened() ){ 1165 ResetClassTree( -1);1161 ResetClassTree((HTREEITEM)-1); 1166 1162 } 1167 1163 -
trunk/ab5.0/abdev/abdev/abdev.vcproj
r651 r655 82 82 LinkIncremental="1" 83 83 SuppressStartupBanner="true" 84 AdditionalLibraryDirectories="..\..\jenga\lib\x86;..\lib\x86" 84 85 ProgramDatabaseFile="$(IntDir)\$(ProjectName).pdb" 85 86 SubSystem="2" … … 180 181 LinkIncremental="2" 181 182 SuppressStartupBanner="true" 183 AdditionalLibraryDirectories="..\..\jenga\lib\x86;..\lib\x86" 182 184 GenerateDebugInformation="true" 183 185 ProgramDatabaseFile="$(IntDir)\$(ProjectName).pdb" … … 279 281 LinkIncremental="1" 280 282 SuppressStartupBanner="true" 283 AdditionalLibraryDirectories="..\..\jenga\lib\x86;..\lib\x86" 281 284 ProgramDatabaseFile="$(IntDir)\$(ProjectName).pdb" 282 285 SubSystem="2" … … 377 380 LinkIncremental="2" 378 381 SuppressStartupBanner="true" 382 AdditionalLibraryDirectories="..\..\jenga\lib\x86;..\lib\x86" 379 383 GenerateDebugInformation="true" 380 384 ProgramDatabaseFile="$(IntDir)\$(ProjectName).pdb" … … 2208 2212 > 2209 2213 <File 2210 RelativePath="CFileInfo.cpp"2211 >2212 <FileConfiguration2213 Name="TheText_Release|Win32"2214 >2215 <Tool2216 Name="VCCLCompilerTool"2217 PreprocessorDefinitions=""2218 />2219 </FileConfiguration>2220 <FileConfiguration2221 Name="Debug|Win32"2222 >2223 <Tool2224 Name="VCCLCompilerTool"2225 PreprocessorDefinitions=""2226 />2227 </FileConfiguration>2228 <FileConfiguration2229 Name="Release|Win32"2230 >2231 <Tool2232 Name="VCCLCompilerTool"2233 PreprocessorDefinitions=""2234 />2235 </FileConfiguration>2236 <FileConfiguration2237 Name="TheText_Debug|Win32"2238 >2239 <Tool2240 Name="VCCLCompilerTool"2241 PreprocessorDefinitions=""2242 />2243 </FileConfiguration>2244 </File>2245 <File2246 2214 RelativePath="FileTree.cpp" 2247 2215 > … … 2689 2657 Name="ProjectManager" 2690 2658 > 2659 <File 2660 RelativePath=".\src\ProjectManager\FileManager.cpp" 2661 > 2662 </File> 2691 2663 <File 2692 2664 RelativePath=".\src\ProjectManager\ProjectManager.cpp" -
trunk/ab5.0/abdev/abdev/include/ProjectManager/FileManager.h
r653 r655 6 6 class ItemBase 7 7 { 8 HTREEITEM hTreeItem; 9 10 public: 11 ItemBase( HTREEITEM hTreeItem ) 12 : hTreeItem( hTreeItem ) 13 { 14 } 15 16 HTREEITEM GetTreeItemHandle() const 17 { 18 return hTreeItem; 19 } 20 void SetTreeViewHandle( HTREEITEM hTreeItem ) 21 { 22 this->hTreeItem = hTreeItem; 23 } 8 24 }; 9 25 … … 12 28 { 13 29 std::string relationalPath; 30 31 public: 32 File( const std::string &relationalPath, HTREEITEM hTreeItem ); 33 34 const std::string &GetRelationalPath() const 35 { 36 return relationalPath; 37 } 38 const std::string GetFullPath() const; 14 39 }; 15 40 typedef std::vector<File> Files; … … 21 46 : public ItemBase 22 47 { 48 std::string name; 49 public: 23 50 Files files; 24 51 Folders folders; 52 53 Folder( const std::string &name, HTREEITEM hTreeItem ) 54 : ItemBase( hTreeItem ) 55 , name( name ) 56 { 57 } 58 59 const std::string &GetName() const 60 { 61 return name; 62 } 63 64 bool IsEmpty() const; 65 void Clear(); 66 File &FindFile( HTREEITEM hTreeItem ); 67 File &FindFile( const std::string &path ); 68 bool IsExistFile( HTREEITEM hTreeItem ) const; 69 bool IsExistFile( const std::string &path ) const; 70 void Remove( HTREEITEM hTreeItem ); 25 71 }; 26 72 27 73 class FileSystem 28 74 { 29 Files files; 30 //Folders folders; 75 public: 76 Folder root; 77 boost::mutex mutex; 78 79 FileSystem( const std::string &rootFolderName ) 80 : root( rootFolderName, NULL ) 81 { 82 } 31 83 }; 32 84 -
trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h
r624 r655 10 10 Project() 11 11 : workDir( "" ) 12 , fileSystem( "Source Files" ) 12 13 { 13 14 } … … 44 45 DWORD dwVersion; 45 46 46 CDBFileInfo *pobj_DBFileInfo;47 FM::FileSystem fileSystem; 47 48 48 49 int NumberOfMenu; -
trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
r640 r655 1136 1136 1137 1137 //ソースファイル名をtemp2へ 1138 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);1138 lstrcpy( temp2, projectInfo.fileSystem.root.files[0].GetFullPath().c_str() ); 1139 1139 1140 1140 //出力ファイル名をtemp3へ … … 1214 1214 1215 1215 //ソースファイル名をtemp2へ 1216 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);1216 lstrcpy( temp2, projectInfo.fileSystem.root.files[0].GetFullPath().c_str() ); 1217 1217 1218 1218 //出力ファイル名をtemp3へ … … 1334 1334 1335 1335 //ソースファイル名をtemp2へ 1336 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);1336 lstrcpy( temp2, projectInfo.fileSystem.root.files[0].GetFullPath().c_str() ); 1337 1337 1338 1338 //出力ファイル名をtemp3へ -
trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp
r651 r655 33 33 34 34 //解析 35 this-> pobj_DBFileInfo=new CDBFileInfo();35 this->fileSystem.root.Clear(); 36 36 bool isUseWindow = false; 37 37 for(i=0;;i++){ … … 200 200 } 201 201 if(temporary[0]=='\0') break; 202 this-> pobj_DBFileInfo->add(temporary,0);202 this->fileSystem.root.files.push_back( ActiveBasic::PM::FM::File( temporary, 0 ) ); 203 203 204 204 if(buffer[i]=='\0') break; … … 265 265 266 266 void SetStatusText(char *MenuText); 267 void MakeSourceListToProjectFile( const ActiveBasic::PM::FM::Folder &folder, char *buffer ) 268 { 269 BOOST_FOREACH( const ActiveBasic::PM::FM::Folder &childFolder, folder.folders ) 270 { 271 MakeSourceListToProjectFile( childFolder, buffer ); 272 } 273 274 BOOST_FOREACH( const ActiveBasic::PM::FM::File &file, folder.files ) 275 { 276 lstrcat( buffer, file.GetRelationalPath().c_str() ); 277 lstrcat( buffer, "\r\n" ); 278 } 279 } 280 void MakeIncludeListToProjectFile( const ActiveBasic::PM::FM::Folder &folder, char *buffer, bool isRoot ) 281 { 282 BOOST_FOREACH( const ActiveBasic::PM::FM::Folder &childFolder, folder.folders ) 283 { 284 MakeIncludeListToProjectFile( childFolder, buffer, false ); 285 } 286 287 bool isFirst = true; 288 BOOST_FOREACH( const ActiveBasic::PM::FM::File &file, folder.files ) 289 { 290 if( isRoot && isFirst ) 291 { 292 // メインファイルは除く 293 isFirst = false; 294 continue; 295 } 296 297 sprintf(buffer+lstrlen(buffer),"#include \"%s\"\r\n",file.GetRelationalPath().c_str()); 298 lstrcpy(buffer+lstrlen(buffer),"_ClearNamespaceImported\r\n"); 299 } 300 } 267 301 void Project::Save() 268 302 { 269 int i ,i2,i3,WndNum;303 int i2,i3,WndNum; 270 304 char temporary[MAX_PATH],buffer[32767]; 271 305 HWND hChild; … … 280 314 WndNum=GetWndNum(hChild); 281 315 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){ 282 if( MdiInfo[WndNum]->pMdiTextEdit->IsModified() ){ 283 for(i=0;i<this->pobj_DBFileInfo->iNum;i++){ 284 this->pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary); 285 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),temporary)==0){ 286 SaveDocument(hChild,NULL); 287 break; 288 } 316 if( MdiInfo[WndNum]->pMdiTextEdit->IsModified() ) 317 { 318 if( this->fileSystem.root.IsExistFile( MdiInfo[WndNum]->path ) ) 319 { 320 SaveDocument(hChild,NULL); 289 321 } 290 322 } … … 342 374 sprintf(buffer+i2,"#SOURCE\r\n"); 343 375 i2+=lstrlen(buffer+i2); 344 for(i=0;i<this->pobj_DBFileInfo->iNum;i++){ 345 sprintf(buffer+i2,"%s\r\n",this->pobj_DBFileInfo->ppobj_FileInfo[i]->GetPath().c_str()); 346 i2+=lstrlen(buffer+i2); 347 } 376 MakeSourceListToProjectFile( this->fileSystem.root, buffer ); 377 i2 = lstrlen( buffer ); 348 378 349 379 //保存 … … 469 499 i2+=lstrlen(buffer+i2); 470 500 } 471 if(this->pobj_DBFileInfo->iNum>1){ 501 502 { 472 503 lstrcpy(buffer+i2,"\r\n"); 473 504 i2+=lstrlen(buffer+i2); 474 505 lstrcpy(buffer+i2,"'プロジェクト内のプログラム ファイル\r\n"); 475 506 i2+=lstrlen(buffer+i2); 476 for(i=1;i<this->pobj_DBFileInfo->iNum;i++){ 477 //メインファイルは含まない 478 sprintf(buffer+i2,"#include \"%s\"\r\n",this->pobj_DBFileInfo->ppobj_FileInfo[i]->GetPath().c_str()); 479 i2+=lstrlen(buffer+i2); 480 lstrcpy(buffer+i2,"_ClearNamespaceImported\r\n"); 481 i2+=lstrlen(buffer+i2); 482 } 507 MakeIncludeListToProjectFile( this->fileSystem.root, buffer, true ); 508 i2 = lstrlen(buffer); 483 509 } 484 510 if( !this->windowInfos.empty() ) … … 548 574 hChild=GetNextWindow(hChild,GW_HWNDNEXT); 549 575 WndNum=GetWndNum(hCloseChild); 550 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)){ 551 for(i=0;i<this->pobj_DBFileInfo->iNum;i++){ 552 this->pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary); 553 if(lstrcmpi(MdiInfo[WndNum]->path.c_str(),temporary)==0){ 554 555 //変更フラグをオフにする 556 MdiInfo[WndNum]->pMdiTextEdit->UnModify(); 557 558 SendMessage(hCloseChild,WM_CLOSE,0,0); 559 break; 560 } 576 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum]->DocType)) 577 { 578 if( this->fileSystem.root.IsExistFile( MdiInfo[WndNum]->path ) ) 579 { 580 //変更フラグをオフにする 581 MdiInfo[WndNum]->pMdiTextEdit->UnModify(); 582 583 SendMessage(hCloseChild,WM_CLOSE,0,0); 561 584 } 562 585 } … … 593 616 594 617 //ファイル情報のメモリを解放 595 delete this->pobj_DBFileInfo;618 this->fileSystem.root.Clear(); 596 619 597 620 //ブレークポイントのオブジェクトを解放 -
trunk/ab5.0/abdev/abdev/stdafx.h
r651 r655 33 33 #include <boost/serialization/nvp.hpp> 34 34 #include <boost/serialization/export.hpp> 35 #include <boost/thread/thread.hpp> 35 36 36 37 #include <jenga/include/jenga.h> … … 54 55 #include <Program.h> 55 56 #include <ProjectManager/WindowManager.h> 57 #include <ProjectManager/FileManager.h> 56 58 57 59 #include "Common.h" 58 60 59 #include <ProjectManager/FileManager.h>60 61 #include <ProjectManager/ProjectManager.h>
Note:
See TracChangeset
for help on using the changeset viewer.