diff options
Diffstat (limited to 'src/base_tab/BaseTab.cpp')
| -rw-r--r-- | src/base_tab/BaseTab.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/base_tab/BaseTab.cpp b/src/base_tab/BaseTab.cpp index 95a1a8d..82a0db0 100644 --- a/src/base_tab/BaseTab.cpp +++ b/src/base_tab/BaseTab.cpp @@ -1,7 +1,7 @@ #include "BaseTab.hpp" #include <wx/filename.h> -BaseTab::BaseTab(wxFrame *parent) +BaseTab::BaseTab(wxFrame *parent, std::string base_file) : BasePanelBF(parent), TabInfos(TabInfos::BASE), base(NULL) { game_list->InsertColumn(0, L"id", wxLIST_FORMAT_LEFT, 50); @@ -14,11 +14,11 @@ BaseTab::BaseTab(wxFrame *parent) this->Bind(wxEVT_BUTTON, &BaseTab::OnBim, this, wxID_ANY); this->Bind(wxEVT_LIST_ITEM_ACTIVATED, &BaseTab::OnOpenGame, this, wxID_ANY); + current_base->SetLabel(base_file); + LoadFile(base_file); } -void BaseTab::OnBim(wxCommandEvent &event) { - LoadFile("/home/loic/hartwig.pgn"); -} +void BaseTab::OnBim(wxCommandEvent &event) {} void BaseTab::OnOpenGame(wxListEvent &event) { wxLogDebug("Open!"); @@ -39,6 +39,7 @@ void BaseTab::LoadFile(std::string path) { wxString ext = file.GetExt().Lower(); if (ext == "pgn") { base = new PGNGameBase(path); + SetLabel(file.GetName()+ "(PGN)"); } if (base != NULL) { @@ -51,8 +52,12 @@ void BaseTab::LoadFile(std::string path) { game_list->SetItem(index, 3, base->GetTag("Event")); game_list->SetItem(index, 4, base->GetTag("Round")); game_list->SetItem(index, 5, base->GetTag("Result")); - game_list->SetItem(index, 5, base->GetTag("ECO")); + game_list->SetItem(index, 6, base->GetTag("ECO")); id++; } } + + wxCommandEvent event(REFRESH_TAB_TITLE, GetId()); + event.SetEventObject(this); + ProcessEvent(event); }
\ No newline at end of file |
