Update chessarbiter and improve pgn loader

This commit is contained in:
Loic Guegan 2022-02-24 16:45:28 +01:00
parent f99a7b699a
commit 829525acb9
8 changed files with 29 additions and 10 deletions

View file

@ -4,6 +4,7 @@
#include "preferences/preferences.hpp"
wxDEFINE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent);
wxDEFINE_EVENT(NEW_GAME_EVENT, wxCommandEvent);
/// ---------- MainWindow ----------
@ -52,6 +53,7 @@ MainWindow::MainWindow()
Bind(wxEVT_AUINOTEBOOK_PAGE_CHANGED, &MainWindow::OnPageChange, this,
wxID_ANY);
Bind(REFRESH_TAB_TITLE, &MainWindow::OnRefreshTabTitle, this, wxID_ANY);
Bind(NEW_GAME_EVENT, &MainWindow::OnNewGame2, this, wxID_ANY);
Bind(wxEVT_CLOSE_WINDOW, &MainWindow::OnClose, this);
}
@ -142,6 +144,11 @@ void MainWindow::OnNewGame(wxCommandEvent &event) {
}
}
void MainWindow::OnNewGame2(wxCommandEvent &event) {
Game *g=(Game*)event.GetClientData();
NewGame(g);
}
void MainWindow::OnPageChange(wxAuiNotebookEvent &event) {
TabInfos *infos = dynamic_cast<TabInfos *>(notebook->GetCurrentPage());
if (infos->type != TabInfos::GAME) {