From 8cc460fd202703646f7c908a4fb2a485b21dc9e1 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 25 Dec 2022 17:58:28 +0100 Subject: [PATCH] Improve game list --- src/base_tab/BaseGameTab.cpp | 1 + src/gui.cpp | 16 +++ src/gui.h | 3 + tools/wxFrameBuilder.fbp | 209 +++++++++++++++++++++++++++++++++++ 4 files changed, 229 insertions(+) diff --git a/src/base_tab/BaseGameTab.cpp b/src/base_tab/BaseGameTab.cpp index 0b73146..6084d67 100644 --- a/src/base_tab/BaseGameTab.cpp +++ b/src/base_tab/BaseGameTab.cpp @@ -18,6 +18,7 @@ BaseGameTab::BaseGameTab(wxFrame *parent, std::string base_file, TabInfos *main_ this->Bind(wxEVT_BUTTON, &BaseGameTab::OnImport, this, ID_IMPORT_BUTTON); current_base->SetLabel(base_file); + search_terms->SetHint("e.g: Paul Morphy"); LoadFile(); } diff --git a/src/gui.cpp b/src/gui.cpp index 7172171..db34ebb 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -542,6 +542,22 @@ TabBase_TabGames::TabBase_TabGames( wxWindow* parent, wxWindowID id, const wxPoi separator_1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); main_sizer->Add( separator_1, 0, wxEXPAND | wxALL, 5 ); + wxBoxSizer* bSizer34; + bSizer34 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText28 = new wxStaticText( this, wxID_ANY, wxT("Filter:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText28->Wrap( -1 ); + bSizer34->Add( m_staticText28, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + search_terms = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer34->Add( search_terms, 1, wxALL|wxEXPAND, 5 ); + + apply_filter_button = new wxButton( this, wxID_ANY, wxT("Apply"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer34->Add( apply_filter_button, 0, wxALL, 5 ); + + + main_sizer->Add( bSizer34, 0, wxEXPAND, 5 ); + game_list = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxLC_REPORT ); main_sizer->Add( game_list, 1, wxALL|wxEXPAND, 5 ); diff --git a/src/gui.h b/src/gui.h index 6d5af5b..3775973 100644 --- a/src/gui.h +++ b/src/gui.h @@ -312,6 +312,9 @@ class TabBase_TabGames : public wxPanel wxButton* save_button; wxButton* export_button; wxStaticLine* separator_1; + wxStaticText* m_staticText28; + wxTextCtrl* search_terms; + wxButton* apply_filter_button; wxListCtrl* game_list; wxButton* import_button; wxButton* delete_button; diff --git a/tools/wxFrameBuilder.fbp b/tools/wxFrameBuilder.fbp index 19d7c97..99b3709 100644 --- a/tools/wxFrameBuilder.fbp +++ b/tools/wxFrameBuilder.fbp @@ -5439,6 +5439,215 @@ + + 5 + wxEXPAND + 0 + + + bSizer34 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Filter: + 0 + + 0 + + + 0 + + 1 + m_staticText28 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + search_terms + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Apply + + 0 + + 0 + + + 0 + + 1 + apply_filter_button + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 wxALL|wxEXPAND