aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/left_panel
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-28 14:02:02 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-28 14:02:02 +0100
commit81d7a419624e79ec3fa6c4bcb52fccaa6004065b (patch)
tree5ec6cd8fee592e8e9feca9f140a8d722f03f4608 /src/game_tab/left_panel
parentbf485fa577a76731f9eac97de3b0a647cd492e49 (diff)
Improve game tab left panel
Diffstat (limited to 'src/game_tab/left_panel')
-rw-r--r--src/game_tab/left_panel/GameTabLeftPanel.cpp26
-rw-r--r--src/game_tab/left_panel/GameTabLeftPanel.hpp3
2 files changed, 9 insertions, 20 deletions
diff --git a/src/game_tab/left_panel/GameTabLeftPanel.cpp b/src/game_tab/left_panel/GameTabLeftPanel.cpp
index 79894d0..bc33d33 100644
--- a/src/game_tab/left_panel/GameTabLeftPanel.cpp
+++ b/src/game_tab/left_panel/GameTabLeftPanel.cpp
@@ -2,24 +2,16 @@
#include <wx/clipbrd.h>
GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, Game *game)
- : wxPanel(parent), game(game) {
+ : TabGameLeftPanel(parent), game(game) {
- wxBoxSizer *board_panel_sizer = new wxBoxSizer(wxVERTICAL);
+ // Add board
board_canvas = new BoardCanvas((wxFrame *)this);
- board_panel_sizer->Add(board_canvas, 1, wxEXPAND);
+ main_sizer->Insert(0, board_canvas, 1, wxEXPAND);
- // Left Panel buttons
- wxBoxSizer *board_panel_button_sizer = new wxBoxSizer(wxHORIZONTAL);
- board_panel_button_sizer->Add(
- new wxBitmapButton(this, SWAP_BTN, LoadPNG("swap")), 0);
- board_panel_button_sizer->Add(
- new wxBitmapButton(this, ZOOM_IN_BTN, LoadPNG("zoomin")), 0);
- board_panel_button_sizer->Add(
- new wxBitmapButton(this, ZOOM_OUT_BTN, LoadPNG("zoomout")), 0);
- board_panel_button_sizer->Add(new wxButton(this, COPY_FEN_BTN, L"Copy FEN"),
- 0, wxEXPAND);
- board_panel_sizer->Add(board_panel_button_sizer, 0);
- this->SetSizer(board_panel_sizer);
+ // Configure buttons
+ swap_button->SetBitmapLabel(LoadPNG("swap"));
+ zoomin_button->SetBitmapLabel(LoadPNG("zoomin"));
+ zoomout_button->SetBitmapLabel(LoadPNG("zoomout"));
Bind(PLAY_MOVE_EVENT, &GameTabLeftPanel::OnPlay, this, wxID_ANY);
Bind(PREVIOUS_MOVE_EVENT, &GameTabLeftPanel::OnPreviousMove, this, wxID_ANY);
@@ -91,6 +83,4 @@ void GameTabLeftPanel::NotifyEditor() {
ProcessEvent(previousEvent);
}
-void GameTabLeftPanel::ApplyPreferences() {
- board_canvas->ApplyPreferences();
-}
+void GameTabLeftPanel::ApplyPreferences() { board_canvas->ApplyPreferences(); }
diff --git a/src/game_tab/left_panel/GameTabLeftPanel.hpp b/src/game_tab/left_panel/GameTabLeftPanel.hpp
index 85b1e6e..d2ad3f1 100644
--- a/src/game_tab/left_panel/GameTabLeftPanel.hpp
+++ b/src/game_tab/left_panel/GameTabLeftPanel.hpp
@@ -7,9 +7,8 @@
// Foreign events
wxDECLARE_EVENT(GAME_CHANGE, wxCommandEvent);
-enum { COPY_FEN_BTN = wxID_HIGHEST + 1, ZOOM_IN_BTN, ZOOM_OUT_BTN, SWAP_BTN };
-class GameTabLeftPanel : public wxPanel {
+class GameTabLeftPanel : public TabGameLeftPanel {
Game *game;
BoardCanvas *board_canvas;
void NotifyEditor();