Changeset 621 in dev for trunk/ab5.0/abdev/abdev/ProjectControl.cpp
- Timestamp:
- May 19, 2008, 6:22:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/ProjectControl.cpp
r620 r621 1109 1109 1110 1110 sprintf(temporary,"%s%s.pj",dir,NewProjectInfo.name); 1111 projectInfo. Open(temporary);1112 SaveProject();1111 projectInfo.Load(temporary); 1112 projectInfo.Save(); 1113 1113 } 1114 1114 void SetTreeViewForProjectInfo(){ … … 1568 1568 1569 1569 if(i==IDCANCEL) return 0; 1570 if(i==IDYES) SaveProject(); 1570 if(i==IDYES) 1571 { 1572 projectInfo.Save(); 1573 } 1571 1574 } 1572 else SaveProject(); 1575 else 1576 { 1577 projectInfo.Save(); 1578 } 1573 1579 return 1; 1574 1580 } … … 1602 1608 1603 1609 if(i==IDCANCEL) return 0; 1604 if(i==IDYES) SaveProject(); 1605 } 1606 else SaveProject(); 1610 if(i==IDYES) 1611 { 1612 projectInfo.Save(); 1613 } 1614 } 1615 else 1616 { 1617 projectInfo.Save(); 1618 } 1607 1619 return 1; 1608 1620 } … … 1731 1743 WriteBuffer(temporary,buffer,i2); 1732 1744 } 1733 void SaveProject(void){1734 extern MDIINFO MdiInfo[MAX_WNDNUM];1735 int i,i2,i3,WndNum;1736 char temporary[MAX_PATH],buffer[32767];1737 HWND hChild;1738 1739 //"プロジェクトを保存中..."1740 SetStatusText(STRING_PROJECT_SAVING);1741 1742 //プロジェクトファイルのバージョンを設定1743 projectInfo.dwVersion=PROJECT_VERSION;1744 1745 hChild=GetWindow(hClient,GW_CHILD);1746 while(hChild){1747 WndNum=GetWndNum(hChild);1748 if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){1749 if( MdiInfo[WndNum].pMdiTextEdit->IsModified() ){1750 for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){1751 projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);1752 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){1753 SaveDocument(hChild,NULL);1754 break;1755 }1756 }1757 }1758 }1759 if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){1760 if(MdiInfo[WndNum].MdiIconEditInfo->bModify){1761 for(i=0;i<projectInfo.res.NumberOfIconRes;i++){1762 lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path);1763 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );1764 if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){1765 SaveDocument(hChild,NULL);1766 break;1767 }1768 }1769 }1770 }1771 hChild=GetNextWindow(hChild,GW_HWNDNEXT);1772 }1773 1774 1775 //////////////////////////////////////1776 //プロジェクトファイル(*.pj)を作成1777 lstrcpy(buffer,"\' ActiveBasic Project file.\r\n\r\n");1778 i2=lstrlen(buffer);1779 sprintf(buffer+i2,"#VERSION=%d\r\n\r\n",projectInfo.dwVersion);1780 i2+=lstrlen(buffer+i2);1781 sprintf(buffer+i2,"#MODULETYPE=%d\r\n\r\n",(int)projectInfo.GetModuleType());1782 i2+=lstrlen(buffer+i2);1783 sprintf(buffer+i2,"#NAME=%s\r\n\r\n",projectInfo.GetName().c_str());1784 i2+=lstrlen(buffer+i2);1785 extern HWND hSelectCompilerCombo;1786 if(SendMessage(hSelectCompilerCombo,CB_GETCURSEL,0,0)==0){1787 sprintf(buffer+i2,"#PLATFORM=32\r\n\r\n",projectInfo.GetName().c_str());1788 i2+=lstrlen(buffer+i2);1789 }1790 else{1791 sprintf(buffer+i2,"#PLATFORM=64\r\n\r\n",projectInfo.GetName().c_str());1792 i2+=lstrlen(buffer+i2);1793 }1794 sprintf(buffer+i2,"#USEWINDOW=%d\r\n\r\n",projectInfo.windowInfos.size());1795 i2+=lstrlen(buffer+i2);1796 sprintf(buffer+i2,"#OPTION=&H%08x\r\n\r\n",projectInfo.dwOption);1797 i2+=lstrlen(buffer+i2);1798 sprintf(buffer+i2,"#OUTPUT_RELEASE=%s\r\n\r\n",projectInfo.lpszOutput_Release);1799 i2+=lstrlen(buffer+i2);1800 sprintf(buffer+i2,"#OUTPUT_DEBUG=%s\r\n\r\n",projectInfo.lpszOutput_Debug);1801 i2+=lstrlen(buffer+i2);1802 sprintf(buffer+i2,"#MANIFEST=%s\r\n\r\n",projectInfo.szManifestPath);1803 i2+=lstrlen(buffer+i2);1804 sprintf(buffer+i2,"#DEBUG_CMD_LINE=%s\r\n\r\n",projectInfo.szCmdLine);1805 i2+=lstrlen(buffer+i2);1806 sprintf(buffer+i2,"#DEBUG_EXE_PATH=%s\r\n\r\n",projectInfo.szExePath);1807 i2+=lstrlen(buffer+i2);1808 if(projectInfo.ResourceFileName[0]){1809 sprintf(buffer+i2,"#RESOURCE=%s\r\n\r\n",projectInfo.ResourceFileName);1810 i2+=lstrlen(buffer+i2);1811 }1812 else{1813 lstrcpy(buffer+i2,"#RESOURCE=0\r\n\r\n");1814 i2+=lstrlen(buffer+i2);1815 }1816 sprintf(buffer+i2,"#SOURCE\r\n");1817 i2+=lstrlen(buffer+i2);1818 for(i=0;i<projectInfo.pobj_DBFileInfo->iNum;i++){1819 sprintf(buffer+i2,"%s\r\n",projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->m_path);1820 i2+=lstrlen(buffer+i2);1821 }1822 1823 //保存1824 sprintf(temporary,"%s%s.pj",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.GetName().c_str());1825 WriteBuffer(temporary,buffer,i2);1826 1827 1828 //////////////////////////////////1829 // リソースファイル(*.rc、resource.ab)を作成1830 if(projectInfo.ResourceFileName[0]){1831 i2=0;1832 i3=101;1833 for(i=0;i<projectInfo.res.NumberOfCursorRes;i++,i3++){1834 sprintf(buffer+i2,"Const %s=%d\r\n",1835 projectInfo.res.pCursorResInfo[i].IdName,1836 i3);1837 i2+=lstrlen(buffer+i2);1838 }1839 for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++,i3++){1840 sprintf(buffer+i2,"Const %s=%d\r\n",1841 projectInfo.res.pBitmapResInfo[i].IdName,1842 i3);1843 i2+=lstrlen(buffer+i2);1844 }1845 for(i=0;i<projectInfo.res.NumberOfIconRes;i++,i3++){1846 sprintf(buffer+i2,"Const %s=%d\r\n",1847 projectInfo.res.pIconResInfo[i].IdName,1848 i3);1849 i2+=lstrlen(buffer+i2);1850 }1851 1852 //保存(resource.ab)1853 lstrcpy(temporary,"resource.ab");1854 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );1855 WriteBuffer(temporary,buffer,i2);1856 1857 i2=0;1858 for(i=0;i<projectInfo.res.NumberOfCursorRes;i++){1859 sprintf(buffer+i2,"%s CURSOR \"%s\"\r\n",1860 projectInfo.res.pCursorResInfo[i].IdName,1861 projectInfo.res.pCursorResInfo[i].path);1862 i2+=lstrlen(buffer+i2);1863 }1864 for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++){1865 sprintf(buffer+i2,"%s BITMAP \"%s\"\r\n",1866 projectInfo.res.pBitmapResInfo[i].IdName,1867 projectInfo.res.pBitmapResInfo[i].path);1868 i2+=lstrlen(buffer+i2);1869 }1870 for(i=0;i<projectInfo.res.NumberOfIconRes;i++){1871 sprintf(buffer+i2,"%s ICON \"%s\"\r\n",1872 projectInfo.res.pIconResInfo[i].IdName,1873 projectInfo.res.pIconResInfo[i].path);1874 i2+=lstrlen(buffer+i2);1875 }1876 1877 //マニフェスト1878 if(projectInfo.dwOption&PJ_OP_RC_MANIFEST){1879 sprintf(buffer+i2,"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST \"%s\"\r\n",1880 projectInfo.szManifestPath);1881 i2+=lstrlen(buffer+i2);1882 }1883 1884 //保存1885 lstrcpy(temporary,projectInfo.ResourceFileName);1886 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );1887 WriteBuffer(temporary,buffer,i2);1888 }1889 1890 1891 ///////////////////////////////////////1892 //インデックスファイル(*.idx)を作成1893 buffer[0]=0;1894 lstrcpy(buffer,"' インデックス プログラム\r\n");1895 i2=lstrlen(buffer);1896 if(projectInfo.dwOption&PJ_OP_SOURCE_MASK){1897 if(projectInfo.dwOption&PJ_OP_STRICT){1898 /* #strictディレクティブは今は使われていない1899 lstrcpy(buffer+i2,"\r\n");1900 i2+=lstrlen(buffer+i2);1901 lstrcpy(buffer+i2,"#strict");1902 i2+=lstrlen(buffer+i2);1903 lstrcpy(buffer+i2,"\r\n");1904 i2+=lstrlen(buffer+i2);1905 */1906 }1907 lstrcpy(buffer+i2,"\r\n");1908 i2+=lstrlen(buffer+i2);1909 lstrcpy(buffer+i2,"'Win32APIの定義ファイル\r\n");1910 i2+=lstrlen(buffer+i2);1911 if(projectInfo.dwOption&PJ_OP_MMSYSTEM){1912 lstrcpy(buffer+i2,"#include <api_mmsys.sbp>\r\n");1913 i2+=lstrlen(buffer+i2);1914 }1915 if(projectInfo.dwOption&PJ_OP_COMMCTRL){1916 lstrcpy(buffer+i2,"#include <api_commctrl.sbp>\r\n");1917 i2+=lstrlen(buffer+i2);1918 }1919 if(projectInfo.dwOption&PJ_OP_RICHEDIT){1920 lstrcpy(buffer+i2,"#include <api_richedit.sbp>\r\n");1921 i2+=lstrlen(buffer+i2);1922 }1923 if(projectInfo.dwOption&PJ_OP_WINSOCK){1924 lstrcpy(buffer+i2,"#include <api_winsock2.sbp>\r\n");1925 i2+=lstrlen(buffer+i2);1926 }1927 }1928 if( !projectInfo.windowInfos.empty() )1929 {1930 lstrcpy(buffer+i2,"\r\n");1931 i2+=lstrlen(buffer+i2);1932 lstrcpy(buffer+i2,"'RADツールが生成するウィンドウ制御プログラム\r\n");1933 i2+=lstrlen(buffer+i2);1934 sprintf(buffer+i2,"#include \"Callback.wbp\"\r\n");1935 i2+=lstrlen(buffer+i2);1936 }1937 if(projectInfo.pobj_DBFileInfo->iNum>1){1938 lstrcpy(buffer+i2,"\r\n");1939 i2+=lstrlen(buffer+i2);1940 lstrcpy(buffer+i2,"'プロジェクト内のプログラム ファイル\r\n");1941 i2+=lstrlen(buffer+i2);1942 for(i=1;i<projectInfo.pobj_DBFileInfo->iNum;i++){1943 //メインファイルは含まない1944 sprintf(buffer+i2,"#include \"%s\"\r\n",projectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->m_path);1945 i2+=lstrlen(buffer+i2);1946 lstrcpy(buffer+i2,"_ClearNamespaceImported\r\n");1947 i2+=lstrlen(buffer+i2);1948 }1949 }1950 if( !projectInfo.windowInfos.empty() )1951 {1952 lstrcpy(buffer+i2,"\r\n");1953 i2+=lstrlen(buffer+i2);1954 lstrcpy(buffer+i2,"'RADツールが生成するウィンドウ生成プログラム\r\n");1955 i2+=lstrlen(buffer+i2);1956 sprintf(buffer+i2,"#include \"MakeWindow.wbp\"\r\n");1957 i2+=lstrlen(buffer+i2);1958 }1959 if(projectInfo.ResourceFileName[0]){1960 //リソースファイルが含まれる場合1961 lstrcpy(buffer+i2,"\r\n");1962 i2+=lstrlen(buffer+i2);1963 lstrcpy(buffer+i2,"'リソースファイル\r\n");1964 i2+=lstrlen(buffer+i2);1965 lstrcpy(buffer+i2,"#include \"resource.ab\"\r\n");1966 i2+=lstrlen(buffer+i2);1967 sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",projectInfo.GetName().c_str());1968 i2+=lstrlen(buffer+i2);1969 }1970 1971 //保存1972 sprintf(temporary,"%s%s.idx",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.GetName().c_str());1973 WriteBuffer(temporary,buffer,i2);1974 1975 1976 if( !projectInfo.windowInfos.empty() )1977 {1978 /////////////////////////////////////////////////////1979 //ウィンドウ関連ファイル(*.wnd)を作成、保存1980 if(projectInfo.ModifyOfMaterial){1981 sprintf(temporary,"%s%s.wnd",projectInfo.GetWorkDir().GetPath().c_str(),projectInfo.GetName().c_str());1982 SaveWindowFile( temporary, projectInfo.windowInfos );1983 }1984 1985 //.wbpファイルを生成1986 SaveWindowProgram();1987 }1988 1989 1990 MakeWorkFile();1991 1992 SetStatusText("");1993 1994 projectInfo.modify=0;1995 projectInfo.ModifuOfResource=0;1996 }1997 1745 1998 1746 BOOL SetProjectToRun(void){
Note:
See TracChangeset
for help on using the changeset viewer.