mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-19 04:09:41 +00:00
Update tab management system
This commit is contained in:
parent
5df6e9395c
commit
29f330f307
9 changed files with 83 additions and 3 deletions
|
@ -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){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue