Changeset 749 in dev


Ignore:
Timestamp:
Sep 15, 2008, 6:06:34 PM (16 years ago)
Author:
dai
Message:

「フォルダを開く」コマンドで、ファイル選択を可能にした。

Location:
trunk/ab5.0
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/include/MainFrame.h

    r697 r749  
    3131
    3232    // Explorerでパスを開く
    33     void OpenExplorer( const std::string &path );
     33    void OpenExplorer( const std::string &filepath );
    3434
    3535    // 生成された
  • trunk/ab5.0/abdev/abdev/src/MainFrame.cpp

    r719 r749  
    77void SetupWindow(HWND hwnd);
    88void ResetTextEditFont(HWND hwnd);
     9
     10void CreateProcessWithStdHandle( const std::string &appPath, const std::string &cmdLine, bool isShowWindow = true )
     11{
     12    std::string argsStr = "\"" + appPath + "\" " + cmdLine;
     13    STARTUPINFO si;
     14    PROCESS_INFORMATION pi;
     15    memset(&si,0,sizeof(STARTUPINFO));
     16    si.cb=sizeof(STARTUPINFO);
     17    si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
     18    si.wShowWindow = isShowWindow ? SW_SHOW : SW_HIDE;
     19    si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
     20    si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
     21    si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
     22   
     23    char args[8192];
     24    lstrcpy( args, argsStr.c_str() );
     25
     26    CreateProcess( NULL, args, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi );
     27    CloseHandle( pi.hProcess );
     28    CloseHandle( pi.hThread );
     29}
    930
    1031void MainFrame::Resized()
     
    166187}
    167188
    168 void MainFrame::OpenExplorer( const std::string &path )
    169 {
    170     ShellExecute(m_hWnd,"explore",path.c_str(),NULL,NULL,SW_SHOWNORMAL);
     189void MainFrame::OpenExplorer( const std::string &filepath )
     190{
     191    CreateProcessWithStdHandle( "explorer", "/select,\"" + filepath + "\"" );
    171192}
    172193
     
    10981119}
    10991120
    1100 void CreateProcessWithStdHandle( const std::string &appPath, const std::string &cmdLine)
    1101 {
    1102     std::string argsStr = "\"" + appPath + "\" " + cmdLine;
    1103     STARTUPINFO si;
    1104     PROCESS_INFORMATION pi;
    1105     memset(&si,0,sizeof(STARTUPINFO));
    1106     si.cb=sizeof(STARTUPINFO);
    1107     si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
    1108     si.wShowWindow = SW_HIDE;
    1109     si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
    1110     si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
    1111     si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
    1112    
    1113     char args[8192];
    1114     lstrcpy( args, argsStr.c_str() );
    1115 
    1116     CreateProcess( NULL, args, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi );
    1117     CloseHandle( pi.hProcess );
    1118     CloseHandle( pi.hThread );
    1119 }
    1120 
    11211121#ifndef THETEXT
    11221122void MainFrame::OnCmdDebug( UINT uNotifyCode, int nID, CWindow wndCtl )
     
    12131213
    12141214    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
    1215     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
     1215    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false );
    12161216}
    12171217
     
    12811281
    12821282    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
    1283     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
    1284 
     1283    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false );
    12851284}
    12861285
     
    13331332
    13341333    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
    1335     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( platform ), temporary );
     1334    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( platform ), temporary, false );
    13361335}
    13371336
     
    14011400
    14021401    extern ActiveBasic::Common::Platform::EnumType selectingPlatform;
    1403     CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary );
     1402    CreateProcessWithStdHandle( ActiveBasic::Common::Environment::GetCompilerExePath( selectingPlatform ), temporary, false );
    14041403}
    14051404
     
    16421641    int WndNum=GetWndNum(hChild);
    16431642
    1644     char temporary[1024], temp2[1024];
    1645     _splitpath(MdiInfo[WndNum]->path.c_str(),temporary,temp2,NULL,NULL);
    1646     lstrcat(temporary,temp2);
    1647 
    1648     OpenExplorer( temporary );
     1643    OpenExplorer( MdiInfo[WndNum]->path );
    16491644}
    16501645
  • trunk/ab5.0/abdev/compiler_x64/MakePeHdr.cpp

    r744 r749  
    481481        // 格納先ディレクトリを作る
    482482        Jenga::Common::Path path( program.GetOutputFilePath() );
    483         Jenga::Common::Directory dir( path.GetDriveName() + path.GetDirName(), true );
     483        Jenga::Common::Directory dir( path.GetDirPath(), true );
    484484
    485485        // 書き込む
  • trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp

    r743 r749  
    511511        // 格納先ディレクトリを作る
    512512        Jenga::Common::Path path( program.GetOutputFilePath() );
    513         Jenga::Common::Directory dir( path.GetDriveName() + path.GetDirName(), true );
     513        Jenga::Common::Directory dir( path.GetDirPath(), true );
    514514
    515515        // 書き込む
  • trunk/ab5.0/jenga/include/common/Path.h

    r630 r749  
    3939        return driveName;
    4040    }
    41     const std::string &GetDirName() const
     41    const std::string GetDirPath() const
    4242    {
    43         return dirName;
     43        return driveName + dirName;
    4444    }
    4545    const std::string &GetFileName() const
     
    5050    {
    5151        return ext;
     52    }
     53    const std::string GetFullFileName() const
     54    {
     55        return fileName + ext;
    5256    }
    5357    const std::string &GetFullPath() const
  • trunk/ab5.0/jenga/src/common/FileSystem.cpp

    r694 r749  
    1111
    1212    Jenga::Common::Path path( tempFindStr );
    13     std::string dirPath = path.GetDriveName() + path.GetDirName();
     13    std::string dirPath = path.GetDirPath();
    1414    if( !dirPath.empty() && dirPath[dirPath.size()-1] == '\\' )
    1515    {
  • trunk/ab5.0/jenga/src/common/Path.cpp

    r623 r749  
    7979std::string Jenga::Common::Path::ExtractDirPath( const std::string &filepath )
    8080{
    81     Path path( filepath );
    82     std::string result = path.GetDriveName() + path.GetDirName();
    83     return result;
     81    return Path( filepath ).GetDirPath();
    8482}
Note: See TracChangeset for help on using the changeset viewer.