Index: trunk/ab5.0/abdev/abdev/ProjectControl.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/ProjectControl.cpp	(revision 621)
+++ trunk/ab5.0/abdev/abdev/ProjectControl.cpp	(revision 623)
@@ -191,9 +191,9 @@
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-						if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
-							lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path);
-							lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
-							NewIconEditWindow(temporary);
+					for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+						if(projectInfo.resourceManager.iconResources[i].hTreeItem==hTreeItem){
+							NewIconEditWindow(
+								projectInfo.GetWorkDir().GetFullPath( projectInfo.resourceManager.iconResources[i].filepath ).c_str()
+							);
 							break;
 						}
@@ -202,9 +202,9 @@
 				case IDM_MATERIALTREE_DELETE:
 					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
-					for(i=0;i<projectInfo.res.NumberOfCursorRes;i++){
-						if(projectInfo.res.pCursorResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.cursorResources.size();i++){
+						if(projectInfo.resourceManager.cursorResources[i].hTreeItem==hTreeItem){
 
 							//"%s カーソルをプロジェクトから削除します。よろしいですか？"
-							sprintf(str,STRING_PJ_CHECK_DELETECURSOR,projectInfo.res.pCursorResInfo[i].IdName);
+							sprintf(str,STRING_PJ_CHECK_DELETECURSOR,projectInfo.resourceManager.cursorResources[i].idName.c_str());
 							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
 
@@ -213,9 +213,9 @@
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++){
-						if(projectInfo.res.pBitmapResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.bitmapResources.size();i++){
+						if(projectInfo.resourceManager.bitmapResources[i].hTreeItem==hTreeItem){
 
 							//"%s ビットマップをプロジェクトから削除します。よろしいですか？"
-							sprintf(str,STRING_PJ_CHECK_DELETEBITMAP,projectInfo.res.pBitmapResInfo[i].IdName);
+							sprintf(str,STRING_PJ_CHECK_DELETEBITMAP,projectInfo.resourceManager.bitmapResources[i].idName.c_str());
 							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
 
@@ -224,9 +224,9 @@
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-						if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+						if(projectInfo.resourceManager.iconResources[i].hTreeItem==hTreeItem){
 
 							//"%s アイコンをプロジェクトから削除します。よろしいですか？"
-							sprintf(str,STRING_PJ_CHECK_DELETEICON,projectInfo.res.pIconResInfo[i].IdName);
+							sprintf(str,STRING_PJ_CHECK_DELETEICON,projectInfo.resourceManager.iconResources[i].idName.c_str());
 							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
 
@@ -261,18 +261,18 @@
 					extern char NewIdName[MAX_PATH];
 					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
-					for(i=0;i<projectInfo.res.NumberOfCursorRes;i++){
-						if(projectInfo.res.pCursorResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.cursorResources.size();i++){
+						if(projectInfo.resourceManager.cursorResources[i].hTreeItem==hTreeItem){
 							Project_Cursor_RenameID(i);
 							break;
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++){
-						if(projectInfo.res.pBitmapResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.bitmapResources.size();i++){
+						if(projectInfo.resourceManager.bitmapResources[i].hTreeItem==hTreeItem){
 							Project_Bitmap_RenameID(i);
 							break;
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-						if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+						if(projectInfo.resourceManager.iconResources[i].hTreeItem==hTreeItem){
 							Project_Icon_RenameID(i);
 						}
@@ -313,24 +313,23 @@
 					break;
 				case IDM_MATERIALTREE_ICON_SETMAIN:
-					RESITEMINFO TempIconResInfo;
 					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
-					for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-						if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+						if(projectInfo.resourceManager.iconResources[i].hTreeItem==hTreeItem){
 							if(i==0) break;
 
-							TempIconResInfo=projectInfo.res.pIconResInfo[i];
-							for(;i>0;i--)
-								projectInfo.res.pIconResInfo[i]=projectInfo.res.pIconResInfo[i-1];
-							projectInfo.res.pIconResInfo[0]=TempIconResInfo;
-
-							tvItem.hItem=projectInfo.res.pIconResInfo[1].hTreeItem;
+							ActiveBasic::Common::ResourceItem tempItem = projectInfo.resourceManager.iconResources[i];
+							Jenga::Common::EraseVectorItem<ActiveBasic::Common::ResourceItems>( projectInfo.resourceManager.iconResources, i );
+							projectInfo.resourceManager.iconResources.insert( projectInfo.resourceManager.iconResources.begin(), tempItem );
+
+							tvItem.hItem=projectInfo.resourceManager.iconResources[1].hTreeItem;
 							tvItem.mask=TVIF_TEXT;
-							tvItem.pszText=projectInfo.res.pIconResInfo[1].IdName;
-							tvItem.cchTextMax=lstrlen(projectInfo.res.pIconResInfo[1].IdName)+1;
+							lstrcpy( temporary, projectInfo.resourceManager.iconResources[1].idName.c_str() );
+							tvItem.pszText = temporary;
+							tvItem.cchTextMax=lstrlen(temporary)+1;
 							TreeView_SetItem(hMaterialTreeView,&tvItem);
 
-							tvItem.hItem=projectInfo.res.pIconResInfo[0].hTreeItem;
+							tvItem.hItem=projectInfo.resourceManager.iconResources[0].hTreeItem;
 							tvItem.mask=TVIF_TEXT;
-							sprintf(temporary,"%s (Main)",projectInfo.res.pIconResInfo[0].IdName);
+							sprintf(temporary,"%s (Main)",projectInfo.resourceManager.iconResources[0].idName.c_str());
 							tvItem.pszText=temporary;
 							tvItem.cchTextMax=lstrlen(temporary)+1;
@@ -1142,10 +1141,11 @@
 	tv.item.pszText=temporary;
 	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
-	projectInfo.res.hCursorTreeItem=tv.hParent;
-	for(i=0;i<projectInfo.res.NumberOfCursorRes;i++){
+	hCursorTreeItemForProjectView = tv.hParent;
+	for(i=0;i<projectInfo.resourceManager.cursorResources.size();i++){
 		tv.item.iImage=6;
 		tv.item.iSelectedImage=6;
-		tv.item.pszText=projectInfo.res.pCursorResInfo[i].IdName;
-		projectInfo.res.pCursorResInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+		lstrcpy( temporary, projectInfo.resourceManager.cursorResources[i].idName.c_str() );
+		tv.item.pszText=temporary;
+		projectInfo.resourceManager.cursorResources[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
 	}
 
@@ -1157,10 +1157,11 @@
 	tv.item.pszText=temporary;
 	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
-	projectInfo.res.hBitmapTreeItem=tv.hParent;
-	for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++){
+	hBitmapTreeItemForProjectView = tv.hParent;
+	for(i=0;i<projectInfo.resourceManager.bitmapResources.size();i++){
 		tv.item.iImage=5;
 		tv.item.iSelectedImage=5;
-		tv.item.pszText=projectInfo.res.pBitmapResInfo[i].IdName;
-		projectInfo.res.pBitmapResInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+		lstrcpy( temporary, projectInfo.resourceManager.bitmapResources[i].idName.c_str() );
+		tv.item.pszText=temporary;
+		projectInfo.resourceManager.bitmapResources[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
 	}
 
@@ -1172,14 +1173,17 @@
 	tv.item.pszText=temporary;
 	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
-	projectInfo.res.hIconTreeItem=tv.hParent;
-	for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
+	hIconTreeItemForProjectView = tv.hParent;
+	for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
 		tv.item.iImage=4;
 		tv.item.iSelectedImage=4;
 		if(i==0){
-			sprintf(temporary,"%s (Main)",projectInfo.res.pIconResInfo[i].IdName);
-			tv.item.pszText=temporary;
+			sprintf(temporary,"%s (Main)",projectInfo.resourceManager.iconResources[i].idName.c_str());
 		}
-		else tv.item.pszText=projectInfo.res.pIconResInfo[i].IdName;
-		projectInfo.res.pIconResInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+		else
+		{
+			sprintf(temporary,"%s",projectInfo.resourceManager.iconResources[i].idName.c_str());
+		}
+		tv.item.pszText=temporary;
+		projectInfo.resourceManager.iconResources[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
 	}
 
@@ -1353,6 +1357,6 @@
 						}
 						else if(lstrcmpi(temporary,"icon")==0){
-							for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++){
-								if(lstrcmpi(projectInfo.res.pIconResInfo[i3].path,temp2)==0){
+							for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++){
+								if(lstrcmpi(projectInfo.resourceManager.iconResources[i3].filepath.c_str(),temp2)==0){
 									NewIconEditWindow( projectInfo.GetWorkDir().GetFullPath( temp2 ).c_str() );
 									break;
@@ -1474,6 +1478,6 @@
 						}
 						else if(lstrcmpi(temporary,"icon")==0){
-							for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++){
-								if(lstrcmpi(projectInfo.res.pIconResInfo[i3].path,temp2)==0){
+							for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++){
+								if(lstrcmpi(projectInfo.resourceManager.iconResources[i3].filepath.c_str(),temp2)==0){
 									NewIconEditWindow( projectInfo.GetWorkDir().GetFullPath( temp2 ).c_str() );
 									break;
@@ -1593,6 +1597,6 @@
 		else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
 			if(MdiInfo[WndNum].MdiIconEditInfo->bModify){
-				for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-					lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path);
+				for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+					lstrcpy(temporary,projectInfo.resourceManager.iconResources[i].filepath.c_str());
 					lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
 					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) sw=1;
@@ -1686,9 +1690,9 @@
 		}
 		else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
-			for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-				lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path);
+			for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+				lstrcpy(temporary,projectInfo.resourceManager.iconResources[i].filepath.c_str());
 				lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
 				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
-					sprintf(buffer+i2,"icon,%s\r\n",projectInfo.res.pIconResInfo[i].path);
+					sprintf(buffer+i2,"icon,%s\r\n",projectInfo.resourceManager.iconResources[i].filepath.c_str());
 					i2+=lstrlen(buffer+i2);
 					break;
