aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/right_panel
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/right_panel')
-rw-r--r--src/game_tab/right_panel/GameTabRightPanel.cpp19
-rw-r--r--src/game_tab/right_panel/GameTabRightPanel.hpp8
2 files changed, 14 insertions, 13 deletions
diff --git a/src/game_tab/right_panel/GameTabRightPanel.cpp b/src/game_tab/right_panel/GameTabRightPanel.cpp
index f421228..29f91b7 100644
--- a/src/game_tab/right_panel/GameTabRightPanel.cpp
+++ b/src/game_tab/right_panel/GameTabRightPanel.cpp
@@ -1,11 +1,6 @@
#include "GameTabRightPanel.hpp"
-wxDEFINE_EVENT(GOTO_MOVE_EVENT, wxCommandEvent);
-wxDEFINE_EVENT(DELETE_MOVE_EVENT, wxCommandEvent);
-wxDEFINE_EVENT(PROMOTE_MOVE_EVENT, wxCommandEvent);
-wxDEFINE_EVENT(SET_AS_MAINLINE_EVENT, wxCommandEvent);
-wxDEFINE_EVENT(PREVIOUS_MOVE_EVENT, wxCommandEvent);
-wxDEFINE_EVENT(NEXT_MOVE_EVENT, wxCommandEvent);
+wxDEFINE_EVENT(LIVE_ANALYSIS_STATUS, wxCommandEvent);
GameTabRightPanel::GameTabRightPanel(wxFrame *parent, std::shared_ptr<Game> game)
: TabGameRightPanel(parent), game(game), selected_item(-1),
@@ -53,6 +48,12 @@ void GameTabRightPanel::OnLiveAnalysis(wxCommandEvent &event) {
if (live_engine == nullptr) {
int selection = engine_list->GetSelection();
if (selection != wxNOT_FOUND) {
+ // Notify about the state of the LiveEngine
+ wxCommandEvent notifyEvent(LIVE_ANALYSIS_STATUS,GetId());
+ notifyEvent.SetEventObject(this);
+ notifyEvent.SetInt(1);
+ ProcessEvent(notifyEvent);
+
live_engine = new LiveEngineDialog(
this, engine_list->GetString(selection).ToStdString());
live_engine->SetFEN(game->GetFen());
@@ -87,6 +88,12 @@ void GameTabRightPanel::OnTagDeselected(wxListEvent &event) {
}
void GameTabRightPanel::OnLiveEngineClose(wxCloseEvent &e) {
+ // Notify about the state of the LiveEngine
+ wxCommandEvent notifyEvent(LIVE_ANALYSIS_STATUS,GetId());
+ notifyEvent.SetEventObject(this);
+ notifyEvent.SetInt(0);
+ ProcessEvent(notifyEvent);
+ // Refresh pointer
live_engine = nullptr;
e.Skip();
}
diff --git a/src/game_tab/right_panel/GameTabRightPanel.hpp b/src/game_tab/right_panel/GameTabRightPanel.hpp
index 1b94e86..903b83d 100644
--- a/src/game_tab/right_panel/GameTabRightPanel.hpp
+++ b/src/game_tab/right_panel/GameTabRightPanel.hpp
@@ -7,16 +7,10 @@
#include <wx/listctrl.h>
#include <wx/notebook.h>
-// Local events
-wxDECLARE_EVENT(GOTO_MOVE_EVENT, wxCommandEvent);
-wxDECLARE_EVENT(DELETE_MOVE_EVENT, wxCommandEvent);
-wxDECLARE_EVENT(PROMOTE_MOVE_EVENT, wxCommandEvent);
-wxDECLARE_EVENT(SET_AS_MAINLINE_EVENT, wxCommandEvent);
-wxDECLARE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent);
-
// Foreign events
wxDECLARE_EVENT(GAME_CHANGE, wxCommandEvent);
wxDECLARE_EVENT(SHOW_ENGINE_EVALUATION, wxCommandEvent);
+wxDECLARE_EVENT(LIVE_ANALYSIS_STATUS, wxCommandEvent);
class GameTabRightPanel : public TabGameRightPanel {
std::shared_ptr<Game> game;