aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/BaseTab.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-25 09:21:26 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-25 09:21:26 +0100
commit4adb5ff056d4a5a35cd7f76a9785c5cab57fdc03 (patch)
tree80b468c7325b5cd4bf87fe4a2d97def4fdd54370 /src/base_tab/BaseTab.cpp
parent416ab7635d74f04797c067c185df35f8476d87c1 (diff)
Improve game base panel
Diffstat (limited to 'src/base_tab/BaseTab.cpp')
-rw-r--r--src/base_tab/BaseTab.cpp15
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