diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-24 12:46:59 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-24 12:46:59 +0100 |
| commit | 2d9730e216976103daea64a8df047d5f0dffd5f7 (patch) | |
| tree | 894454165b388167c077619c0a0388338c828c05 /src/base_tab/BaseTab.cpp | |
| parent | 273610cb0f848fd99f9b9769f0d60b6e2df590ed (diff) | |
Update tab management system
Diffstat (limited to 'src/base_tab/BaseTab.cpp')
| -rw-r--r-- | src/base_tab/BaseTab.cpp | 11 |
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() {} |
