mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-18 11:49:43 +00:00
34 lines
957 B
C++
34 lines
957 B
C++
![]() |
#pragma once
|
||
|
|
||
|
#include "../HalfMove.hpp"
|
||
|
#include "CGEditor.hpp"
|
||
|
#include "ochess.hpp"
|
||
|
#include "../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()
|
||
|
};
|