aboutsummaryrefslogtreecommitdiff
path: root/src/MainWindow.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-26 20:34:42 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-26 20:34:42 +0100
commite601902dd5a9f023594fef6a0f4995e59b4d9a0e (patch)
tree4ed1fdbaa9503a2dcfbc701377d9f5d2309858c3 /src/MainWindow.cpp
parentca6c1b1e75e771e3bea596367e502b77dea2c3aa (diff)
Improve engine managemen
Diffstat (limited to 'src/MainWindow.cpp')
-rw-r--r--src/MainWindow.cpp15
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);