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.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/base_tab/BaseTab.cpp b/src/base_tab/BaseTab.cpp
index f1fd107..29b6fc3 100644
--- a/src/base_tab/BaseTab.cpp
+++ b/src/base_tab/BaseTab.cpp
@@ -22,10 +22,13 @@ void BaseTab::OnBim(wxCommandEvent &event) {
void BaseTab::OnOpenGame(wxListEvent &event) {
wxLogDebug("Open!");
- long id=std::stoi(event.GetItem().GetText().ToStdString());
+ long id = std::stoi(event.GetItem().GetText().ToStdString());
Game *g = base->GetGame(id);
if (g != NULL) {
- wxLogDebug("Open game: %s", g->GetTag("White"));
+ wxCommandEvent newGameEvent(NEW_GAME_EVENT, GetId());
+ newGameEvent.SetEventObject(this);
+ newGameEvent.SetClientData(g);
+ ProcessEvent(newGameEvent);
}
}
@@ -41,7 +44,8 @@ void BaseTab::LoadFile(std::string path) {
if (base != NULL) {
long id = 0;
while (base->NextGame()) {
- long index = game_list->InsertItem(0, std::to_string(id)); // want this for col. 1
+ long index =
+ game_list->InsertItem(0, std::to_string(id)); // want this for col. 1
game_list->SetItem(index, 1, base->GetTag("White"));
game_list->SetItem(index, 2, base->GetTag("Black"));
game_list->SetItem(index, 3, base->GetTag("Event"));