OChess v0.0.2
Programmer's Manual
EditorCanvas.hpp
1#pragma once
2
3#include "../../HalfMove.hpp"
4#include "CGEditor.hpp"
5#include "ochess.hpp"
6#include "../../left_panel/board/Theme.hpp"
7#include "game_tab/Game.hpp"
8
9// Foreign events
10wxDECLARE_EVENT(GAME_CHANGE, wxCommandEvent);
11
16class EditorCanvas : public wxPanel, public cgeditor::CGEditor {
17 wxPaintDC *dc;
18 wxPoint Middle(cgeditor::Element e);
19 wxBitmap hide_icon;
20 Theme t;
21 wxFont default_font;
22 std::shared_ptr<Game> game;
23
24 wxColour color_scrollbar_bg;
25 wxColour color_scrollbar;
26 wxColour color_margin;
27 wxColour color_comments_bg;
28 wxColour color_current_move_bg;
29 wxColour color_menu_item_bg;
30
31public:
32 EditorCanvas(wxFrame *parent, std::shared_ptr<Game> game);
33 void OnPaint(wxPaintEvent &event);
34 void MouseEvent(wxMouseEvent &event);
35 void DrawElement(const cgeditor::Element &e);
36 void HandleEvent(const cgeditor::Event &e);
37 void SetMoves(HalfMove *moves, HalfMove *current);
38 void ApplyPreferences();
39 DECLARE_EVENT_TABLE()
40};
Contains the moves editor for the currently opened game.
Definition: EditorCanvas.hpp:16
wxPoint Middle(cgeditor::Element e)
Convenient fonction to center text.
Definition: EditorCanvas.cpp:48
This class extends CGEHalfMove (to be displayed in the game editor)
Definition: HalfMove.hpp:13
The in memory board theme (used by BoardCanvas)
Definition: Theme.hpp:19