Changeset 621 in dev for trunk


Ignore:
Timestamp:
May 19, 2008, 6:22:42 PM (16 years ago)
Author:
dai_9181
Message:

Projectクラスをリファクタリング中。

Location:
trunk/ab5.0/abdev/abdev
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/FileOperation.cpp

    r620 r621  
    305305        pobj_nv->pobj_ProjectHistory->insert(OpenFileName);
    306306
    307         projectInfo.Open(OpenFileName);
     307        projectInfo.Load(OpenFileName);
    308308        return 0;
    309309    }
  • trunk/ab5.0/abdev/abdev/ProjectControl.cpp

    r620 r621  
    11091109
    11101110    sprintf(temporary,"%s%s.pj",dir,NewProjectInfo.name);
    1111     projectInfo.Open(temporary);
    1112     SaveProject();
     1111    projectInfo.Load(temporary);
     1112    projectInfo.Save();
    11131113}
    11141114void SetTreeViewForProjectInfo(){
     
    15681568
    15691569            if(i==IDCANCEL) return 0;
    1570             if(i==IDYES) SaveProject();
     1570            if(i==IDYES)
     1571            {
     1572                projectInfo.Save();
     1573            }
    15711574        }
    1572         else SaveProject();
     1575        else
     1576        {
     1577            projectInfo.Save();
     1578        }
    15731579        return 1;
    15741580    }
     
    16021608
    16031609                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            }
    16071619            return 1;
    16081620        }
     
    17311743    WriteBuffer(temporary,buffer,i2);
    17321744}
    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 }
    19971745
    19981746BOOL SetProjectToRun(void){
  • trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h

    r620 r621  
    1313    }
    1414
    15     void Open( char *path );
     15    void Load( char *path );
     16    void Save();
    1617    bool Close();
    1718
  • trunk/ab5.0/abdev/abdev/src/MainFrame.cpp

    r620 r621  
    507507    }
    508508
    509     projectInfo.Open(temporary);
     509    projectInfo.Load(temporary);
    510510}
    511511
    512512void MainFrame::OnCmdProjectSave( UINT uNotifyCode, int nID, CWindow wndCtl )
    513513{
    514     SaveProject();
     514    projectInfo.Save();
    515515}
    516516
     
    551551        if(MdiInfo[i].hwnd) SaveDocument(MdiInfo[i].hwnd,NULL);
    552552    }
    553     if( projectInfo.IsOpened() ) SaveProject();
     553    if( projectInfo.IsOpened() )
     554    {
     555        projectInfo.Save();
     556    }
    554557}
    555558
  • trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp

    r620 r621  
    55void OpenWorkfile( const std::string &path );
    66
    7 void Project::Open( char *path )
     7void Project::Load( char *path )
    88{
    99    extern HANDLE hHeap;
     
    268268    this->modify=0;
    269269    this->ModifyOfMaterial=0;
     270    this->ModifuOfResource=0;
     271}
     272
     273void SetStatusText(char *MenuText);
     274void Project::Save()
     275{
     276    extern MDIINFO MdiInfo[MAX_WNDNUM];
     277    int i,i2,i3,WndNum;
     278    char temporary[MAX_PATH],buffer[32767];
     279    HWND hChild;
     280
     281    SetStatusText( "プロジェクトを保存中..." );
     282
     283    //プロジェクトファイルのバージョンを設定
     284    this->dwVersion=PROJECT_VERSION;
     285
     286    hChild=GetWindow(hClient,GW_CHILD);
     287    while(hChild){
     288        WndNum=GetWndNum(hChild);
     289        if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
     290            if( MdiInfo[WndNum].pMdiTextEdit->IsModified() ){
     291                for(i=0;i<this->pobj_DBFileInfo->iNum;i++){
     292                    this->pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
     293                    if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
     294                        SaveDocument(hChild,NULL);
     295                        break;
     296                    }
     297                }
     298            }
     299        }
     300        if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
     301            if(MdiInfo[WndNum].MdiIconEditInfo->bModify){
     302                for(i=0;i<this->res.NumberOfIconRes;i++){
     303                    lstrcpy(temporary,this->res.pIconResInfo[i].path);
     304                    lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
     305                    if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
     306                        SaveDocument(hChild,NULL);
     307                        break;
     308                    }
     309                }
     310            }
     311        }
     312        hChild=GetNextWindow(hChild,GW_HWNDNEXT);
     313    }
     314
     315
     316    //////////////////////////////////////
     317    //プロジェクトファイル(*.pj)を作成
     318    lstrcpy(buffer,"\' ActiveBasic Project file.\r\n\r\n");
     319    i2=lstrlen(buffer);
     320    sprintf(buffer+i2,"#VERSION=%d\r\n\r\n",this->dwVersion);
     321    i2+=lstrlen(buffer+i2);
     322    sprintf(buffer+i2,"#MODULETYPE=%d\r\n\r\n",(int)this->GetModuleType());
     323    i2+=lstrlen(buffer+i2);
     324    sprintf(buffer+i2,"#NAME=%s\r\n\r\n",this->GetName().c_str());
     325    i2+=lstrlen(buffer+i2);
     326    extern HWND hSelectCompilerCombo;
     327    if(SendMessage(hSelectCompilerCombo,CB_GETCURSEL,0,0)==0){
     328        sprintf(buffer+i2,"#PLATFORM=32\r\n\r\n",this->GetName().c_str());
     329        i2+=lstrlen(buffer+i2);
     330    }
     331    else{
     332        sprintf(buffer+i2,"#PLATFORM=64\r\n\r\n",this->GetName().c_str());
     333        i2+=lstrlen(buffer+i2);
     334    }
     335    sprintf(buffer+i2,"#USEWINDOW=%d\r\n\r\n",this->windowInfos.size());
     336    i2+=lstrlen(buffer+i2);
     337    sprintf(buffer+i2,"#OPTION=&H%08x\r\n\r\n",this->dwOption);
     338    i2+=lstrlen(buffer+i2);
     339    sprintf(buffer+i2,"#OUTPUT_RELEASE=%s\r\n\r\n",this->lpszOutput_Release);
     340    i2+=lstrlen(buffer+i2);
     341    sprintf(buffer+i2,"#OUTPUT_DEBUG=%s\r\n\r\n",this->lpszOutput_Debug);
     342    i2+=lstrlen(buffer+i2);
     343    sprintf(buffer+i2,"#MANIFEST=%s\r\n\r\n",this->szManifestPath);
     344    i2+=lstrlen(buffer+i2);
     345    sprintf(buffer+i2,"#DEBUG_CMD_LINE=%s\r\n\r\n",this->szCmdLine);
     346    i2+=lstrlen(buffer+i2);
     347    sprintf(buffer+i2,"#DEBUG_EXE_PATH=%s\r\n\r\n",this->szExePath);
     348    i2+=lstrlen(buffer+i2);
     349    if(this->ResourceFileName[0]){
     350        sprintf(buffer+i2,"#RESOURCE=%s\r\n\r\n",this->ResourceFileName);
     351        i2+=lstrlen(buffer+i2);
     352    }
     353    else{
     354        lstrcpy(buffer+i2,"#RESOURCE=0\r\n\r\n");
     355        i2+=lstrlen(buffer+i2);
     356    }
     357    sprintf(buffer+i2,"#SOURCE\r\n");
     358    i2+=lstrlen(buffer+i2);
     359    for(i=0;i<this->pobj_DBFileInfo->iNum;i++){
     360        sprintf(buffer+i2,"%s\r\n",this->pobj_DBFileInfo->ppobj_FileInfo[i]->m_path);
     361        i2+=lstrlen(buffer+i2);
     362    }
     363
     364    //保存
     365    sprintf(temporary,"%s%s.pj",this->GetWorkDir().GetPath().c_str(),this->GetName().c_str());
     366    WriteBuffer(temporary,buffer,i2);
     367
     368
     369    //////////////////////////////////
     370    // リソースファイル(*.rc、resource.ab)を作成
     371    if(this->ResourceFileName[0]){
     372        i2=0;
     373        i3=101;
     374        for(i=0;i<this->res.NumberOfCursorRes;i++,i3++){
     375            sprintf(buffer+i2,"Const %s=%d\r\n",
     376                this->res.pCursorResInfo[i].IdName,
     377                i3);
     378            i2+=lstrlen(buffer+i2);
     379        }
     380        for(i=0;i<this->res.NumberOfBitmapRes;i++,i3++){
     381            sprintf(buffer+i2,"Const %s=%d\r\n",
     382                this->res.pBitmapResInfo[i].IdName,
     383                i3);
     384            i2+=lstrlen(buffer+i2);
     385        }
     386        for(i=0;i<this->res.NumberOfIconRes;i++,i3++){
     387            sprintf(buffer+i2,"Const %s=%d\r\n",
     388                this->res.pIconResInfo[i].IdName,
     389                i3);
     390            i2+=lstrlen(buffer+i2);
     391        }
     392
     393        //保存(resource.ab)
     394        lstrcpy(temporary,"resource.ab");
     395        lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
     396        WriteBuffer(temporary,buffer,i2);
     397
     398        i2=0;
     399        for(i=0;i<this->res.NumberOfCursorRes;i++){
     400            sprintf(buffer+i2,"%s CURSOR \"%s\"\r\n",
     401                this->res.pCursorResInfo[i].IdName,
     402                this->res.pCursorResInfo[i].path);
     403            i2+=lstrlen(buffer+i2);
     404        }
     405        for(i=0;i<this->res.NumberOfBitmapRes;i++){
     406            sprintf(buffer+i2,"%s BITMAP \"%s\"\r\n",
     407                this->res.pBitmapResInfo[i].IdName,
     408                this->res.pBitmapResInfo[i].path);
     409            i2+=lstrlen(buffer+i2);
     410        }
     411        for(i=0;i<this->res.NumberOfIconRes;i++){
     412            sprintf(buffer+i2,"%s ICON \"%s\"\r\n",
     413                this->res.pIconResInfo[i].IdName,
     414                this->res.pIconResInfo[i].path);
     415            i2+=lstrlen(buffer+i2);
     416        }
     417
     418        //マニフェスト
     419        if(this->dwOption&PJ_OP_RC_MANIFEST){
     420            sprintf(buffer+i2,"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST \"%s\"\r\n",
     421                this->szManifestPath);
     422            i2+=lstrlen(buffer+i2);
     423        }
     424
     425        //保存
     426        lstrcpy(temporary,this->ResourceFileName);
     427        lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
     428        WriteBuffer(temporary,buffer,i2);
     429    }
     430
     431
     432    ///////////////////////////////////////
     433    //インデックスファイル(*.idx)を作成
     434    buffer[0]=0;
     435    lstrcpy(buffer,"' インデックス プログラム\r\n");
     436    i2=lstrlen(buffer);
     437    if(this->dwOption&PJ_OP_SOURCE_MASK){
     438        if(this->dwOption&PJ_OP_STRICT){
     439            /* #strictディレクティブは今は使われていない
     440            lstrcpy(buffer+i2,"\r\n");
     441            i2+=lstrlen(buffer+i2);
     442            lstrcpy(buffer+i2,"#strict");
     443            i2+=lstrlen(buffer+i2);
     444            lstrcpy(buffer+i2,"\r\n");
     445            i2+=lstrlen(buffer+i2);
     446            */
     447        }
     448        lstrcpy(buffer+i2,"\r\n");
     449        i2+=lstrlen(buffer+i2);
     450        lstrcpy(buffer+i2,"'Win32APIの定義ファイル\r\n");
     451        i2+=lstrlen(buffer+i2);
     452        if(this->dwOption&PJ_OP_MMSYSTEM){
     453            lstrcpy(buffer+i2,"#include <api_mmsys.sbp>\r\n");
     454            i2+=lstrlen(buffer+i2);
     455        }
     456        if(this->dwOption&PJ_OP_COMMCTRL){
     457            lstrcpy(buffer+i2,"#include <api_commctrl.sbp>\r\n");
     458            i2+=lstrlen(buffer+i2);
     459        }
     460        if(this->dwOption&PJ_OP_RICHEDIT){
     461            lstrcpy(buffer+i2,"#include <api_richedit.sbp>\r\n");
     462            i2+=lstrlen(buffer+i2);
     463        }
     464        if(this->dwOption&PJ_OP_WINSOCK){
     465            lstrcpy(buffer+i2,"#include <api_winsock2.sbp>\r\n");
     466            i2+=lstrlen(buffer+i2);
     467        }
     468    }
     469    if( !this->windowInfos.empty() )
     470    {
     471        lstrcpy(buffer+i2,"\r\n");
     472        i2+=lstrlen(buffer+i2);
     473        lstrcpy(buffer+i2,"'RADツールが生成するウィンドウ制御プログラム\r\n");
     474        i2+=lstrlen(buffer+i2);
     475        sprintf(buffer+i2,"#include \"Callback.wbp\"\r\n");
     476        i2+=lstrlen(buffer+i2);
     477    }
     478    if(this->pobj_DBFileInfo->iNum>1){
     479        lstrcpy(buffer+i2,"\r\n");
     480        i2+=lstrlen(buffer+i2);
     481        lstrcpy(buffer+i2,"'プロジェクト内のプログラム ファイル\r\n");
     482        i2+=lstrlen(buffer+i2);
     483        for(i=1;i<this->pobj_DBFileInfo->iNum;i++){
     484            //メインファイルは含まない
     485            sprintf(buffer+i2,"#include \"%s\"\r\n",this->pobj_DBFileInfo->ppobj_FileInfo[i]->m_path);
     486            i2+=lstrlen(buffer+i2);
     487            lstrcpy(buffer+i2,"_ClearNamespaceImported\r\n");
     488            i2+=lstrlen(buffer+i2);
     489        }
     490    }
     491    if( !this->windowInfos.empty() )
     492    {
     493        lstrcpy(buffer+i2,"\r\n");
     494        i2+=lstrlen(buffer+i2);
     495        lstrcpy(buffer+i2,"'RADツールが生成するウィンドウ生成プログラム\r\n");
     496        i2+=lstrlen(buffer+i2);
     497        sprintf(buffer+i2,"#include \"MakeWindow.wbp\"\r\n");
     498        i2+=lstrlen(buffer+i2);
     499    }
     500    if(this->ResourceFileName[0]){
     501        //リソースファイルが含まれる場合
     502        lstrcpy(buffer+i2,"\r\n");
     503        i2+=lstrlen(buffer+i2);
     504        lstrcpy(buffer+i2,"'リソースファイル\r\n");
     505        i2+=lstrlen(buffer+i2);
     506        lstrcpy(buffer+i2,"#include \"resource.ab\"\r\n");
     507        i2+=lstrlen(buffer+i2);
     508        sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",this->GetName().c_str());
     509        i2+=lstrlen(buffer+i2);
     510    }
     511
     512    //保存
     513    sprintf(temporary,"%s%s.idx",this->GetWorkDir().GetPath().c_str(),this->GetName().c_str());
     514    WriteBuffer(temporary,buffer,i2);
     515
     516
     517    if( !this->windowInfos.empty() )
     518    {
     519        /////////////////////////////////////////////////////
     520        //ウィンドウ関連ファイル(*.wnd)を作成、保存
     521        if(this->ModifyOfMaterial){
     522            sprintf(temporary,"%s%s.wnd",this->GetWorkDir().GetPath().c_str(),this->GetName().c_str());
     523            SaveWindowFile( temporary, this->windowInfos );
     524        }
     525
     526        //.wbpファイルを生成
     527        SaveWindowProgram();
     528    }
     529
     530
     531    MakeWorkFile();
     532
     533    SetStatusText("");
     534
     535    this->modify=0;
    270536    this->ModifuOfResource=0;
    271537}
Note: See TracChangeset for help on using the changeset viewer.