aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/BaseTab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base_tab/BaseTab.cpp')
-rw-r--r--src/base_tab/BaseTab.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/base_tab/BaseTab.cpp b/src/base_tab/BaseTab.cpp
index a76ba38..a2b7207 100644
--- a/src/base_tab/BaseTab.cpp
+++ b/src/base_tab/BaseTab.cpp
@@ -16,6 +16,17 @@ BaseTab::BaseTab(wxFrame *parent, std::string base_file)
notebook->AddPage(manage_tab, "Manage database");
RefreshLabel();
+ this->Bind(OPEN_GAME_EVENT, &BaseTab::OnNewGame, this, wxID_ANY);
+}
+
+
+void BaseTab::OnNewGame(wxCommandEvent &event){
+ std::shared_ptr<Game> *g = (std::shared_ptr<Game>*)event.GetClientData();
+ this->game=*g;
+ wxCommandEvent newGameEvent(NEW_GAME_EVENT, GetId());
+ newGameEvent.SetEventObject(this);
+ newGameEvent.SetClientData((TabInfos*)this);
+ ProcessEvent(newGameEvent);
}
void BaseTab::ApplyPreferences() {}