ochess/src/game_tab/right_panel/editor/EditorCanvas.hpp

37 lines
964 B
C++
Raw Normal View History

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"
2023-01-01 14:12:57 +01:00
#include "game_tab/Game.hpp"
2022-02-23 18:11:55 +01:00
// Foreign events
2023-01-01 14:12:57 +01:00
wxDECLARE_EVENT(GAME_CHANGE, wxCommandEvent);
2022-02-23 18:11:55 +01:00
class EditorCanvas : public wxPanel, public cgeditor::CGEditor {
wxPaintDC *dc;
wxPoint Middle(cgeditor::Element e);
wxBitmap hide_icon;
Theme t;
2022-12-30 10:02:56 +01:00
wxFont default_font;
2023-01-01 14:12:57 +01:00
std::shared_ptr<Game> game;
2022-02-23 18:11:55 +01:00
2023-01-01 12:15:08 +01:00
wxColour color_scrollbar_bg;
wxColour color_scrollbar;
wxColour color_margin;
wxColour color_comments_bg;
wxColour color_current_move_bg;
wxColour color_menu_item_bg;
2022-02-23 18:11:55 +01:00
public:
2023-01-01 14:12:57 +01:00
EditorCanvas(wxFrame *parent, std::shared_ptr<Game> game);
2022-02-23 18:11:55 +01:00
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 ApplyPreferences();
2022-02-23 18:11:55 +01:00
DECLARE_EVENT_TABLE()
};