diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-30 13:17:06 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-30 13:17:06 +0100 |
| commit | 98e31a2c11fc1ae3dbc93576956ce3f4faad7fbd (patch) | |
| tree | 54b7df1f6e3b5887ecc7072ae719911c29ec4427 /src/game_tab/left_panel/GameTabLeftPanel.cpp | |
| parent | 2fd237a78ffd78e198bfb68ba2fc9fa296a1fe9f (diff) | |
Improve UI
Diffstat (limited to 'src/game_tab/left_panel/GameTabLeftPanel.cpp')
| -rw-r--r-- | src/game_tab/left_panel/GameTabLeftPanel.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/game_tab/left_panel/GameTabLeftPanel.cpp b/src/game_tab/left_panel/GameTabLeftPanel.cpp index d1604e4..c5bf8ae 100644 --- a/src/game_tab/left_panel/GameTabLeftPanel.cpp +++ b/src/game_tab/left_panel/GameTabLeftPanel.cpp @@ -4,9 +4,13 @@ GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, std::shared_ptr<Game> game) : TabGameLeftPanel(parent), game(game), repeat(false) { + // Configure toolbal + game_toolbar->AddTool(0, wxT("Exit application"), + wxArtProvider::GetBitmap(wxART_FILE_SAVE, wxART_TOOLBAR)); + // Add board board_canvas = new BoardCanvas((wxFrame *)this); - main_sizer->Insert(0, board_canvas, 1, wxEXPAND); + main_sizer->Insert(1, board_canvas, 1, wxEXPAND); // Configure buttons swap_button->SetBitmapLabel(LoadPNG("swap")); @@ -22,6 +26,16 @@ GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, std::shared_ptr<Game> game) Bind(wxEVT_BUTTON, &GameTabLeftPanel::OnZoomOut, this, ZOOM_OUT_BTN); Bind(wxEVT_KEY_DOWN, [p=this](wxKeyEvent &e){e.ResumePropagation(1);e.Skip();}); Bind(wxEVT_KEY_UP, [p=this](wxKeyEvent &e){e.ResumePropagation(1);e.Skip();}); + game_toolbar->Bind(wxEVT_TOOL,&GameTabLeftPanel::OnToolClick,this); +} + +void GameTabLeftPanel::OnToolClick(wxCommandEvent &event){ + short id=event.GetId(); + if(id==0){ + if(related_file.size()>0){ + // Todo implement save file + } + } } void GameTabLeftPanel::PreviousMove(bool isKeyDown) { @@ -90,7 +104,8 @@ void GameTabLeftPanel::Notify(bool animate, bool backward) { last_absolute_move=m->GetAbsoluteMove(); } board_canvas->SetupBoard(chessarbiter::FENParser::Parse(fen).board, - game->IsBlackToPlay(), captures); + game->IsBlackToPlay(), captures, + game->GetTag("White"),game->GetTag("Black")); } else{ if(backward && last_absolute_move.size()>0){ |
