diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-30 15:58:13 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-30 15:58:13 +0100 |
| commit | 2045a1250a3ae04d7b9ea8e97317e62f55b69247 (patch) | |
| tree | 2e132c890439753de52feb80de298898788ef05c /src/game_tab/left_panel | |
| parent | 27ac369fb6b773f642eabed087194ff7e95f9156 (diff) | |
Improve UI
Diffstat (limited to 'src/game_tab/left_panel')
| -rw-r--r-- | src/game_tab/left_panel/GameTabLeftPanel.cpp | 19 | ||||
| -rw-r--r-- | src/game_tab/left_panel/GameTabLeftPanel.hpp | 3 |
2 files changed, 3 insertions, 19 deletions
diff --git a/src/game_tab/left_panel/GameTabLeftPanel.cpp b/src/game_tab/left_panel/GameTabLeftPanel.cpp index 4f09bdd..33383fd 100644 --- a/src/game_tab/left_panel/GameTabLeftPanel.cpp +++ b/src/game_tab/left_panel/GameTabLeftPanel.cpp @@ -5,7 +5,7 @@ GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, std::shared_ptr<Game> game) : TabGameLeftPanel(parent), game(game), repeat(false) { // Configure toolbal - game_toolbar->AddTool(0, wxT("Exit application"), + game_toolbar->AddTool(0, wxT("Save As"), wxArtProvider::GetBitmap(wxART_FILE_SAVE, wxART_TOOLBAR)); // Add board @@ -26,24 +26,9 @@ 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){ - wxFileDialog - newFileDialog(this, _("Save Game"), "", "", - "PGN files (*.pgn)|*.pgn", wxFD_SAVE|wxFD_OVERWRITE_PROMPT); - if (newFileDialog.ShowModal() == wxID_CANCEL) - return; - // Create and open new db - related_file = newFileDialog.GetPath().ToStdString(); - } - SaveGame(related_file,game); - } -} + void GameTabLeftPanel::PreviousMove(bool isKeyDown) { if(isKeyDown){ diff --git a/src/game_tab/left_panel/GameTabLeftPanel.hpp b/src/game_tab/left_panel/GameTabLeftPanel.hpp index d9995e4..3adbaee 100644 --- a/src/game_tab/left_panel/GameTabLeftPanel.hpp +++ b/src/game_tab/left_panel/GameTabLeftPanel.hpp @@ -15,7 +15,6 @@ class GameTabLeftPanel : public TabGameLeftPanel { void NotifyEditor(); std::string last_absolute_move; bool repeat; - std::string related_file; public: GameTabLeftPanel(wxFrame *parent, std::shared_ptr<Game> game); @@ -29,5 +28,5 @@ public: void OnSwap(wxCommandEvent &event); void OnRefreshBoard(wxCommandEvent &event); void ApplyPreferences(); - void OnToolClick(wxCommandEvent &event); + void DisableSaveTool(){game_toolbar->EnableTool(0,false);}; };
\ No newline at end of file |
