Skip to content

Commit

Permalink
Close project implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Thales1330 committed Jul 9, 2020
1 parent c38d051 commit cd3ba24
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Project/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,25 @@ void MainFrame::OnChartsClick(wxRibbonButtonBarEvent& event)
}
}

void MainFrame::OnCloseClick(wxRibbonButtonBarEvent& event) {}
void MainFrame::OnCloseClick(wxRibbonButtonBarEvent& event)
{
auto it = m_workspaceList.begin();
while (it != m_workspaceList.end()) {
if (*it == m_auiNotebook->GetCurrentPage()) {
if ((*it)->GetSharedGLContext() == m_sharedGLContext) m_sharedGLContext = nullptr;
m_workspaceList.erase(it);
m_auiNotebook->DeletePage(m_auiNotebook->GetPageIndex(m_auiNotebook->GetCurrentPage()));
break;
}
++it;
}
if (!m_sharedGLContext && !m_workspaceList.empty()) {
m_sharedGLContext = m_workspaceList[0]->GetSharedGLContext();
}
else if (m_workspaceList.empty()) {
EnableCurrentProjectRibbon(false);
}
}
void MainFrame::OnCopyClick(wxRibbonButtonBarEvent& event) {}
void MainFrame::OnDataReportClick(wxRibbonButtonBarEvent& event)
{
Expand Down Expand Up @@ -716,7 +734,7 @@ void MainFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event)
void MainFrame::OnProjectSettingsClick(wxRibbonButtonBarEvent& event)
{
Workspace* workspace = static_cast<Workspace*>(m_auiNotebook->GetCurrentPage());
if(workspace) {
if (workspace) {
ProjectPropertiesForm ppf(this, workspace);
ppf.ShowModal();
workspace->UpdateHeatMap();
Expand Down

0 comments on commit cd3ba24

Please sign in to comment.