Ejemplo n.º 1
0
//------------------------------------------------------------------------------
// virtual void Create()
//------------------------------------------------------------------------------
void SetPathDialog::Create()
{
   #ifdef DEBUG_SETPATH_DIALOG_CREATE
   MessageInterface::ShowMessage(wxT("SetPathDialog::Create() entered.\n"));
   #endif
   
   FileManager *fm = FileManager::Instance();
   mStartupFilePath = (fm->GetFullStartupFilePath()).c_str();
   
   //----- read startup file
   wxButton *readButton =
      new wxButton(this, ID_BUTTON_READ, wxT("Read Other Startup File"),
                   wxDefaultPosition, wxDefaultSize, 0);
   wxStaticText *currFileText =
      new wxStaticText(this, -1, wxT("Current Startup File:"), 
                       wxDefaultPosition, wxDefaultSize, 0 );
   mReadFileTextCtrl =
      new wxTextCtrl(this, -1, wxT(""),
                     wxDefaultPosition, wxSize(350, 20), 0);
   mReadFileTextCtrl->Disable();
   
   //----- write startup file
   wxButton *saveButton =
      new wxButton(this, ID_BUTTON_SAVE, wxT("Save Current Startup File"),
                   wxDefaultPosition, wxDefaultSize, 0);
   mSaveFileTextCtrl =
      new wxTextCtrl(this, -1, wxT(""),
                     wxDefaultPosition, wxSize(350, 20), 0);
   mSaveFileTextCtrl->Disable();
   
   //----- add to sizer
   GmatStaticBoxSizer *startupSizer =
      new GmatStaticBoxSizer(wxVERTICAL, this, wxT("Startup File"));
   startupSizer->Add(readButton, 0, wxALIGN_LEFT|wxALL, 2);
   startupSizer->Add(currFileText, 0, wxALIGN_LEFT|wxALL, 2);
   startupSizer->Add(mReadFileTextCtrl, 0, wxALIGN_CENTER|wxGROW|wxALL, 2);
   startupSizer->Add(saveButton, 0, wxALIGN_LEFT|wxALL, 2);
   startupSizer->Add(mSaveFileTextCtrl, 0, wxALIGN_CENTER|wxGROW|wxALL, 2);
   
   //----- create Notebook
   mPathNotebook =
      new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxGROW);
   
   StringArray gmatPaths = fm->GetAllGmatFunctionPaths();
   
   //----- add panels to notebook   
   mGmatFunPathPanel = new MultiPathSetupPanel(mPathNotebook, gmatPaths);
   mPathNotebook->AddPage(mGmatFunPathPanel, wxT("GMAT Function"));
   
   StringArray matlabPaths = fm->GetAllMatlabFunctionPaths();
   mMatlabPathPanel = new MultiPathSetupPanel(mPathNotebook, matlabPaths);
   mPathNotebook->AddPage(mMatlabPathPanel, wxT("MATLAB Function"));
   
   wxString outputPath = fm->GetFullPathname(wxT("OUTPUT_PATH"));
   
   #ifdef DEBUG_SETPATH_DIALOG_CREATE
   MessageInterface::ShowMessage(wxT("   outputPath='%s'\n"), outputPath.c_str());
   #endif
   
   mOutputPathPanel = new SinglePathSetupPanel(mPathNotebook, outputPath.c_str());
   mPathNotebook->AddPage(mOutputPathPanel, wxT("Output"));
   
   theMiddleSizer->Add(startupSizer, 0, wxALIGN_CENTER|wxGROW|wxALL, 5);
   theMiddleSizer->Add(mPathNotebook, 1, wxALIGN_CENTER|wxGROW|wxALL, 5);
}
Ejemplo n.º 2
0
//------------------------------------------------------------------------------
// virtual void LoadData()
//------------------------------------------------------------------------------
void SetPathDialog::LoadData()
{
   FileManager *fm = FileManager::Instance();
   wxString startupPath = (fm->GetFullStartupFilePath()).c_str();
   mReadFileTextCtrl->SetValue(startupPath.c_str());
}