2022-02-23 18:11:55 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-28 13:44:27 +01:00
|
|
|
#include "../../HalfMove.hpp"
|
2022-02-23 18:11:55 +01:00
|
|
|
#include "CGEditor.hpp"
|
|
|
|
#include "ochess.hpp"
|
2022-02-28 13:44:27 +01:00
|
|
|
#include "../../left_panel/board/Theme.hpp"
|
2022-02-23 18:11:55 +01:00
|
|
|
|
|
|
|
// 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;
|
2022-12-30 10:02:56 +01:00
|
|
|
wxFont default_font;
|
2022-02-23 18:11:55 +01:00
|
|
|
|
|
|
|
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()
|
|
|
|
};
|