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
273610cb0f
commit
2d9730e216
8 changed files with 35 additions and 13 deletions
|
@ -191,9 +191,9 @@ void MainWindow::NewGame(bool useFen) {
|
|||
}
|
||||
|
||||
void MainWindow::OnNewGame(wxCommandEvent &event) {
|
||||
std::shared_ptr<Game> *g = (std::shared_ptr<Game>*)event.GetClientData();
|
||||
NewGame(*g);
|
||||
delete g;
|
||||
TabInfos *tab = (TabInfos*)event.GetClientData();
|
||||
TabInfos *i=NewGame(tab->GetGame());
|
||||
i->Link(tab);
|
||||
}
|
||||
|
||||
void MainWindow::OnPageChange(wxAuiNotebookEvent &event) {
|
||||
|
@ -215,8 +215,9 @@ void MainWindow::OnRefreshTabTitle(wxCommandEvent &event) {
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::NewGame(std::shared_ptr<Game> game) {
|
||||
TabInfos* MainWindow::NewGame(std::shared_ptr<Game> game) {
|
||||
GameTab *gt = new GameTab((wxFrame *)notebook, game);
|
||||
notebook->AddPage(gt, gt->GetLabel());
|
||||
notebook->SetSelection(notebook->GetPageIndex(gt));
|
||||
return(gt);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue