OChess v0.0.2
Programmer's Manual
GameTab.hpp
1#pragma once
2#include "ChessArbiter.hpp"
3#include "Game.hpp"
4#include "HalfMove.hpp"
5#include "left_panel/GameTabLeftPanel.hpp"
6#include "right_panel/GameTabRightPanel.hpp"
7#include "ochess.hpp"
8#include <utility>
9#include <wx/collpane.h>
10#include <wx/splitter.h>
11#include <wx/textctrl.h>
12#include "right_panel/LiveEngineDialog.hpp"
13
14wxDECLARE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent);
15wxDECLARE_EVENT(GAME_CHANGE, wxCommandEvent);
16wxDECLARE_EVENT(SHOW_ENGINE_EVALUATION, wxCommandEvent);
17
22class GameTab : public wxPanel, public TabInfos {
23 GameTabRightPanel *editor_panel;
24 GameTabLeftPanel *board_panel;
25 std::shared_ptr<Game> game;
26 std::string related_file;
27
28 void RefreshLabel();
29 void RefreshTabTitle();
30 void OnGameChange(wxCommandEvent &event);
31 void OnToolClick(wxCommandEvent &event);
32
33public:
34 GameTab(wxFrame *parent, std::shared_ptr<Game> game);
35 void ApplyPreferences();
36 std::shared_ptr<Game> GetGame() { return (std::shared_ptr<Game>(game)); }
37 std::shared_ptr<GameBase> GetBase() { return nullptr; };
38 void OnLink(){board_panel->SetSaveToolEnable(false);};
39};
Panel that contains the BoardCanvas and the bottom control buttons.
Definition: GameTabLeftPanel.hpp:16
Right panel of the GameTab and contains the EditorCanvas and the live engine tab.
Definition: GameTabRightPanel.hpp:19
Main tab for opened games. Contains GameTabLeftPanel and GameTabRightPanel.
Definition: GameTab.hpp:22
void ApplyPreferences()
Can be called to load preferences that have been modify in the application settings.
Definition: GameTab.cpp:93
void OnLink()
Callback that is called when the current tab is linked to another one.
Definition: GameTab.hpp:38
Used by each tab of the GUI to attach additional informations and features.
Definition: ochess.hpp:47