diff options
Diffstat (limited to 'src/MainWindow.cpp')
| -rw-r--r-- | src/MainWindow.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index a0e2ce6..7e50150 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -53,6 +53,7 @@ MainWindow::MainWindow() Bind(wxEVT_MENU, &MainWindow::OnMenuItemClick, this, wxID_ANY); Bind(REFRESH_ENGINE_LIST, &MainWindow::OnRefreshEngineList, this, wxID_ANY); Bind(CLOSE_LINKED_TAB, &MainWindow::OnCloseTabLinkedTo, this, wxID_ANY); + Bind(wxEVT_AUINOTEBOOK_PAGE_CLOSED, &MainWindow::OnAuiNotebookPageClosed, this, wxID_ANY); // Add new game tab by default NewGame(std::shared_ptr<Game>(new Game())); @@ -66,10 +67,19 @@ void MainWindow::AddPage(wxWindow* window, TabInfos* infos){ window->SetClientData(infos); notebook->AddPage(window, window->GetLabel()); notebook->SetSelection(notebook->GetPageIndex(window)); + // Refresh tab that require knowledge on other tabs + for(auto i: wxGetApp().ListTabInfos()){i->Refresh();} +} + +void MainWindow::OnAuiNotebookPageClosed(wxAuiNotebookEvent& event){ + // Refresh tab that require knowledge on other tabs + for(auto i: wxGetApp().ListTabInfos()){i->Refresh();} } void MainWindow::OnCloseTabEvent(wxCommandEvent &event) { notebook->DeletePage(notebook->GetSelection()); + // Refresh tab that require knowledge on other tabs + for(auto i: wxGetApp().ListTabInfos()){i->Refresh();} } void MainWindow::OnCloseTabLinkedTo(wxCommandEvent &event){ |
