diff --git a/src/base_tab/BaseTab.cpp b/src/base_tab/BaseTab.cpp index 157b3d0..19e9f0e 100644 --- a/src/base_tab/BaseTab.cpp +++ b/src/base_tab/BaseTab.cpp @@ -3,7 +3,7 @@ #include BaseTab::BaseTab(wxFrame *parent, std::string base_file) - : TabBase(parent), base_file(base_file), TabInfos(TabInfos::BASE), + : TabBase_TabGames(parent), base_file(base_file), TabInfos(TabInfos::BASE), base(NULL) { game_list->InsertColumn(0, L"id", wxLIST_FORMAT_LEFT, 50); diff --git a/src/base_tab/BaseTab.hpp b/src/base_tab/BaseTab.hpp index 9679f44..b265414 100644 --- a/src/base_tab/BaseTab.hpp +++ b/src/base_tab/BaseTab.hpp @@ -7,7 +7,7 @@ wxDECLARE_EVENT(NEW_GAME_EVENT, wxCommandEvent); wxDECLARE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent); -class BaseTab : public TabBase, public TabInfos { +class BaseTab : public TabBase_TabGames, public TabInfos { std::shared_ptr base; std::vector deleted; std::vector> edited; diff --git a/src/gui.cpp b/src/gui.cpp index 897ef15..f706a5e 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-40-g8042f487) +// C++ code generated with wxFormBuilder (version 3.10.1-88b0f50) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -375,42 +375,9 @@ TabBase::TabBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxS wxBoxSizer* main_sizer; main_sizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* top_sizer; - top_sizer = new wxBoxSizer( wxHORIZONTAL ); + notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE ); - current_base = new wxStaticText( this, wxID_ANY, wxT("unknown"), wxDefaultPosition, wxDefaultSize, 0 ); - current_base->Wrap( -1 ); - top_sizer->Add( current_base, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - save_button = new wxButton( this, ID_SAVE_BUTTON, wxT("Save"), wxDefaultPosition, wxDefaultSize, 0 ); - top_sizer->Add( save_button, 0, wxALL, 5 ); - - export_button = new wxButton( this, ID_EXPORT_BUTTON, wxT("Export"), wxDefaultPosition, wxDefaultSize, 0 ); - top_sizer->Add( export_button, 0, wxALL, 5 ); - - - main_sizer->Add( top_sizer, 0, wxEXPAND, 5 ); - - separator_1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - main_sizer->Add( separator_1, 0, wxEXPAND | wxALL, 5 ); - - wxBoxSizer* bottom_sizer; - bottom_sizer = new wxBoxSizer( wxHORIZONTAL ); - - - bottom_sizer->Add( 0, 0, 1, wxEXPAND, 5 ); - - import_button = new wxButton( this, ID_IMPORT_BUTTON, wxT("Import games"), wxDefaultPosition, wxDefaultSize, 0 ); - bottom_sizer->Add( import_button, 0, wxALL, 5 ); - - delete_button = new wxButton( this, ID_DELETE_BUTTON, wxT("Delete selection"), wxDefaultPosition, wxDefaultSize, 0 ); - bottom_sizer->Add( delete_button, 0, wxALL, 5 ); - - - main_sizer->Add( bottom_sizer, 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 ); + main_sizer->Add( notebook, 1, wxEXPAND | wxALL, 5 ); this->SetSizer( main_sizer ); @@ -550,3 +517,54 @@ TabGameRightPanel::TabGameRightPanel( wxWindow* parent, wxWindowID id, const wxP TabGameRightPanel::~TabGameRightPanel() { } + +TabBase_TabGames::TabBase_TabGames( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) +{ + wxBoxSizer* main_sizer; + main_sizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* top_sizer; + top_sizer = new wxBoxSizer( wxHORIZONTAL ); + + current_base = new wxStaticText( this, wxID_ANY, wxT("unknown"), wxDefaultPosition, wxDefaultSize, 0 ); + current_base->Wrap( -1 ); + top_sizer->Add( current_base, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + save_button = new wxButton( this, ID_SAVE_BUTTON, wxT("Save"), wxDefaultPosition, wxDefaultSize, 0 ); + top_sizer->Add( save_button, 0, wxALL, 5 ); + + export_button = new wxButton( this, ID_EXPORT_BUTTON, wxT("Export"), wxDefaultPosition, wxDefaultSize, 0 ); + top_sizer->Add( export_button, 0, wxALL, 5 ); + + + main_sizer->Add( top_sizer, 0, wxEXPAND, 5 ); + + separator_1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + main_sizer->Add( separator_1, 0, wxEXPAND | wxALL, 5 ); + + wxBoxSizer* bottom_sizer; + bottom_sizer = new wxBoxSizer( wxHORIZONTAL ); + + + bottom_sizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + import_button = new wxButton( this, ID_IMPORT_BUTTON, wxT("Import games"), wxDefaultPosition, wxDefaultSize, 0 ); + bottom_sizer->Add( import_button, 0, wxALL, 5 ); + + delete_button = new wxButton( this, ID_DELETE_BUTTON, wxT("Delete selection"), wxDefaultPosition, wxDefaultSize, 0 ); + bottom_sizer->Add( delete_button, 0, wxALL, 5 ); + + + main_sizer->Add( bottom_sizer, 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 ); + + + this->SetSizer( main_sizer ); + this->Layout(); +} + +TabBase_TabGames::~TabBase_TabGames() +{ +} diff --git a/src/gui.h b/src/gui.h index c0f8a84..dc4a14b 100644 --- a/src/gui.h +++ b/src/gui.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-40-g8042f487) +// C++ code generated with wxFormBuilder (version 3.10.1-88b0f50) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -47,17 +47,17 @@ #define ID_DIALOG_IMPORT_BUTTON 1003 #define ENGINE_SAVE_CONF_BUTTON 1004 #define ENGINE_DELETE_CONF_BUTTON 1005 -#define ID_SAVE_BUTTON 1006 -#define ID_EXPORT_BUTTON 1007 -#define ID_IMPORT_BUTTON 1008 -#define ID_DELETE_BUTTON 1009 -#define SWAP_BTN 1010 -#define ZOOM_IN_BTN 1011 -#define ZOOM_OUT_BTN 1012 -#define COMMENT_INPUT_BOX 1013 -#define UPDATE_BTN 1014 -#define DELETE_BTN 1015 -#define LIVE_ANALYSIS_GAME_BUTTON 1016 +#define SWAP_BTN 1006 +#define ZOOM_IN_BTN 1007 +#define ZOOM_OUT_BTN 1008 +#define COMMENT_INPUT_BOX 1009 +#define UPDATE_BTN 1010 +#define DELETE_BTN 1011 +#define LIVE_ANALYSIS_GAME_BUTTON 1012 +#define ID_SAVE_BUTTON 1013 +#define ID_EXPORT_BUTTON 1014 +#define ID_IMPORT_BUTTON 1015 +#define ID_DELETE_BUTTON 1016 /////////////////////////////////////////////////////////////////////////////// /// Class MainFrame @@ -232,13 +232,7 @@ class TabBase : public wxPanel private: protected: - wxStaticText* current_base; - wxButton* save_button; - wxButton* export_button; - wxStaticLine* separator_1; - wxButton* import_button; - wxButton* delete_button; - wxListCtrl* game_list; + wxAuiNotebook* notebook; public: @@ -305,3 +299,27 @@ class TabGameRightPanel : public wxPanel }; +/////////////////////////////////////////////////////////////////////////////// +/// Class TabBase_TabGames +/////////////////////////////////////////////////////////////////////////////// +class TabBase_TabGames : public wxPanel +{ + private: + + protected: + wxStaticText* current_base; + wxButton* save_button; + wxButton* export_button; + wxStaticLine* separator_1; + wxButton* import_button; + wxButton* delete_button; + wxListCtrl* game_list; + + public: + + TabBase_TabGames( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + + ~TabBase_TabGames(); + +}; + diff --git a/tools/wxFrameBuilder.fbp b/tools/wxFrameBuilder.fbp index 4c7442c..cf465f1 100644 --- a/tools/wxFrameBuilder.fbp +++ b/tools/wxFrameBuilder.fbp @@ -29,7 +29,7 @@ 0 0 0 - + 0 wxAUI_MGR_DEFAULT @@ -122,7 +122,7 @@ - + main_sizer wxVERTICAL @@ -3622,7 +3622,7 @@ - + 0 wxAUI_MGR_DEFAULT @@ -3645,234 +3645,16 @@ wxTAB_TRAVERSAL - + main_sizer wxVERTICAL none - - 5 - wxEXPAND - 0 - - - top_sizer - wxHORIZONTAL - none - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - unknown - 0 - - 0 - - - 0 - - 1 - current_base - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - ID_SAVE_BUTTON - Save - - 0 - - 0 - - - 0 - - 1 - save_button - 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 - ID_EXPORT_BUTTON - Export - - 0 - - 0 - - - 0 - - 1 - export_button - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - + 5 wxEXPAND | wxALL - 0 - + 1 + 1 1 1 @@ -3907,7 +3689,7 @@ 0 1 - separator_1 + notebook 1 @@ -3917,239 +3699,12 @@ Resizable 1 - wxLI_HORIZONTAL + wxAUI_NB_DEFAULT_STYLE ; ; forward_declare + -1 0 - - - - - - - 5 - wxEXPAND - 0 - - - bottom_sizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 0 - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - ID_IMPORT_BUTTON - Import games - - 0 - - 0 - - - 0 - - 1 - import_button - 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 - ID_DELETE_BUTTON - Delete selection - - 0 - - 0 - - - 0 - - 1 - delete_button - 1 - - - protected - 1 - - - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 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 - game_list - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - wxLC_REPORT - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - + @@ -4157,7 +3712,7 @@ - + 0 wxAUI_MGR_DEFAULT @@ -4180,12 +3735,12 @@ wxTAB_TRAVERSAL - + main_sizer wxVERTICAL protected - + 5 wxEXPAND 0 @@ -4413,11 +3968,11 @@ - + 0 wxALL|wxEXPAND 1 - + 1 1 1 @@ -4481,7 +4036,7 @@ - + 0 wxAUI_MGR_DEFAULT @@ -5581,5 +5136,540 @@ + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 1 + impl_virtual + + + 0 + wxID_ANY + + + TabBase_TabGames + + 500,300 + ; ; forward_declare + + 0 + + + wxTAB_TRAVERSAL + + + main_sizer + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + + top_sizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + unknown + 0 + + 0 + + + 0 + + 1 + current_base + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_SAVE_BUTTON + Save + + 0 + + 0 + + + 0 + + 1 + save_button + 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 + ID_EXPORT_BUTTON + Export + + 0 + + 0 + + + 0 + + 1 + export_button + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + separator_1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND + 0 + + + bottom_sizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + ID_IMPORT_BUTTON + Import games + + 0 + + 0 + + + 0 + + 1 + import_button + 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 + ID_DELETE_BUTTON + Delete selection + + 0 + + 0 + + + 0 + + 1 + delete_button + 1 + + + protected + 1 + + + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 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 + game_list + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxLC_REPORT + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + +