Changeset 619 in dev
- Timestamp:
- May 19, 2008, 5:41:26 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev/abdev
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/ClassTree.cpp
r618 r619 199 199 void CClassTreeView::InsertRootFolder(void){ 200 200 char temporary[VN_SIZE]; 201 sprintf(temporary,"%s クラス",projectInfo. name);201 sprintf(temporary,"%s クラス",projectInfo.GetName().c_str()); 202 202 hRootFolder=insert( 203 203 TVI_ROOT, … … 549 549 LockWindowUpdate(hProcedureTreeView); 550 550 551 if( projectInfo.name[0]){551 if( projectInfo.IsOpened() ){ 552 552 // プロジェクトが開かれているとき 553 553 if(iFileNum==-1){ -
trunk/ab5.0/abdev/abdev/Common.h
r617 r619 978 978 void Project_File_Delete(HTREEITEM hTreeItem); 979 979 void MakeNewProject(void); 980 void OpenProject(char *path);981 980 BOOL ProjectModifyCheck(BOOL bRun); 982 _int8 CloseProject(void);983 981 void MakeWorkFile(void); 984 982 void SaveProject(void); … … 991 989 HGLOBAL Rad_GetChildInfoClipboardData(int WndNum,int WndInfoNum); 992 990 void Rad_PasteChildInfoClipboardData(int WndNum,HGLOBAL hGlobal); 993 char *PermutationWndPgmTemplate(char *pBuf,c har *pPjName, char *pWndName, char *pHandleName, char *pProcName);991 char *PermutationWndPgmTemplate(char *pBuf,const char *pPjName, char *pWndName, char *pHandleName, char *pProcName); 994 992 void GetItemClassName(char *buffer,int Control); 995 993 void SaveWindowProgram(); -
trunk/ab5.0/abdev/abdev/Debugger.cpp
r618 r619 38 38 hChild=GetWindow(hClient,GW_CHILD); 39 39 40 if( projectInfo.name[0]){40 if( projectInfo.IsOpened() ){ 41 41 //有効(プロジェクトを開いているとき) 42 42 bEnableDocument=1; -
trunk/ab5.0/abdev/abdev/DialogBoxes.cpp
r618 r619 641 641 SetFocus(GetDlgItem(hwnd,IDC_FILETYPELIST)); 642 642 643 if( projectInfo.name[0]){643 if( projectInfo.IsOpened() ){ 644 644 SendDlgItemMessage(hwnd,IDC_ADDTOPROJECT,BM_SETCHECK,BST_CHECKED,0); 645 645 } … … 729 729 } 730 730 } 731 if(i!=ListView_GetItemCount(hListView)&& projectInfo.name[0]&&(731 if(i!=ListView_GetItemCount(hListView)&& projectInfo.IsOpened() &&( 732 732 lvItem.lParam==FT_BASICPROGRAM|| 733 733 lvItem.lParam==FT_SUBPROGRAM … … 927 927 SetSwitch[3]=1; 928 928 929 if(projectInfo.dwModuleType!=MT_DLL){ 929 if( projectInfo.GetModuleType() != ActiveBasic::Common::TargetModuleType::Dll ) 930 { 930 931 EnableWindow(GetDlgItem(hwnd,IDC_EXE_PATH),0); 931 932 EnableWindow(GetDlgItem(hwnd,IDC_DIR),0); -
trunk/ab5.0/abdev/abdev/DocumentAdvice.cpp
r618 r619 256 256 //参照ディレクトリ 257 257 char *pDefaultDir; 258 if( projectInfo.name[0])258 if( projectInfo.IsOpened() ) 259 259 pDefaultDir=projectInfo.dir; 260 260 else pDefaultDir=pj_editor_Dir; -
trunk/ab5.0/abdev/abdev/DrawBuffer.cpp
r618 r619 191 191 //ブレークポイントの描画を準備 192 192 CFileBreakPoint *pobj_FileBreakPoint=0; 193 if( projectInfo.name[0]){193 if( projectInfo.IsOpened() ){ 194 194 pobj_FileBreakPoint= 195 195 projectInfo.pobj_DBBreakPoint->EnumLines(MdiInfo[m_WndNum].path); -
trunk/ab5.0/abdev/abdev/FileOperation.cpp
r618 r619 301 301 pobj_nv->pobj_ProjectHistory->insert(OpenFileName); 302 302 303 OpenProject(OpenFileName);303 projectInfo.Open(OpenFileName); 304 304 return 0; 305 305 } … … 348 348 349 349 if(projectInfo.ModifyOfMaterial){ 350 sprintf(temporary,"%s%s.wnd",projectInfo.dir,projectInfo. name);350 sprintf(temporary,"%s%s.wnd",projectInfo.dir,projectInfo.GetName().c_str()); 351 351 SaveWindowFile( temporary, projectInfo.windowInfos ); 352 352 -
trunk/ab5.0/abdev/abdev/ParameterHint.cpp
r618 r619 33 33 char temporary[MAX_PATH],*pBuf; 34 34 35 if( projectInfo.name[0]){35 if( projectInfo.IsOpened() ){ 36 36 //プロジェクトが開かれているとき 37 37 lstrcpy(temporary,projectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->m_path); -
trunk/ab5.0/abdev/abdev/ProjectControl.cpp
r618 r619 133 133 if(pobj_ClassTreeView->pProcInfo[i].hTreeItem==hTreeItem){ 134 134 135 if( projectInfo. name[0]){135 if( projectInfo.IsOpened() ){ 136 136 // 対象ファイルを開く 137 137 lstrcpy(temporary, … … 559 559 560 560 hOldFont=(HFONT)SelectObject(hdc,hStatusFont); 561 if( projectInfo. name[0]){562 sprintf(temporary,"%s \'%s\'",STRING_PROJECT,projectInfo. name);561 if( projectInfo.IsOpened() ){ 562 sprintf(temporary,"%s \'%s\'",STRING_PROJECT,projectInfo.GetName().c_str()); 563 563 } 564 564 else{ … … 707 707 708 708 //既にプロジェクトが開かれている場合は閉じる 709 if( projectInfo.name[0]){710 if(! CloseProject()) return;709 if( projectInfo.IsOpened() ){ 710 if(!projectInfo.Close()) return; 711 711 } 712 712 … … 1109 1109 1110 1110 sprintf(temporary,"%s%s.pj",dir,NewProjectInfo.name); 1111 OpenProject(temporary);1111 projectInfo.Open(temporary); 1112 1112 SaveProject(); 1113 1113 } … … 1119 1119 TV_INSERTSTRUCT tv; 1120 1120 1121 sprintf(temporary,"%s ",projectInfo. name);1121 sprintf(temporary,"%s ",projectInfo.GetName().c_str()); 1122 1122 lstrcat(temporary,STRING_PROJECT); 1123 1123 SetWindowText(hProjectView,temporary); … … 1215 1215 } 1216 1216 } 1217 void OpenProject(char *path){ 1217 void OpenWorkfile( const std::string &path ) 1218 { 1218 1219 extern HANDLE hHeap; 1219 1220 int i,i2,i3; 1220 1221 char *buffer,temporary[MAX_PATH],temp2[MAX_PATH]; 1221 1222 //既にプロジェクトが開かれている場合は閉じる1223 if(projectInfo.name[0]){1224 if(!CloseProject()) return;1225 }1226 //memset(&projectInfo,0,sizeof(PROJECTINFO));1227 1228 //プロジェクトの作業ディレクトリを取得1229 _splitpath(path,projectInfo.dir,temporary,0,0);1230 lstrcat(projectInfo.dir,temporary);1231 1232 //ファイルを開く、保存の初期ディレクトリをセット1233 lstrcpy(pobj_nv->DefSaveDir,projectInfo.dir);1234 1235 1236 //////////////////////////////////////////1237 // リソースデータ用領域を確保1238 projectInfo.res.pCursorResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);1239 projectInfo.res.NumberOfCursorRes=0;1240 projectInfo.res.pBitmapResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);1241 projectInfo.res.NumberOfBitmapRes=0;1242 projectInfo.res.pIconResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);1243 projectInfo.res.NumberOfIconRes=0;1244 1245 1246 //////////////////////////////////////////1247 //プロジェクトファイル(*.pj)をオープン1248 buffer=ReadBuffer(path);1249 if(!buffer) return;1250 1251 //解析1252 projectInfo.pobj_DBFileInfo=new CDBFileInfo();1253 bool isUseWindow = false;1254 for(i=0;;i++){1255 if(buffer[i]=='\0') break;1256 if(buffer[i]=='\r'&&buffer[i+1]=='\n'&&buffer[i+2]=='#'){1257 for(i+=3,i2=0;;i++,i2++){1258 if(!IsVariableChar(buffer[i])){1259 temporary[i2]=0;1260 break;1261 }1262 temporary[i2]=buffer[i];1263 }1264 if(lstrcmpi(temporary,"VERSION")==0&&buffer[i]=='='){1265 for(i++,i2=0;;i++,i2++){1266 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1267 temporary[i2]=0;1268 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1269 break;1270 }1271 temporary[i2]=buffer[i];1272 }1273 projectInfo.dwVersion=GetValue(temporary);1274 }1275 else if(lstrcmpi(temporary,"MODULETYPE")==0&&buffer[i]=='='){1276 for(i++,i2=0;;i++,i2++){1277 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1278 temporary[i2]=0;1279 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1280 break;1281 }1282 temporary[i2]=buffer[i];1283 }1284 projectInfo.dwModuleType=atoi(temporary);1285 }1286 else if(lstrcmpi(temporary,"NAME")==0&&buffer[i]=='='){1287 for(i++,i2=0;;i++,i2++){1288 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1289 projectInfo.name[i2]=0;1290 break;1291 }1292 projectInfo.name[i2]=buffer[i];1293 }1294 }1295 else if(lstrcmpi(temporary,"PLATFORM")==0&&buffer[i]=='='){1296 for(i++,i2=0;;i++,i2++){1297 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1298 temporary[i2]=0;1299 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1300 break;1301 }1302 temporary[i2]=buffer[i];1303 }1304 i2=atoi(temporary);1305 extern HWND hSelectCompilerCombo;1306 if(i2==32){1307 //プラットフォームにWin32を選択1308 SendMessage(hSelectCompilerCombo,CB_SETCURSEL,0,0);1309 }1310 else if(i2==64){1311 //プラットフォームにWin64を選択1312 SendMessage(hSelectCompilerCombo,CB_SETCURSEL,1,0);1313 }1314 SendMessage(hSelectCompilerCombo,WM_COMMAND,MAKELONG(0,CBN_SELCHANGE),0);1315 }1316 else if(lstrcmpi(temporary,"USEWINDOW")==0&&buffer[i]=='='){1317 for(i++,i2=0;;i++,i2++){1318 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1319 temporary[i2]=0;1320 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1321 break;1322 }1323 temporary[i2]=buffer[i];1324 }1325 if( atoi(temporary) > 0 )1326 {1327 isUseWindow = true;1328 }1329 }1330 else if(lstrcmpi(temporary,"OPTION")==0&&buffer[i]=='='){1331 for(i++,i2=0;;i++,i2++){1332 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1333 temporary[i2]=0;1334 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1335 break;1336 }1337 temporary[i2]=buffer[i];1338 }1339 projectInfo.dwOption=GetValue(temporary);1340 }1341 else if(lstrcmpi(temporary,"OUTPUT_RELEASE")==0&&buffer[i]=='='){1342 for(i++,i2=0;;i++,i2++){1343 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1344 temporary[i2]=0;1345 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1346 break;1347 }1348 temporary[i2]=buffer[i];1349 }1350 lstrcpy(projectInfo.lpszOutput_Release,temporary);1351 }1352 else if(lstrcmpi(temporary,"OUTPUT_DEBUG")==0&&buffer[i]=='='){1353 for(i++,i2=0;;i++,i2++){1354 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1355 temporary[i2]=0;1356 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1357 break;1358 }1359 temporary[i2]=buffer[i];1360 }1361 lstrcpy(projectInfo.lpszOutput_Debug,temporary);1362 }1363 else if(lstrcmpi(temporary,"MANIFEST")==0&&buffer[i]=='='){1364 for(i++,i2=0;;i++,i2++){1365 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1366 temporary[i2]=0;1367 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1368 break;1369 }1370 temporary[i2]=buffer[i];1371 }1372 lstrcpy(projectInfo.szManifestPath,temporary);1373 }1374 else if(lstrcmpi(temporary,"DEBUG_CMD_LINE")==0&&buffer[i]=='='){1375 for(i++,i2=0;;i++,i2++){1376 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1377 temporary[i2]=0;1378 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1379 break;1380 }1381 temporary[i2]=buffer[i];1382 }1383 lstrcpy(projectInfo.szCmdLine,temporary);1384 }1385 else if(lstrcmpi(temporary,"DEBUG_EXE_PATH")==0&&buffer[i]=='='){1386 for(i++,i2=0;;i++,i2++){1387 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1388 temporary[i2]=0;1389 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1390 break;1391 }1392 temporary[i2]=buffer[i];1393 }1394 lstrcpy(projectInfo.szExePath,temporary);1395 }1396 else if(lstrcmpi(temporary,"RESOURCE")==0&&buffer[i]=='='){1397 for(i++,i2=0;;i++,i2++){1398 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1399 temporary[i2]=0;1400 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1401 break;1402 }1403 temporary[i2]=buffer[i];1404 }1405 if(temporary[0]!='\0'&&(!(temporary[0]=='0'&&temporary[1]=='\0'))){1406 lstrcpy(projectInfo.ResourceFileName,temporary);1407 GetResourceData();1408 }1409 else{1410 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.name);1411 }1412 }1413 else if(lstrcmpi(temporary,"SOURCE")==0&&buffer[i]=='\r'&&buffer[i+1]=='\n'){1414 while(1){1415 for(i+=2,i2=0;;i++,i2++){1416 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1417 temporary[i2]=0;1418 break;1419 }1420 temporary[i2]=buffer[i];1421 }1422 if(temporary[0]=='\0') break;1423 projectInfo.pobj_DBFileInfo->add(temporary,0);1424 1425 if(buffer[i]=='\0') break;1426 }1427 }1428 else{1429 //不明なパラメータは無視1430 for(i++;;i++){1431 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){1432 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;1433 break;1434 }1435 }1436 }1437 if(buffer[i]=='\0') break;1438 }1439 }1440 HeapDefaultFree(buffer);1441 1442 //古いバージョンファイルを考慮1443 if(projectInfo.dwVersion<=4){1444 if(projectInfo.dwModuleType==MT_DLL)1445 sprintf(projectInfo.lpszOutput_Release,".\\%s.dll",projectInfo.name);1446 else sprintf(projectInfo.lpszOutput_Release,".\\%s.exe",projectInfo.name);1447 sprintf(projectInfo.lpszOutput_Debug,".\\%s_debug.exe",projectInfo.name);1448 }1449 1450 //ブレークポイントを初期化1451 projectInfo.pobj_DBBreakPoint=new CDBBreakPoint();1452 1453 1454 if( isUseWindow )1455 {1456 /////////////////////////////////////////////1457 //ウィンドウ定義ファイル(*.wnd)をオープン1458 sprintf(temp2,"%s%s.wnd",projectInfo.dir,projectInfo.name);1459 if(!OpenWindowFile(temp2)) return;1460 }1461 else{1462 projectInfo.windowInfos.Clear();1463 1464 projectInfo.NumberOfMenu=0;1465 projectInfo.pMenuInfo=(MENU_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);1466 }1467 1468 1222 1469 1223 //プロジェクト ビューを設定、表示 … … 1485 1239 HWND hChild; 1486 1240 int WndNum; 1487 sprintf(temp2,"%s%s.wrk",projectInfo.dir,projectInfo.name); 1488 hFind=FindFirstFile(temp2,&wfd); 1241 hFind=FindFirstFile(path.c_str(),&wfd); 1489 1242 if(hFind!=INVALID_HANDLE_VALUE){ 1490 1243 FindClose(hFind); 1491 buffer=ReadBuffer( temp2);1244 buffer=ReadBuffer(path); 1492 1245 if(!buffer) return; 1493 1246 … … 1802 1555 1803 1556 //ウィンドウ タイトルを変更 1804 sprintf(temporary,"%s - %s",projectInfo. name,APPLICATION_NAME);1557 sprintf(temporary,"%s - %s",projectInfo.GetName().c_str(),APPLICATION_NAME); 1805 1558 SetWindowText(hOwner,temporary); 1806 1807 1808 projectInfo.modify=0;1809 projectInfo.ModifyOfMaterial=0;1810 projectInfo.ModifuOfResource=0;1811 1559 } 1812 1560 BOOL ProjectModifyCheck(BOOL bRun){ … … 1818 1566 if(bRun==0||pobj_nv->bSaveCheckProject){ 1819 1567 //"\"%s\" プロジェクトは変更されています。保存しますか?" 1820 sprintf(temporary,STRING_MODIFYCHECK_PROJECT,projectInfo. name);1568 sprintf(temporary,STRING_MODIFYCHECK_PROJECT,projectInfo.GetName().c_str()); 1821 1569 i=MessageBox(hOwner,temporary,APPLICATION_NAME,MB_YESNOCANCEL|MB_ICONEXCLAMATION); 1822 1570 … … 1852 1600 if(bRun==0||pobj_nv->bSaveCheckProject){ 1853 1601 //"\"%s\" プロジェクトは変更されています。保存しますか?" 1854 sprintf(temporary,STRING_MODIFYCHECK_PROJECT,projectInfo. name);1602 sprintf(temporary,STRING_MODIFYCHECK_PROJECT,projectInfo.GetName().c_str()); 1855 1603 i=MessageBox(hOwner,temporary,APPLICATION_NAME,MB_YESNOCANCEL|MB_ICONEXCLAMATION); 1856 1604 … … 1864 1612 } 1865 1613 return 2; 1866 }1867 _int8 CloseProject(void){1868 extern HANDLE hHeap;1869 extern MDIINFO MdiInfo[MAX_WNDNUM];1870 int i,i2,WndNum;1871 HWND hChild,hCloseChild;1872 char temporary[MAX_PATH];1873 1874 1875 //保存確認1876 i=ProjectModifyCheck(0);1877 if(i==0) return 0;1878 else if(i==2) MakeWorkFile();1879 1880 //プロジェクトに関するMDIウィンドウをすべて閉じる1881 hChild=GetWindow(hClient,GW_CHILD);1882 while(hChild){1883 hCloseChild=hChild;1884 hChild=GetNextWindow(hChild,GW_HWNDNEXT);1885 WndNum=GetWndNum(hCloseChild);1886 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){1887 for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){1888 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);1889 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){1890 1891 //変更フラグをオフにする1892 MdiInfo[WndNum].pMdiTextEdit->UnModify();1893 1894 SendMessage(hCloseChild,WM_CLOSE,0,0);1895 break;1896 }1897 }1898 }1899 else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){1900 BOOST_FOREACH( const WindowInfo *pWindowInfo, projectInfo.windowInfos )1901 {1902 if( pWindowInfo->GetName() == MdiInfo[WndNum].path ){1903 SendMessage(hCloseChild,WM_CLOSE,0,0);1904 break;1905 }1906 }1907 }1908 else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){1909 for(i=0;i<projectInfo.NumberOfMenu;i++){1910 if(lstrcmp(MdiInfo[WndNum].path,projectInfo.pMenuInfo[i].IdName)==0){1911 SendMessage(hCloseChild,WM_CLOSE,0,0);1912 break;1913 }1914 }1915 }1916 else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){1917 for(i=0;projectInfo.res.NumberOfIconRes;i++){1918 lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path);1919 GetFullPath(temporary,projectInfo.dir);1920 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){1921 SendMessage(hCloseChild,WM_CLOSE,0,0);1922 break;1923 }1924 }1925 }1926 }1927 1928 //ファイル情報のメモリを解放1929 delete projectInfo.pobj_DBFileInfo;1930 1931 //ブレークポイントのオブジェクトを解放1932 delete projectInfo.pobj_DBBreakPoint;1933 1934 //ウィンドウ情報のメモリを解放1935 BOOST_FOREACH( WindowInfo *pWindowInfo, projectInfo.windowInfos )1936 {1937 HeapDefaultFree(pWindowInfo->caption);1938 HeapDefaultFree(pWindowInfo->ClassName);1939 HeapDefaultFree(pWindowInfo->CallBackName);1940 HeapDefaultFree(pWindowInfo->filepath);1941 if(pWindowInfo->MenuID)1942 HeapDefaultFree(pWindowInfo->MenuID);1943 if(pWindowInfo->IconResName)1944 HeapDefaultFree(pWindowInfo->IconResName);1945 1946 //子ウィンドウのメモリを解放1947 for(i2=0;i2<pWindowInfo->childWindowInfos.size();i2++){1948 HeapDefaultFree(pWindowInfo->childWindowInfos[i2]->IdName);1949 HeapDefaultFree(pWindowInfo->childWindowInfos[i2]->caption);1950 if(pWindowInfo->childWindowInfos[i2]->Control==CT_IMAGEBOX){1951 //イメージ ボックスの場合1952 HeapDefaultFree(pWindowInfo->childWindowInfos[i2]->ImageCtrlInfo.path);1953 }1954 1955 delete pWindowInfo->childWindowInfos[i2];1956 }1957 pWindowInfo->childWindowInfos.clear();1958 }1959 projectInfo.windowInfos.Clear();1960 1961 //メニュー情報のメモリを解放1962 HeapMenuDataFree(projectInfo.pMenuInfo,projectInfo.NumberOfMenu,0);1963 HeapDefaultFree(projectInfo.pMenuInfo);1964 1965 //リソースのメモリを解放1966 for(i=0;i<projectInfo.res.NumberOfCursorRes;i++){1967 HeapDefaultFree(projectInfo.res.pCursorResInfo[i].IdName);1968 HeapDefaultFree(projectInfo.res.pCursorResInfo[i].path);1969 }1970 HeapDefaultFree(projectInfo.res.pCursorResInfo);1971 for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++){1972 HeapDefaultFree(projectInfo.res.pBitmapResInfo[i].IdName);1973 HeapDefaultFree(projectInfo.res.pBitmapResInfo[i].path);1974 }1975 HeapDefaultFree(projectInfo.res.pBitmapResInfo);1976 for(i=0;i<projectInfo.res.NumberOfIconRes;i++){1977 HeapDefaultFree(projectInfo.res.pIconResInfo[i].IdName);1978 HeapDefaultFree(projectInfo.res.pIconResInfo[i].path);1979 }1980 HeapDefaultFree(projectInfo.res.pIconResInfo);1981 1982 //プロジェクト ビューを非表示にする1983 extern HWND hProjectView;1984 if(IsWindowVisible(hProjectView)) SendMessage(hOwner,WM_COMMAND,IDM_PROJECTVIEW,0);1985 SetWindowText(hProjectView,"Project View");1986 1987 TreeView_DeleteAllItems(pobj_FileTree->hTree);1988 TreeView_DeleteAllItems(hProcedureTreeView);1989 TreeView_DeleteAllItems(hMaterialTreeView);1990 1991 //ウィンドウ タイトルを変更1992 SetWindowText(hOwner,APPLICATION_NAME);1993 1994 projectInfo.name[0]=0;1995 1996 //メニュー状態を設定1997 ResetState_DocMenu();1998 1999 return 1;2000 1614 } 2001 1615 void MakeWorkFile(void){ … … 2116 1730 2117 1731 //保存 2118 sprintf(temporary,"%s%s.wrk",projectInfo.dir,projectInfo. name);1732 sprintf(temporary,"%s%s.wrk",projectInfo.dir,projectInfo.GetName().c_str()); 2119 1733 WriteBuffer(temporary,buffer,i2); 2120 1734 } … … 2167 1781 sprintf(buffer+i2,"#VERSION=%d\r\n\r\n",projectInfo.dwVersion); 2168 1782 i2+=lstrlen(buffer+i2); 2169 sprintf(buffer+i2,"#MODULETYPE=%d\r\n\r\n", projectInfo.dwModuleType);1783 sprintf(buffer+i2,"#MODULETYPE=%d\r\n\r\n",(int)projectInfo.GetModuleType()); 2170 1784 i2+=lstrlen(buffer+i2); 2171 sprintf(buffer+i2,"#NAME=%s\r\n\r\n",projectInfo. name);1785 sprintf(buffer+i2,"#NAME=%s\r\n\r\n",projectInfo.GetName().c_str()); 2172 1786 i2+=lstrlen(buffer+i2); 2173 1787 extern HWND hSelectCompilerCombo; 2174 1788 if(SendMessage(hSelectCompilerCombo,CB_GETCURSEL,0,0)==0){ 2175 sprintf(buffer+i2,"#PLATFORM=32\r\n\r\n",projectInfo. name);1789 sprintf(buffer+i2,"#PLATFORM=32\r\n\r\n",projectInfo.GetName().c_str()); 2176 1790 i2+=lstrlen(buffer+i2); 2177 1791 } 2178 1792 else{ 2179 sprintf(buffer+i2,"#PLATFORM=64\r\n\r\n",projectInfo. name);1793 sprintf(buffer+i2,"#PLATFORM=64\r\n\r\n",projectInfo.GetName().c_str()); 2180 1794 i2+=lstrlen(buffer+i2); 2181 1795 } … … 2210 1824 2211 1825 //保存 2212 sprintf(temporary,"%s%s.pj",projectInfo.dir,projectInfo. name);1826 sprintf(temporary,"%s%s.pj",projectInfo.dir,projectInfo.GetName().c_str()); 2213 1827 WriteBuffer(temporary,buffer,i2); 2214 1828 … … 2353 1967 lstrcpy(buffer+i2,"#include \"resource.ab\"\r\n"); 2354 1968 i2+=lstrlen(buffer+i2); 2355 sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",projectInfo. name);1969 sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",projectInfo.GetName().c_str()); 2356 1970 i2+=lstrlen(buffer+i2); 2357 1971 } 2358 1972 2359 1973 //保存 2360 sprintf(temporary,"%s%s.idx",projectInfo.dir,projectInfo. name);1974 sprintf(temporary,"%s%s.idx",projectInfo.dir,projectInfo.GetName().c_str()); 2361 1975 WriteBuffer(temporary,buffer,i2); 2362 1976 … … 2367 1981 //ウィンドウ関連ファイル(*.wnd)を作成、保存 2368 1982 if(projectInfo.ModifyOfMaterial){ 2369 sprintf(temporary,"%s%s.wnd",projectInfo.dir,projectInfo. name);1983 sprintf(temporary,"%s%s.wnd",projectInfo.dir,projectInfo.GetName().c_str()); 2370 1984 SaveWindowFile( temporary, projectInfo.windowInfos ); 2371 1985 } -
trunk/ab5.0/abdev/abdev/Replace.cpp
r618 r619 114 114 115 115 //ブレークポイントのオフセット分を計算 116 if( projectInfo.name[0]){116 if( projectInfo.IsOpened() ){ 117 117 projectInfo.pobj_DBBreakPoint->replace( 118 118 MdiInfo[WndNum].path, … … 180 180 181 181 182 //if( projectInfo.name[0]){182 //if( projectInfo.IsOpened() ){ 183 183 //プロジェクトが開かれているとき 184 184 if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC){ -
trunk/ab5.0/abdev/abdev/Resource.cpp
r618 r619 139 139 140 140 if(!projectInfo.ResourceFileName[0]) 141 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo. name);141 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str()); 142 142 143 143 //"カーソル ファイルを指定してください" … … 243 243 244 244 if(!projectInfo.ResourceFileName[0]) 245 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo. name);245 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str()); 246 246 247 247 //"ビットマップ ファイルを指定してください" … … 357 357 358 358 if(!projectInfo.ResourceFileName[0]) 359 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo. name);359 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str()); 360 360 361 361 //"アイコン ファイルを指定してください" -
trunk/ab5.0/abdev/abdev/WindowControl.cpp
r618 r619 275 275 276 276 //テンプレートソースファイルに値をセットする 277 char *PermutationWndPgmTemplate(char *pBuf,c har *pPjName, char *pWndName, char *pHandleName, char *pProcName){277 char *PermutationWndPgmTemplate(char *pBuf,const char *pPjName, char *pWndName, char *pHandleName, char *pProcName){ 278 278 extern HANDLE hHeap; 279 279 int i,i2; … … 1149 1149 ////////////////////////// 1150 1150 //オブジェクトの解放処理 1151 sprintf(buffer+i2,"Sub %s_DestroyObjects()\r\n",projectInfo. name);1151 sprintf(buffer+i2,"Sub %s_DestroyObjects()\r\n",projectInfo.GetName().c_str()); 1152 1152 i2+=lstrlen(buffer+i2); 1153 1153 … … 2282 2282 //#name#をプロジェクト名に置換 2283 2283 pTemp=PermutationWndPgmTemplate(pTemp, 2284 projectInfo. name,2284 projectInfo.GetName().c_str(), 2285 2285 NewWindow.name, 2286 2286 NewWindow.HandleName, -
trunk/ab5.0/abdev/abdev/abdev.cpp
r618 r619 109 109 } 110 110 int GetFileNum(int WndNum){ 111 if( !projectInfo. name[0]){111 if( !projectInfo.IsOpened() ){ 112 112 return -1; 113 113 } … … 693 693 ///////////////////////////////////////////////// 694 694 695 if( projectInfo.name[0]){695 if( projectInfo.IsOpened() ){ 696 696 pobj_MainMenu->EnableItem(IDM_ALLSAVE,MF_ENABLED); 697 697 pobj_StandardToolbar->EnableItem(IDM_ALLSAVE,1); … … 954 954 ResetState_DocMenu(); 955 955 956 if( DocumentType == WNDTYPE_BASIC && projectInfo.name[0] == '\0'){956 if( DocumentType == WNDTYPE_BASIC && !projectInfo.IsOpened() ){ 957 957 // 単体ソースコードを開いたとき 958 958 if( !IsWindowVisible( hProjectView ) ){ … … 1150 1150 pobj_MainTab->MdiActiveEvent(MdiInfo[i].title); 1151 1151 1152 if( !projectInfo. name[0]){1152 if( !projectInfo.IsOpened() ){ 1153 1153 ResetClassTree(-1); 1154 1154 } … … 1710 1710 1711 1711 if(!TranslateAccelerator(hOwner,hAccel,&msg)){ 1712 if( projectInfo.name[0]){1712 if( projectInfo.IsOpened() ){ 1713 1713 for(i=0,i2=0;i<MAX_WNDNUM;i++){ 1714 1714 if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){ -
trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h
r618 r619 7 7 { 8 8 public: 9 DWORD dwModuleType;10 9 11 char name[MAX_PATH]; 10 void Open( char *path ); 11 bool Close(); 12 13 const std::string &GetName() const 14 { 15 return name; 16 } 17 18 bool IsOpened() const 19 { 20 return !name.empty(); 21 } 22 23 ActiveBasic::Common::TargetModuleType::EnumType GetModuleType() const 24 { 25 return moduleType; 26 } 27 12 28 char dir[MAX_PATH]; 13 29 … … 45 61 _int8 modify; 46 62 47 bool IsOpenedProject() const 48 { 49 return ( name[0] != '\0' ); 50 } 63 private: 64 std::string name; 65 ActiveBasic::Common::TargetModuleType::EnumType moduleType; 51 66 }; 52 67 -
trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
r618 r619 88 88 89 89 //プロジェクトを閉じる 90 if( projectInfo.name[0]){91 if(! CloseProject()) return;90 if( projectInfo.IsOpened() ){ 91 if(!projectInfo.Close()) return; 92 92 } 93 93 … … 506 506 } 507 507 508 OpenProject(temporary);508 projectInfo.Open(temporary); 509 509 } 510 510 … … 516 516 void MainFrame::OnCmdProjectClose( UINT uNotifyCode, int nID, CWindow wndCtl ) 517 517 { 518 CloseProject();518 projectInfo.Close(); 519 519 } 520 520 … … 550 550 if(MdiInfo[i].hwnd) SaveDocument(MdiInfo[i].hwnd,NULL); 551 551 } 552 if( projectInfo.name[0]) SaveProject();552 if( projectInfo.IsOpened() ) SaveProject(); 553 553 } 554 554 … … 935 935 936 936 HWND hChild = ::GetWindow(hClient,GW_CHILD); 937 if( projectInfo.name[0]){937 if( projectInfo.IsOpened() ){ 938 938 //プロジェクトが開かれている場合 939 939 if(!SetProjectToRun()) return; … … 960 960 961 961 // DLLオプション 962 if(projectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll"); 962 if( projectInfo.GetModuleType() == ActiveBasic::Common::TargetModuleType::Dll ) 963 { 964 lstrcat(temporary," /dll"); 965 } 963 966 964 967 // SLLオプション 965 if( projectInfo.dwModuleType == MT_SLL ) lstrcat( temporary, " /static_library" ); 968 if( projectInfo.GetModuleType() == ActiveBasic::Common::TargetModuleType::Sll ) 969 { 970 lstrcat(temporary," /static_library"); 971 } 966 972 967 973 //Unicodeオプション … … 1015 1021 1016 1022 HWND hChild=::GetWindow(hClient,GW_CHILD); 1017 if( projectInfo.name[0]){1023 if( projectInfo.IsOpened() ){ 1018 1024 //プロジェクトが開かれている場合 1019 1025 if(!SetProjectToRun()) return; … … 1029 1035 1030 1036 //DLLオプション 1031 if(projectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll"); 1037 if( projectInfo.GetModuleType() == ActiveBasic::Common::TargetModuleType::Dll ) 1038 { 1039 lstrcat(temporary," /dll"); 1040 } 1032 1041 1033 1042 //Unicodeオプション … … 1126 1135 1127 1136 HWND hChild=::GetWindow(hClient,GW_CHILD); 1128 if( projectInfo.name[0]){1137 if( projectInfo.IsOpened() ){ 1129 1138 //プロジェクトが開かれている場合 1130 1139 if(!SetProjectToRun()) return; … … 1140 1149 1141 1150 //DLLオプション 1142 if(projectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll"); 1151 if( projectInfo.GetModuleType() == ActiveBasic::Common::TargetModuleType::Dll ) 1152 { 1153 lstrcat(temporary," /dll"); 1154 } 1143 1155 1144 1156 //Unicodeオプション … … 1182 1194 1183 1195 HWND hChild=::GetWindow(hClient,GW_CHILD); 1184 if( projectInfo.name[0]){1196 if( projectInfo.IsOpened() ){ 1185 1197 /* //プロジェクトが開かれている場合 1186 1198 if(!SetProjectToRun()) return; … … 1190 1202 SendMessage(WM_COMMAND,IDM_RELEASECOMPILE,0);*/ 1191 1203 1192 if(projectInfo.dwModuleType==MT_DLL){ 1204 if( projectInfo.GetModuleType() == ActiveBasic::Common::TargetModuleType::Dll ) 1205 { 1193 1206 lstrcpy(temporary,projectInfo.szExePath); 1194 1207 } … … 1236 1249 void MainFrame::OnCmdBreakPoint( UINT uNotifyCode, int nID, CWindow wndCtl ) 1237 1250 { 1238 if( projectInfo.name[0]){1251 if( projectInfo.IsOpened() ){ 1239 1252 projectInfo.pobj_DBBreakPoint->Event_BreakPoint(); 1240 1253 } -
trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp
r615 r619 1 1 #include "stdafx.h" 2 3 using namespace ActiveBasic::IDE; 4 5 void OpenWorkfile( const std::string &path ); 6 7 void Project::Open( char *path ) 8 { 9 extern HANDLE hHeap; 10 int i,i2; 11 char *buffer,temporary[MAX_PATH],temp2[MAX_PATH]; 12 13 //既にプロジェクトが開かれている場合は閉じる 14 if( this->IsOpened() ){ 15 if(!this->Close()) return; 16 } 17 //memset(&projectInfo,0,sizeof(PROJECTINFO)); 18 19 //プロジェクトの作業ディレクトリを取得 20 _splitpath(path,this->dir,temporary,0,0); 21 lstrcat(this->dir,temporary); 22 23 //ファイルを開く、保存の初期ディレクトリをセット 24 lstrcpy(pobj_nv->DefSaveDir,this->dir); 25 26 27 ////////////////////////////////////////// 28 // リソースデータ用領域を確保 29 this->res.pCursorResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1); 30 this->res.NumberOfCursorRes=0; 31 this->res.pBitmapResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1); 32 this->res.NumberOfBitmapRes=0; 33 this->res.pIconResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1); 34 this->res.NumberOfIconRes=0; 35 36 37 ////////////////////////////////////////// 38 //プロジェクトファイル(*.pj)をオープン 39 buffer=ReadBuffer(path); 40 if(!buffer) return; 41 42 //解析 43 this->pobj_DBFileInfo=new CDBFileInfo(); 44 bool isUseWindow = false; 45 for(i=0;;i++){ 46 if(buffer[i]=='\0') break; 47 if(buffer[i]=='\r'&&buffer[i+1]=='\n'&&buffer[i+2]=='#'){ 48 for(i+=3,i2=0;;i++,i2++){ 49 if(!IsVariableChar(buffer[i])){ 50 temporary[i2]=0; 51 break; 52 } 53 temporary[i2]=buffer[i]; 54 } 55 if(lstrcmpi(temporary,"VERSION")==0&&buffer[i]=='='){ 56 for(i++,i2=0;;i++,i2++){ 57 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 58 temporary[i2]=0; 59 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 60 break; 61 } 62 temporary[i2]=buffer[i]; 63 } 64 this->dwVersion=GetValue(temporary); 65 } 66 else if(lstrcmpi(temporary,"MODULETYPE")==0&&buffer[i]=='='){ 67 for(i++,i2=0;;i++,i2++){ 68 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 69 temporary[i2]=0; 70 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 71 break; 72 } 73 temporary[i2]=buffer[i]; 74 } 75 this->moduleType = (ActiveBasic::Common::TargetModuleType::EnumType)atoi(temporary); 76 } 77 else if(lstrcmpi(temporary,"NAME")==0&&buffer[i]=='='){ 78 for(i++,i2=0;;i++,i2++){ 79 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 80 temporary[i2]=0; 81 break; 82 } 83 temporary[i2]=buffer[i]; 84 } 85 this->name = temporary; 86 } 87 else if(lstrcmpi(temporary,"PLATFORM")==0&&buffer[i]=='='){ 88 for(i++,i2=0;;i++,i2++){ 89 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 90 temporary[i2]=0; 91 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 92 break; 93 } 94 temporary[i2]=buffer[i]; 95 } 96 i2=atoi(temporary); 97 extern HWND hSelectCompilerCombo; 98 if(i2==32){ 99 //プラットフォームにWin32を選択 100 SendMessage(hSelectCompilerCombo,CB_SETCURSEL,0,0); 101 } 102 else if(i2==64){ 103 //プラットフォームにWin64を選択 104 SendMessage(hSelectCompilerCombo,CB_SETCURSEL,1,0); 105 } 106 SendMessage(hSelectCompilerCombo,WM_COMMAND,MAKELONG(0,CBN_SELCHANGE),0); 107 } 108 else if(lstrcmpi(temporary,"USEWINDOW")==0&&buffer[i]=='='){ 109 for(i++,i2=0;;i++,i2++){ 110 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 111 temporary[i2]=0; 112 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 113 break; 114 } 115 temporary[i2]=buffer[i]; 116 } 117 if( atoi(temporary) > 0 ) 118 { 119 isUseWindow = true; 120 } 121 } 122 else if(lstrcmpi(temporary,"OPTION")==0&&buffer[i]=='='){ 123 for(i++,i2=0;;i++,i2++){ 124 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 125 temporary[i2]=0; 126 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 127 break; 128 } 129 temporary[i2]=buffer[i]; 130 } 131 this->dwOption=GetValue(temporary); 132 } 133 else if(lstrcmpi(temporary,"OUTPUT_RELEASE")==0&&buffer[i]=='='){ 134 for(i++,i2=0;;i++,i2++){ 135 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 136 temporary[i2]=0; 137 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 138 break; 139 } 140 temporary[i2]=buffer[i]; 141 } 142 lstrcpy(this->lpszOutput_Release,temporary); 143 } 144 else if(lstrcmpi(temporary,"OUTPUT_DEBUG")==0&&buffer[i]=='='){ 145 for(i++,i2=0;;i++,i2++){ 146 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 147 temporary[i2]=0; 148 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 149 break; 150 } 151 temporary[i2]=buffer[i]; 152 } 153 lstrcpy(this->lpszOutput_Debug,temporary); 154 } 155 else if(lstrcmpi(temporary,"MANIFEST")==0&&buffer[i]=='='){ 156 for(i++,i2=0;;i++,i2++){ 157 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 158 temporary[i2]=0; 159 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 160 break; 161 } 162 temporary[i2]=buffer[i]; 163 } 164 lstrcpy(this->szManifestPath,temporary); 165 } 166 else if(lstrcmpi(temporary,"DEBUG_CMD_LINE")==0&&buffer[i]=='='){ 167 for(i++,i2=0;;i++,i2++){ 168 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 169 temporary[i2]=0; 170 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 171 break; 172 } 173 temporary[i2]=buffer[i]; 174 } 175 lstrcpy(this->szCmdLine,temporary); 176 } 177 else if(lstrcmpi(temporary,"DEBUG_EXE_PATH")==0&&buffer[i]=='='){ 178 for(i++,i2=0;;i++,i2++){ 179 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 180 temporary[i2]=0; 181 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 182 break; 183 } 184 temporary[i2]=buffer[i]; 185 } 186 lstrcpy(this->szExePath,temporary); 187 } 188 else if(lstrcmpi(temporary,"RESOURCE")==0&&buffer[i]=='='){ 189 for(i++,i2=0;;i++,i2++){ 190 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 191 temporary[i2]=0; 192 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 193 break; 194 } 195 temporary[i2]=buffer[i]; 196 } 197 if(temporary[0]!='\0'&&(!(temporary[0]=='0'&&temporary[1]=='\0'))){ 198 lstrcpy(this->ResourceFileName,temporary); 199 GetResourceData(); 200 } 201 else{ 202 sprintf(this->ResourceFileName,"%s.rc",this->GetName().c_str()); 203 } 204 } 205 else if(lstrcmpi(temporary,"SOURCE")==0&&buffer[i]=='\r'&&buffer[i+1]=='\n'){ 206 while(1){ 207 for(i+=2,i2=0;;i++,i2++){ 208 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 209 temporary[i2]=0; 210 break; 211 } 212 temporary[i2]=buffer[i]; 213 } 214 if(temporary[0]=='\0') break; 215 this->pobj_DBFileInfo->add(temporary,0); 216 217 if(buffer[i]=='\0') break; 218 } 219 } 220 else{ 221 //不明なパラメータは無視 222 for(i++;;i++){ 223 if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){ 224 if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2; 225 break; 226 } 227 } 228 } 229 if(buffer[i]=='\0') break; 230 } 231 } 232 HeapDefaultFree(buffer); 233 234 //古いバージョンファイルを考慮 235 if(this->dwVersion<=4){ 236 if( this->GetModuleType() == ActiveBasic::Common::TargetModuleType::Dll ) 237 { 238 sprintf(this->lpszOutput_Release,".\\%s.dll",this->GetName().c_str()); 239 } 240 else 241 { 242 sprintf(this->lpszOutput_Release,".\\%s.exe",this->GetName().c_str()); 243 } 244 sprintf(this->lpszOutput_Debug,".\\%s_debug.exe",this->GetName().c_str()); 245 } 246 247 //ブレークポイントを初期化 248 this->pobj_DBBreakPoint=new CDBBreakPoint(); 249 250 251 if( isUseWindow ) 252 { 253 ///////////////////////////////////////////// 254 //ウィンドウ定義ファイル(*.wnd)をオープン 255 sprintf(temp2,"%s%s.wnd",this->dir,this->GetName().c_str()); 256 if(!OpenWindowFile(temp2)) return; 257 } 258 else{ 259 this->windowInfos.Clear(); 260 261 this->NumberOfMenu=0; 262 this->pMenuInfo=(MENU_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1); 263 } 264 265 OpenWorkfile( this->dir + this->GetName() + ".wrk" ); 266 267 this->modify=0; 268 this->ModifyOfMaterial=0; 269 this->ModifuOfResource=0; 270 } 271 272 bool Project::Close() 273 { 274 extern HANDLE hHeap; 275 extern MDIINFO MdiInfo[MAX_WNDNUM]; 276 int i,i2,WndNum; 277 HWND hChild,hCloseChild; 278 char temporary[MAX_PATH]; 279 280 281 //保存確認 282 i=ProjectModifyCheck(0); 283 if(i==0) return false; 284 else if(i==2) MakeWorkFile(); 285 286 //プロジェクトに関するMDIウィンドウをすべて閉じる 287 hChild=GetWindow(hClient,GW_CHILD); 288 while(hChild){ 289 hCloseChild=hChild; 290 hChild=GetNextWindow(hChild,GW_HWNDNEXT); 291 WndNum=GetWndNum(hCloseChild); 292 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){ 293 for(i=0;i<this->pobj_DBFileInfo->iNum;i++){ 294 this->pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary); 295 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){ 296 297 //変更フラグをオフにする 298 MdiInfo[WndNum].pMdiTextEdit->UnModify(); 299 300 SendMessage(hCloseChild,WM_CLOSE,0,0); 301 break; 302 } 303 } 304 } 305 else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD) 306 { 307 BOOST_FOREACH( const WindowInfo *pWindowInfo, windowInfos ) 308 { 309 if( pWindowInfo->GetName() == MdiInfo[WndNum].path ){ 310 SendMessage(hCloseChild,WM_CLOSE,0,0); 311 break; 312 } 313 } 314 } 315 else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){ 316 for(i=0;i<this->NumberOfMenu;i++){ 317 if(lstrcmp(MdiInfo[WndNum].path,this->pMenuInfo[i].IdName)==0){ 318 SendMessage(hCloseChild,WM_CLOSE,0,0); 319 break; 320 } 321 } 322 } 323 else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){ 324 for(i=0;this->res.NumberOfIconRes;i++){ 325 lstrcpy(temporary,this->res.pIconResInfo[i].path); 326 GetFullPath(temporary,this->dir); 327 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){ 328 SendMessage(hCloseChild,WM_CLOSE,0,0); 329 break; 330 } 331 } 332 } 333 } 334 335 //ファイル情報のメモリを解放 336 delete this->pobj_DBFileInfo; 337 338 //ブレークポイントのオブジェクトを解放 339 delete this->pobj_DBBreakPoint; 340 341 //ウィンドウ情報のメモリを解放 342 BOOST_FOREACH( WindowInfo *pWindowInfo, windowInfos ) 343 { 344 HeapDefaultFree(pWindowInfo->caption); 345 HeapDefaultFree(pWindowInfo->ClassName); 346 HeapDefaultFree(pWindowInfo->CallBackName); 347 HeapDefaultFree(pWindowInfo->filepath); 348 if(pWindowInfo->MenuID) 349 HeapDefaultFree(pWindowInfo->MenuID); 350 if(pWindowInfo->IconResName) 351 HeapDefaultFree(pWindowInfo->IconResName); 352 353 //子ウィンドウのメモリを解放 354 for(i2=0;i2<pWindowInfo->childWindowInfos.size();i2++){ 355 HeapDefaultFree(pWindowInfo->childWindowInfos[i2]->IdName); 356 HeapDefaultFree(pWindowInfo->childWindowInfos[i2]->caption); 357 if(pWindowInfo->childWindowInfos[i2]->Control==CT_IMAGEBOX){ 358 //イメージ ボックスの場合 359 HeapDefaultFree(pWindowInfo->childWindowInfos[i2]->ImageCtrlInfo.path); 360 } 361 362 delete pWindowInfo->childWindowInfos[i2]; 363 } 364 pWindowInfo->childWindowInfos.clear(); 365 } 366 this->windowInfos.Clear(); 367 368 //メニュー情報のメモリを解放 369 HeapMenuDataFree(this->pMenuInfo,this->NumberOfMenu,0); 370 HeapDefaultFree(this->pMenuInfo); 371 372 //リソースのメモリを解放 373 for(i=0;i<this->res.NumberOfCursorRes;i++){ 374 HeapDefaultFree(this->res.pCursorResInfo[i].IdName); 375 HeapDefaultFree(this->res.pCursorResInfo[i].path); 376 } 377 HeapDefaultFree(this->res.pCursorResInfo); 378 for(i=0;i<this->res.NumberOfBitmapRes;i++){ 379 HeapDefaultFree(this->res.pBitmapResInfo[i].IdName); 380 HeapDefaultFree(this->res.pBitmapResInfo[i].path); 381 } 382 HeapDefaultFree(this->res.pBitmapResInfo); 383 for(i=0;i<this->res.NumberOfIconRes;i++){ 384 HeapDefaultFree(this->res.pIconResInfo[i].IdName); 385 HeapDefaultFree(this->res.pIconResInfo[i].path); 386 } 387 HeapDefaultFree(this->res.pIconResInfo); 388 389 //プロジェクト ビューを非表示にする 390 extern HWND hProjectView; 391 if(IsWindowVisible(hProjectView)) SendMessage(hOwner,WM_COMMAND,IDM_PROJECTVIEW,0); 392 SetWindowText(hProjectView,"Project View"); 393 394 extern HWND hProcedureTreeView; 395 extern HWND hMaterialTreeView; 396 TreeView_DeleteAllItems(pobj_FileTree->hTree); 397 TreeView_DeleteAllItems(hProcedureTreeView); 398 TreeView_DeleteAllItems(hMaterialTreeView); 399 400 //ウィンドウ タイトルを変更 401 SetWindowText(hOwner,APPLICATION_NAME); 402 403 this->name = ""; 404 405 //メニュー状態を設定 406 ResetState_DocMenu(); 407 408 return true; 409 }
Note:
See TracChangeset
for help on using the changeset viewer.