diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-24 10:18:02 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-24 10:18:02 +0100 |
| commit | bdfc577a3b8c360d48c4d094d532786de44c5aed (patch) | |
| tree | bebe68b8584da7a05ee58a8f26746fcdbfc0cbb5 /src | |
| parent | a8fece4ea62a4831c923ebc7e3ce11d594f9da23 (diff) | |
Start BaseTab design
Diffstat (limited to 'src')
| -rw-r--r-- | src/MainWindow.cpp | 6 | ||||
| -rw-r--r-- | src/MainWindow.hpp | 1 | ||||
| -rw-r--r-- | src/base_tab/BasePanelBF.cpp | 55 | ||||
| -rw-r--r-- | src/base_tab/BasePanelBF.h | 52 | ||||
| -rw-r--r-- | src/base_tab/BaseTab.cpp | 0 | ||||
| -rw-r--r-- | src/base_tab/BaseTab.hpp | 12 | ||||
| -rw-r--r-- | src/ochess.hpp | 2 |
7 files changed, 127 insertions, 1 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 83fd964..0a79bc2 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -43,6 +43,12 @@ MainWindow::MainWindow() notebook = new wxAuiNotebook(this, wxID_ANY); NewGame(new Game()); + // Test base tab + BaseTab *bt = new BaseTab((wxFrame *)notebook); + bt->SetLabel("New Base"); + notebook->AddPage(bt, bt->GetLabel()); + notebook->SetSelection(notebook->GetPageIndex(bt)); + Bind(wxEVT_AUINOTEBOOK_PAGE_CHANGED, &MainWindow::OnPageChange, this, wxID_ANY); Bind(REFRESH_TAB_TITLE, &MainWindow::OnRefreshTabTitle, this, wxID_ANY); diff --git a/src/MainWindow.hpp b/src/MainWindow.hpp index 31e63d8..87cf015 100644 --- a/src/MainWindow.hpp +++ b/src/MainWindow.hpp @@ -1,4 +1,5 @@ #include "game_tab/GameTab.hpp" +#include "base_tab/BaseTab.hpp" #include "ochess.hpp" #include <wx/aui/auibook.h> #include <wx/filedlg.h> diff --git a/src/base_tab/BasePanelBF.cpp b/src/base_tab/BasePanelBF.cpp new file mode 100644 index 0000000..4edf8b0 --- /dev/null +++ b/src/base_tab/BasePanelBF.cpp @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version 3.10.1-40-g8042f487) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "BasePanelBF.h" + +/////////////////////////////////////////////////////////////////////////// + +BasePanelBF::BasePanelBF( 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_label = new wxStaticText( this, wxID_ANY, wxT("Current base:"), wxDefaultPosition, wxDefaultSize, 0 ); + current_base_label->Wrap( -1 ); + top_sizer->Add( current_base_label, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + current_base = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + top_sizer->Add( current_base, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + open_button = new wxButton( this, wxID_ANY, wxT("Open"), wxDefaultPosition, wxDefaultSize, 0 ); + top_sizer->Add( open_button, 0, wxALL, 5 ); + + save_as_button = new wxButton( this, wxID_ANY, wxT("Save as"), wxDefaultPosition, wxDefaultSize, 0 ); + top_sizer->Add( save_as_button, 0, wxALL, 5 ); + + + main_sizer->Add( top_sizer, 0, wxEXPAND, 5 ); + + game_list = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxLC_ICON ); + main_sizer->Add( game_list, 1, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bottom_sizer; + bottom_sizer = new wxBoxSizer( wxHORIZONTAL ); + + delete_button = new wxButton( this, wxID_ANY, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 ); + bottom_sizer->Add( delete_button, 0, wxALL, 5 ); + + + main_sizer->Add( bottom_sizer, 0, wxEXPAND, 5 ); + + + this->SetSizer( main_sizer ); + this->Layout(); +} + +BasePanelBF::~BasePanelBF() +{ +} diff --git a/src/base_tab/BasePanelBF.h b/src/base_tab/BasePanelBF.h new file mode 100644 index 0000000..4e0e107 --- /dev/null +++ b/src/base_tab/BasePanelBF.h @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version 3.10.1-40-g8042f487) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include <wx/artprov.h> +#include <wx/xrc/xmlres.h> +#include <wx/string.h> +#include <wx/stattext.h> +#include <wx/gdicmn.h> +#include <wx/font.h> +#include <wx/colour.h> +#include <wx/settings.h> +#include <wx/textctrl.h> +#include <wx/button.h> +#include <wx/bitmap.h> +#include <wx/image.h> +#include <wx/icon.h> +#include <wx/sizer.h> +#include <wx/listctrl.h> +#include <wx/panel.h> + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class BasePanelBF +/////////////////////////////////////////////////////////////////////////////// +class BasePanelBF : public wxPanel +{ + private: + + protected: + wxStaticText* current_base_label; + wxTextCtrl* current_base; + wxButton* open_button; + wxButton* save_as_button; + wxListCtrl* game_list; + wxButton* delete_button; + + public: + + BasePanelBF( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 884,624 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + + ~BasePanelBF(); + +}; + diff --git a/src/base_tab/BaseTab.cpp b/src/base_tab/BaseTab.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/base_tab/BaseTab.cpp diff --git a/src/base_tab/BaseTab.hpp b/src/base_tab/BaseTab.hpp new file mode 100644 index 0000000..56d254c --- /dev/null +++ b/src/base_tab/BaseTab.hpp @@ -0,0 +1,12 @@ + + +#include "BasePanelBF.h" + +class BaseTab : public BasePanelBF, public TabInfos { + +public: + BaseTab(wxFrame *parent) : BasePanelBF(parent),TabInfos(TabInfos::BASE) {} + void ApplyPreferences(){ + + } +};
\ No newline at end of file diff --git a/src/ochess.hpp b/src/ochess.hpp index 687d44f..3869d99 100644 --- a/src/ochess.hpp +++ b/src/ochess.hpp @@ -50,7 +50,7 @@ void Abort(std::string msg); */ class TabInfos { public: - typedef enum Type { GAME, NONE } Type; + typedef enum Type { GAME, BASE,NONE } Type; Type type; TabInfos(Type type_) : type(type_) {} virtual void ApplyPreferences() = 0; |
