Update GUI

This commit is contained in:
Loic Guegan 2022-02-25 08:49:57 +01:00
parent 9b2ebc19a6
commit 416ab7635d
4 changed files with 25 additions and 16 deletions

View file

@ -19,25 +19,32 @@ MainWindow::MainWindow()
wxMenu *menuFile = new wxMenu;
menuFile->Append(1, "Open", "Open file");
Bind(wxEVT_MENU, &MainWindow::OnOpen, this, 1);
menuFile->AppendSeparator();
menuFile->Append(10, "Save", "Save current game");
menuFile->Append(11, "Save As", "Save current game as");
menuFile->AppendSeparator();
menuFile->Append(4, "Settings", "Configure OChess");
Bind(wxEVT_MENU, &MainWindow::OnSettings, this, 4);
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT);
Bind(wxEVT_MENU, &MainWindow::OnExit, this, wxID_EXIT);
// Game menu
menuGame = new wxMenu;
menuGame->Append(2, "New", "Create new game");
Bind(wxEVT_MENU, &MainWindow::OnMenuNewGame, this, 2);
menuGame->Append(3, "New from FEN", "Create new game using FEN");
Bind(wxEVT_MENU, &MainWindow::OnMenuNewGame, this, 3);
menuGame->AppendSeparator();
menuGame->Append(10, "Save", "Save current game");
menuGame->Append(11, "Save As", "Save current game as");
// Game base menu
wxMenu *menuBase = new wxMenu;
menuBase->Append(5, "New", "Create new database");
/// Menu bar
menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File");
menuBar->Append(menuGame, "&Game");
menuBar->Append(menuBase, "&Database");
SetMenuBar(menuBar);
// Create the wxNotebook widget
@ -145,7 +152,7 @@ void MainWindow::OnMenuNewGame(wxCommandEvent &event) {
}
void MainWindow::OnNewGame(wxCommandEvent &event) {
Game *g=(Game*)event.GetClientData();
Game *g = (Game *)event.GetClientData();
NewGame(g);
}

View file

@ -22,13 +22,15 @@ BasePanelBF::BasePanelBF( wxWindow* parent, wxWindowID id, const wxPoint& pos, c
top_sizer->Add( current_base_label, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
current_base = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
current_base->Enable( false );
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_button = new wxButton( this, wxID_ANY, wxT("Save"), wxDefaultPosition, wxDefaultSize, 0 );
top_sizer->Add( save_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 );
export_button = new wxButton( this, wxID_ANY, wxT("Export"), wxDefaultPosition, wxDefaultSize, 0 );
top_sizer->Add( export_button, 0, wxALL, 5 );
main_sizer->Add( top_sizer, 0, wxEXPAND, 5 );
@ -39,7 +41,7 @@ BasePanelBF::BasePanelBF( wxWindow* parent, wxWindowID id, const wxPoint& pos, c
wxBoxSizer* bottom_sizer;
bottom_sizer = new wxBoxSizer( wxHORIZONTAL );
delete_button = new wxButton( this, wxID_ANY, wxT("Delete"), wxDefaultPosition, wxDefaultSize, 0 );
delete_button = new wxButton( this, wxID_ANY, wxT("Delete selection"), wxDefaultPosition, wxDefaultSize, 0 );
bottom_sizer->Add( delete_button, 0, wxALL, 5 );

View file

@ -37,8 +37,8 @@ class BasePanelBF : public wxPanel
protected:
wxStaticText* current_base_label;
wxTextCtrl* current_base;
wxButton* open_button;
wxButton* save_as_button;
wxButton* save_button;
wxButton* export_button;
wxListCtrl* game_list;
wxButton* delete_button;

View file

@ -152,7 +152,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="enabled">0</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
@ -229,7 +229,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Open</property>
<property name="label">Save</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
@ -239,7 +239,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">open_button</property>
<property name="name">save_button</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -302,7 +302,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Save as</property>
<property name="label">Export</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
@ -312,7 +312,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">save_as_button</property>
<property name="name">export_button</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>