#include "stdafx.h" #include "common.h" #if defined(JPN) //日本語 #include "pj_msg_jpn.h" #else //英語 #include "pj_msg_eng.h" #endif void Project_CursorResInsert(void){ extern HANDLE hHeap; extern LPSTR CursorFileFilter; int i3; char temporary[MAX_PATH]; //"カーソル ファイルを指定してください" if(!GetFilePathDialog(hOwner,temporary,CursorFileFilter,STRING_FILEOPENTITLE_CURSOR,TRUE)) return; ActiveBasic::Common::ResourceItem item; item.filepath = projectInfo.GetWorkDir().GetRelationalPath( temporary ); for(i3=1;;i3++){ sprintf(temporary,"IDC_CURSOR%d",i3); bool isDuplicate = false; BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.cursorResources ) { if( resourceItem.idName == temporary ) { isDuplicate = true; break; } } if( !isDuplicate ) { break; } } item.idName = temporary; //ツリービューに追加 extern HWND hMaterialTreeView; TV_INSERTSTRUCT tv; tv.hInsertAfter=TVI_SORT; tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE; tv.item.iImage=6; tv.item.iSelectedImage=6; tv.hParent = hCursorTreeItemForProjectView; tv.item.pszText=temporary; item.hTreeItem = TreeView_InsertItem(hMaterialTreeView,&tv); TreeView_SelectItem( hMaterialTreeView, item.hTreeItem ); projectInfo.resourceManager.cursorResources.push_back( item ); projectInfo.ModifuOfResource=1; } void Project_Cursor_Delete(int CursorInfoNum){ //ツリービューから削除 extern HWND hMaterialTreeView; TreeView_DeleteItem(hMaterialTreeView,projectInfo.resourceManager.cursorResources[CursorInfoNum].hTreeItem); //projectInfo.pCursorInfo構造体から削除 Jenga::Common::EraseVectorItem( projectInfo.resourceManager.cursorResources, CursorInfoNum ); projectInfo.ModifuOfResource=1; } void Project_Cursor_RenameID(int CursorInfoNum){ extern HANDLE hHeap; extern char NewIdName[MAX_PATH]; extern HWND hMaterialTreeView; int i2; char temporary[MAX_PATH]; TVITEM tvItem; if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.resourceManager.cursorResources[CursorInfoNum].idName.c_str())) return; //重複チェック for(i2=0;i2SelectingItem[0]==SELECT_WINDOW) ChangePropertyWindow(i2,GetWndInfoNum(MdiInfo[i2].path)); } } } void Project_Bitmap_Delete(int BitmapInfoNum){ //ツリービューから削除 extern HWND hMaterialTreeView; TreeView_DeleteItem(hMaterialTreeView,projectInfo.resourceManager.bitmapResources[BitmapInfoNum].hTreeItem); //projectInfo.pBitmapInfo構造体から削除 Jenga::Common::EraseVectorItem( projectInfo.resourceManager.bitmapResources, BitmapInfoNum ); projectInfo.ModifuOfResource=1; } void Project_Bitmap_RenameID(int BitmapInfoNum){ extern HANDLE hHeap; extern char NewIdName[MAX_PATH]; extern HWND hMaterialTreeView; int i2; char temporary[MAX_PATH]; TVITEM tvItem; if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.resourceManager.bitmapResources[BitmapInfoNum].idName.c_str())) return; //重複チェック for(i2=0;i2SelectingItem[0]==SELECT_WINDOW) ChangePropertyWindow(i2,GetWndInfoNum(MdiInfo[i2].path)); } } } void Project_Icon_Delete(int IconInfoNum){ extern HANDLE hHeap; int i2; char temporary[MAX_PATH]; TVITEM tv; //ツリービューから削除 extern HWND hMaterialTreeView; TreeView_DeleteItem(hMaterialTreeView,projectInfo.resourceManager.iconResources[IconInfoNum].hTreeItem); //projectInfo.pIconInfo構造体から削除 Jenga::Common::EraseVectorItem( projectInfo.resourceManager.iconResources, IconInfoNum ); if(IconInfoNum==0&&projectInfo.resourceManager.iconResources.size()){ tv.mask=TVIF_TEXT|TVIF_HANDLE; tv.pszText=temporary; tv.cchTextMax=MAX_PATH; tv.hItem=projectInfo.resourceManager.iconResources[0].hTreeItem; TreeView_GetItem(hMaterialTreeView,&tv); lstrcat(tv.pszText," (Main)"); TreeView_SetItem(hMaterialTreeView,&tv); } projectInfo.ModifuOfResource=1; //////////////////////////////// // ウィンドウ プロパティを更新 extern MDIINFO MdiInfo[MAX_WNDNUM]; for(i2=0;i2SelectingItem[0]==SELECT_WINDOW) ChangePropertyWindow(i2,GetWndInfoNum(MdiInfo[i2].path)); } } } void Project_Icon_RenameID(int IconInfoNum){ extern HANDLE hHeap; extern char NewIdName[MAX_PATH]; extern HWND hMaterialTreeView; int i2; char temporary[MAX_PATH]; TVITEM tvItem; if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.resourceManager.iconResources[IconInfoNum].idName.c_str())) return; //重複チェック for(i2=0;i2