aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/left_panel/GameTabLeftPanel.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-28 15:27:51 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-28 15:27:51 +0100
commitcd2c9e5b470255366464131492389cb0928cc5d1 (patch)
tree547cc3daf07708dfbc6cde2801209caa73c54d4c /src/game_tab/left_panel/GameTabLeftPanel.cpp
parent81d7a419624e79ec3fa6c4bcb52fccaa6004065b (diff)
Improve GUI and debug various classes
Diffstat (limited to 'src/game_tab/left_panel/GameTabLeftPanel.cpp')
-rw-r--r--src/game_tab/left_panel/GameTabLeftPanel.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/game_tab/left_panel/GameTabLeftPanel.cpp b/src/game_tab/left_panel/GameTabLeftPanel.cpp
index bc33d33..d4c415d 100644
--- a/src/game_tab/left_panel/GameTabLeftPanel.cpp
+++ b/src/game_tab/left_panel/GameTabLeftPanel.cpp
@@ -13,13 +13,15 @@ GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, Game *game)
zoomin_button->SetBitmapLabel(LoadPNG("zoomin"));
zoomout_button->SetBitmapLabel(LoadPNG("zoomout"));
+ // Configure FEN field
+ fen_text_field->SetFont(wxFont(*wxSMALL_FONT).Bold());
+
Bind(PLAY_MOVE_EVENT, &GameTabLeftPanel::OnPlay, this, wxID_ANY);
Bind(PREVIOUS_MOVE_EVENT, &GameTabLeftPanel::OnPreviousMove, this, wxID_ANY);
Bind(NEXT_MOVE_EVENT, &GameTabLeftPanel::OnNextMove, this, wxID_ANY);
Bind(wxEVT_BUTTON, &GameTabLeftPanel::OnSwap, this, SWAP_BTN);
Bind(wxEVT_BUTTON, &GameTabLeftPanel::OnZoomIn, this, ZOOM_IN_BTN);
Bind(wxEVT_BUTTON, &GameTabLeftPanel::OnZoomOut, this, ZOOM_OUT_BTN);
- Bind(wxEVT_BUTTON, &GameTabLeftPanel::OnCopyFEN, this, COPY_FEN_BTN);
}
void GameTabLeftPanel::OnPreviousMove(wxCommandEvent &event) {
@@ -58,14 +60,6 @@ void GameTabLeftPanel::OnPlay(wxCommandEvent &event) {
Notify();
}
-void GameTabLeftPanel::OnCopyFEN(wxCommandEvent &event) {
- wxLogDebug("Clicked on copy fen");
- if (wxTheClipboard->Open()) {
- wxTheClipboard->SetData(new wxTextDataObject(game->GetFen()));
- wxTheClipboard->Close();
- }
-}
-
void GameTabLeftPanel::Notify() {
std::string fen = game->GetFen();
std::map<char, std::uint8_t> captures;
@@ -75,6 +69,7 @@ void GameTabLeftPanel::Notify() {
}
board_canvas->SetupBoard(chessarbiter::FENParser::Parse(fen).board,
game->IsBlackToPlay(), captures);
+ fen_text_field->SetValue(game->GetFen());
}
void GameTabLeftPanel::NotifyEditor() {