diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-28 15:27:51 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-28 15:27:51 +0100 |
| commit | cd2c9e5b470255366464131492389cb0928cc5d1 (patch) | |
| tree | 547cc3daf07708dfbc6cde2801209caa73c54d4c /src/game_tab | |
| parent | 81d7a419624e79ec3fa6c4bcb52fccaa6004065b (diff) | |
Improve GUI and debug various classes
Diffstat (limited to 'src/game_tab')
| -rw-r--r-- | src/game_tab/GameTab.cpp | 3 | ||||
| -rw-r--r-- | src/game_tab/left_panel/GameTabLeftPanel.cpp | 13 | ||||
| -rw-r--r-- | src/game_tab/left_panel/GameTabLeftPanel.hpp | 1 |
3 files changed, 5 insertions, 12 deletions
diff --git a/src/game_tab/GameTab.cpp b/src/game_tab/GameTab.cpp index cf49991..c3aceb8 100644 --- a/src/game_tab/GameTab.cpp +++ b/src/game_tab/GameTab.cpp @@ -7,8 +7,7 @@ GameTab::GameTab(wxFrame *parent, Game *game) : wxPanel(parent), game(game), TabInfos(TabInfos::GAME) { // Splitter wxSplitterWindow *splitter = new wxSplitterWindow(this, wxID_ANY); - splitter->SetMinimumPaneSize(100); - + splitter->SetSashGravity(0.8); // Panels game->BuildAndVerify(); board_panel = new GameTabLeftPanel((wxFrame *)splitter, game); 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() { diff --git a/src/game_tab/left_panel/GameTabLeftPanel.hpp b/src/game_tab/left_panel/GameTabLeftPanel.hpp index d2ad3f1..c4b58b9 100644 --- a/src/game_tab/left_panel/GameTabLeftPanel.hpp +++ b/src/game_tab/left_panel/GameTabLeftPanel.hpp @@ -20,7 +20,6 @@ public: void OnGotoMove(wxCommandEvent &event); void OnPreviousMove(wxCommandEvent &event); void OnNextMove(wxCommandEvent &event); - void OnCopyFEN(wxCommandEvent &event); void OnZoomIn(wxCommandEvent &event); void OnZoomOut(wxCommandEvent &event); void OnSwap(wxCommandEvent &event); |
