diff options
Diffstat (limited to 'src/MainWindow.cpp')
| -rw-r--r-- | src/MainWindow.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index efe3f06..348e772 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -7,6 +7,7 @@ wxDEFINE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent); wxDEFINE_EVENT(NEW_GAME_EVENT, wxCommandEvent); +wxDEFINE_EVENT(CLOSE_TAB_EVENT, wxCommandEvent); /// ---------- MainWindow ---------- @@ -64,16 +65,24 @@ MainWindow::MainWindow() Bind(REFRESH_TAB_TITLE, &MainWindow::OnRefreshTabTitle, this, wxID_ANY); Bind(NEW_GAME_EVENT, &MainWindow::OnNewGame, this, wxID_ANY); Bind(wxEVT_CLOSE_WINDOW, &MainWindow::OnClose, this); + Bind(CLOSE_TAB_EVENT, &MainWindow::OnCloseTabEvent, this, wxID_ANY); /*BaseTab *bt = new BaseTab((wxFrame *)notebook, "/home/loic/hartwig_tests.pgn"); notebook->AddPage(bt, bt->GetLabel()); notebook->SetSelection(notebook->GetPageIndex(bt));*/ - - /*EngineTab *bt = new EngineTab((wxWindow *)notebook, - "/home/loic/.local/bin/stockfish"); notebook->AddPage(bt, bt->GetLabel()); +/* + EngineTab *bt = + new EngineTab((wxWindow *)notebook, + new uciadapter::UCI("/home/loic/.local/bin/stockfish"), + "/home/loic/.local/bin/stockfish"); + notebook->AddPage(bt, bt->GetLabel()); notebook->SetSelection(notebook->GetPageIndex(bt));*/ } +void MainWindow::OnCloseTabEvent(wxCommandEvent &event) { + notebook->DeletePage(notebook->GetSelection()); +} + void MainWindow::OnNewEngine(wxCommandEvent &event) { wxFileDialog openFileDialog(this, _("Use engine"), "", "", "Executable|*", wxFD_OPEN | wxFD_FILE_MUST_EXIST); |
