aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/right_panel/editor/EditorCanvas.hpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-28 13:44:27 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-28 13:44:27 +0100
commitbf485fa577a76731f9eac97de3b0a647cd492e49 (patch)
tree731d9ec91070406124044e75b4b27949e5d230c0 /src/game_tab/right_panel/editor/EditorCanvas.hpp
parent7178f18ab88bcc93bfbf2019adf53d2f60d8fa20 (diff)
Refactoring game tab
Diffstat (limited to 'src/game_tab/right_panel/editor/EditorCanvas.hpp')
-rw-r--r--src/game_tab/right_panel/editor/EditorCanvas.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/game_tab/right_panel/editor/EditorCanvas.hpp b/src/game_tab/right_panel/editor/EditorCanvas.hpp
new file mode 100644
index 0000000..c2f35c8
--- /dev/null
+++ b/src/game_tab/right_panel/editor/EditorCanvas.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include "../../HalfMove.hpp"
+#include "CGEditor.hpp"
+#include "ochess.hpp"
+#include "../../left_panel/board/Theme.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);
+
+class EditorCanvas : public wxPanel, public cgeditor::CGEditor {
+ wxPaintDC *dc;
+ bool NeedRedraw;
+ wxPoint Middle(cgeditor::Element e);
+ wxBitmap hide_icon;
+ Theme t;
+
+public:
+ EditorCanvas(wxFrame *parent);
+ 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()
+};