当前位置: 首页>>代码示例>>C++>>正文


C++ FileManager::GetPathSeparator方法代码示例

本文整理汇总了C++中FileManager::GetPathSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ FileManager::GetPathSeparator方法的具体用法?C++ FileManager::GetPathSeparator怎么用?C++ FileManager::GetPathSeparator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileManager的用法示例。


在下文中一共展示了FileManager::GetPathSeparator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadData

//------------------------------------------------------------------------------
// virtual void LoadData()
//------------------------------------------------------------------------------
void RunScriptFolderDialog::LoadData()
{
   #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
   MessageInterface::ShowMessage("RunScriptFolderDialog::LoadData() entered.\n");
   #endif
   
   wxString str;
   str.Printf("%d", mNumScriptsToRun);
   mNumScriptsToRunTextCtrl->SetValue(str);
   
   FileManager *fm = FileManager::Instance();
   wxString sep = fm->GetPathSeparator().c_str();
   
   try
   {
      mCurrOutDir = fm->GetFullPathname(FileManager::OUTPUT_PATH).c_str();
   }
   catch (BaseException &e)
   {
      MessageInterface::ShowMessage(e.GetFullMessage());
   }
   
   #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
   MessageInterface::ShowMessage("   mCurrOutDir='%s'\n", mCurrOutDir.c_str());
   #endif
   
   mSaveScriptsDirTextCtrl->SetValue(mCurrOutDir + "AutoSave");
   mCurrOutDirTextCtrl->SetValue(mCurrOutDir);
   
   //=======================================================
   #ifdef __ENABLE_COMPARE__
   //=======================================================
   str.Printf("%g", mAbsTol);
   mAbsTolTextCtrl->SetValue(str);
   mCompareDirTextCtrl->SetValue(mCompareDir);
   mSaveFileTextCtrl->SetValue(mCompareDir + sep + "CompareNumericResults.txt");
   mSaveResultCheckBox->Disable();
   mSaveFileTextCtrl->Disable();
   mSaveBrowseButton->Disable();
   mSaveScriptsDirTextCtrl->Disable();
   mChangeSaveScriptsDirButton->Disable();
   //=======================================================
   #endif
   //=======================================================
   
   theOkButton->Enable();
   
   #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
   MessageInterface::ShowMessage("RunScriptFolderDialog::LoadData() leaving.\n");
   #endif
}
开发者ID:rockstorm101,项目名称:GMAT,代码行数:54,代码来源:RunScriptFolderDialog.cpp

示例2: OnButtonClick

//------------------------------------------------------------------------------
// void OnButtonClick(wxCommandEvent& event)
//------------------------------------------------------------------------------
void RunScriptFolderDialog::OnButtonClick(wxCommandEvent& event)
{
   if (event.GetEventObject() == mChangeSaveScriptsDirButton)
   {
      wxDirDialog dialog(this, "Select a directory to save scripts", mCompareDir);
      
      if (dialog.ShowModal() == wxID_OK)
      {
         mSaveScriptsDir = dialog.GetPath();
         mSaveScriptsDirTextCtrl->SetValue(mSaveScriptsDir);
         
         #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
         MessageInterface::ShowMessage
            ("RunScriptFolderDialog::OnButtonClick() mSaveScriptsDir=%s\n",
             mSaveScriptsDir.c_str());
         #endif
      }
   }
   else if (event.GetEventObject() == mChangeCurrOutDirButton)
   {
      wxDirDialog dialog(this, "Select a new output directory", mCompareDir);
   
      if (dialog.ShowModal() == wxID_OK)
      {
         FileManager *fm = FileManager::Instance();
         wxString sep = fm->GetPathSeparator().c_str();
         
         mCurrOutDir = dialog.GetPath();
         mCurrOutDirTextCtrl->SetValue(mCurrOutDir);
         //=================================================================
         #ifdef __ENABLE_COMPARE__
         //------------------------------------------------------
         mSaveFileTextCtrl->SetValue(mCurrOutDir + sep + "CompareNumericResults.txt");
         //=================================================================
         #endif
         //------------------------------------------------------
         
         mOutDirChanged = true;
         
         #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
         MessageInterface::ShowMessage
            ("RunScriptFolderDialog::OnButtonClick() mCurrOutDir=%s\n",
             mCurrOutDir.c_str());
         #endif
      }
   }
   //=================================================================
   #ifdef __ENABLE_COMPARE__
   //------------------------------------------------------
   else if (event.GetEventObject() == mDirBrowseButton)
   {
      wxDirDialog dialog(this, "Select a directory to compare", mCompareDir);
      
      if (dialog.ShowModal() == wxID_OK)
      {
         wxString dirname = dialog.GetPath();
         mCompareDirTextCtrl->SetValue(dirname);
         
         #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
         MessageInterface::ShowMessage
            ("RunScriptFolderDialog::OnButtonClick() dirname=%s\n",
             dirname.c_str());
         #endif
      }
   }
   else if (event.GetEventObject() == mSaveBrowseButton)
   {
      wxString filename =
         wxFileSelector("Choose a file to save", "", "", "txt",
                        "Report files (*.report)|*.report|Text files (*.txt)|*.txt",
                        wxSAVE);
      
      if (!filename.empty())
      {
         mSaveFileTextCtrl->SetValue(filename);
         MessageInterface::ShowMessage
            ("RunScriptFolderDialog::OnButtonClick() savefile=%s\n",
             filename.c_str());
      }
   }
   //=================================================================
   #endif
   //=================================================================
   
}
开发者ID:rockstorm101,项目名称:GMAT,代码行数:88,代码来源:RunScriptFolderDialog.cpp


注:本文中的FileManager::GetPathSeparator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。