diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-02 12:02:11 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-02 12:02:11 +0100 |
| commit | e40f98ccda04da3bb9811b354b770fb8c6b563e5 (patch) | |
| tree | 3b0258e0cb3eca9f979d79d71da938fa7efb4bc8 /src/game_tab/right_panel/editor/EditorCanvas.hpp | |
| parent | d05093513ec5124feed0dc6140789f48218b45c9 (diff) | |
| parent | 042f6ca17012414d13235d3e04ea9012ff49f79c (diff) | |
Improve game tab
Diffstat (limited to 'src/game_tab/right_panel/editor/EditorCanvas.hpp')
| -rw-r--r-- | src/game_tab/right_panel/editor/EditorCanvas.hpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/game_tab/right_panel/editor/EditorCanvas.hpp b/src/game_tab/right_panel/editor/EditorCanvas.hpp index 05d6258..740a6a1 100644 --- a/src/game_tab/right_panel/editor/EditorCanvas.hpp +++ b/src/game_tab/right_panel/editor/EditorCanvas.hpp @@ -4,22 +4,18 @@ #include "CGEditor.hpp" #include "ochess.hpp" #include "../../left_panel/board/Theme.hpp" +#include "game_tab/Game.hpp" // Foreign events -wxDECLARE_EVENT(GOTO_MOVE_EVENT, wxCommandEvent); -wxDECLARE_EVENT(PREVIOUS_MOVE_EVENT, wxCommandEvent); -wxDECLARE_EVENT(NEXT_MOVE_EVENT, wxCommandEvent); -wxDECLARE_EVENT(DELETE_MOVE_EVENT, wxCommandEvent); -wxDECLARE_EVENT(PROMOTE_MOVE_EVENT, wxCommandEvent); -wxDECLARE_EVENT(SET_AS_MAINLINE_EVENT, wxCommandEvent); +wxDECLARE_EVENT(GAME_CHANGE, wxCommandEvent); class EditorCanvas : public wxPanel, public cgeditor::CGEditor { wxPaintDC *dc; - bool NeedRedraw; wxPoint Middle(cgeditor::Element e); wxBitmap hide_icon; Theme t; wxFont default_font; + std::shared_ptr<Game> game; wxColour color_scrollbar_bg; wxColour color_scrollbar; @@ -29,13 +25,12 @@ class EditorCanvas : public wxPanel, public cgeditor::CGEditor { wxColour color_menu_item_bg; public: - EditorCanvas(wxFrame *parent); + EditorCanvas(wxFrame *parent, std::shared_ptr<Game> game); void OnPaint(wxPaintEvent &event); void MouseEvent(wxMouseEvent &event); void DrawElement(const cgeditor::Element &e); void HandleEvent(const cgeditor::Event &e); void SetMoves(HalfMove *moves, HalfMove *current); - void OnKeyEvent(wxKeyEvent &event); DECLARE_EVENT_TABLE() }; |
