diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-03-26 15:54:26 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-03-26 15:54:26 -0300 |
commit | 64ed394cdc4b3347768c2e1996518f02982b2ef5 (patch) | |
tree | 98248f9c8120cb3c04cadc14b68f0415bd7f6568 /Project/MainFrame.cpp | |
parent | e5a5041915127e72820a0478724a20dc41f0327e (diff) | |
download | PSP.git-64ed394cdc4b3347768c2e1996518f02982b2ef5.tar.gz PSP.git-64ed394cdc4b3347768c2e1996518f02982b2ef5.tar.xz PSP.git-64ed394cdc4b3347768c2e1996518f02982b2ef5.zip |
Import file GUI implemented
Diffstat (limited to 'Project/MainFrame.cpp')
-rw-r--r-- | Project/MainFrame.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Project/MainFrame.cpp b/Project/MainFrame.cpp index 41fe59b..a4fdbbc 100644 --- a/Project/MainFrame.cpp +++ b/Project/MainFrame.cpp @@ -34,6 +34,7 @@ #include "ChartView.h" #include "DataReport.h" #include "AboutForm.h" +#include "ImportForm.h" MainFrame::MainFrame() : MainFrameBase(NULL) {} MainFrame::MainFrame(wxWindow* parent, wxLocale* locale, PropertiesData* initProperties, wxString openPath) @@ -238,7 +239,7 @@ void MainFrame::OnEnableSolutionClick(wxRibbonButtonBarEvent& event) m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_DISABLESOL, false); } -void MainFrame::OnExpImpClick(wxRibbonButtonBarEvent& event) {} +//void MainFrame::OnExpImpClick(wxRibbonButtonBarEvent& event) {} void MainFrame::OnFaultClick(wxRibbonButtonBarEvent& event) { if(Workspace* workspace = dynamic_cast<Workspace*>(m_auiNotebook->GetCurrentPage())) { @@ -476,6 +477,24 @@ void MainFrame::OnAddElementsClick(wxCommandEvent& event) } } } + +void MainFrame::OnImportClick(wxRibbonButtonBarEvent& event) +{ + // Create a new workspace to import + Workspace* impWorkspace = new Workspace(this, _("Imported project"), this->GetStatusBar(), m_sharedGLContext); + ImportForm importForm(this, impWorkspace); + if(importForm.ShowModal() == wxID_OK) { + // Import file(s) + if(!m_sharedGLContext) m_sharedGLContext = impWorkspace->GetOpenGLContext(); + m_workspaceList.push_back(impWorkspace); + m_auiNotebook->AddPage(impWorkspace, impWorkspace->GetName(), true); + m_auiNotebook->Layout(); + impWorkspace->Redraw(); + impWorkspace->SetJustOpened(true); + m_projectNumber++; + } +} + void MainFrame::NotebookPageClosed(wxAuiNotebookEvent& event) { if(m_auiNotebook->GetPageCount() == 0) EnableCurrentProjectRibbon(false); |