diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-25 19:30:23 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-25 19:30:23 +0100 |
| commit | 29f330f307e35acf9dba3a8456dec330ef578dd7 (patch) | |
| tree | d14022436d68c59adb14b93e08011c8ef4756ce3 /src/MainWindow.cpp | |
| parent | 5df6e9395c4ec744f38e7ce874ff7c02e8a3afbd (diff) | |
Update tab management system
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){ |
