OChess v0.0.2
Programmer's Manual
BaseTab.hpp
1#pragma once
2
3#include "gamebase/GameBase.hpp"
4#include "ochess.hpp"
5#include "BaseGameTab.hpp"
6#include "BaseImportTab.hpp"
7#include "BaseManageTab.hpp"
8
9// Foreign events
10wxDECLARE_EVENT(NEW_GAME_EVENT, wxCommandEvent);
11wxDECLARE_EVENT(CLOSE_LINKED_TAB, wxCommandEvent);
12
13// Local events
14wxDECLARE_EVENT(REFRESH_MANAGE_TAB, wxCommandEvent);
15
20class BaseTab : public TabBase, public TabInfos {
22 std::shared_ptr<GameBase> base;
24 std::shared_ptr<Game> game;
25
28 BaseImportTab *import_tab;
29 BaseManageTab *manage_tab;
30
32 std::string base_file;
33
35 void OnOpenGame(wxListEvent &event);
37 void OnSave(wxCommandEvent &event);
38
39public:
40 BaseTab(wxFrame *parent, std::string base_file);
41
42 void Refresh();
43 std::shared_ptr<Game> GetGame() { return (std::shared_ptr<Game>(game)); }
44 std::shared_ptr<GameBase> GetBase() { return (std::shared_ptr<GameBase>(base)); };
45};
A BaseTab sub-tab to list and search games.
Definition: BaseGameTab.hpp:12
A BaseTab sub-tab to import games.
Definition: BaseImportTab.hpp:13
A BaseTab sub-tab to manage games.
Definition: BaseManageTab.hpp:13
Class that represents an opened chess games database in the MainWindow.
Definition: BaseTab.hpp:20
std::shared_ptr< GameBase > base
The opened database.
Definition: BaseTab.hpp:22
std::shared_ptr< Game > game
The last opened game.
Definition: BaseTab.hpp:24
void OnSave(wxCommandEvent &event)
Listen events from BaseManageTab.
Definition: BaseTab.cpp:49
BaseGameTab * games_tab
All sub tabs from this main table.
Definition: BaseTab.hpp:27
std::string base_file
&#160;
Definition: BaseTab.hpp:32
void OnOpenGame(wxListEvent &event)
Listen events from BaseImportTab.
Definition: BaseTab.cpp:35
Class TabBase.
Definition: gui.h:266
Used by each tab of the GUI to attach additional informations and features.
Definition: ochess.hpp:47