OChess v0.0.2
Programmer's Manual
MainWindow.hpp
1#pragma once
2
3#include "base_tab/BaseTab.hpp"
4#include "game_tab/GameTab.hpp"
5#include <wx/aui/auibook.h>
6#include <wx/filedlg.h>
7#include <wx/preferences.h>
8#include <wx/textdlg.h>
9#include "config.h"
10#include "binres/binres.hpp"
11
12wxDECLARE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent);
13wxDECLARE_EVENT(NEW_GAME_EVENT, wxCommandEvent);
14wxDECLARE_EVENT(CLOSE_TAB_EVENT, wxCommandEvent);
15wxDECLARE_EVENT(REFRESH_ENGINE_LIST, wxCommandEvent);
16wxDECLARE_EVENT(CLOSE_LINKED_TAB, wxCommandEvent);
17
22class MainWindow : public MainFrame {
24 wxPreferencesEditor *prefsEditor;
26 wxMenu *manageMenu;
29
30 void OnClose(wxCloseEvent &e);
31 void NewGame(bool useFen);
32 void OnPageChange(wxAuiNotebookEvent &event);
33 void OnRefreshTabTitle(wxCommandEvent &event);
34 void OpenSettings();
36 void NewEngine();
37 void OnCloseTabEvent(wxCommandEvent &event);
38 void OnRefreshEngineList(wxCommandEvent &event);
39 void OnMenuItemClick(wxCommandEvent &event);
40 void OnAuiNotebookPageClosed(wxAuiNotebookEvent& event);
41 void OnAuiNotebookPageCheck(wxAuiNotebookEvent& event);
42 void OnCloseTabLinkedTo(wxCommandEvent &event);
43 void AddPage(wxWindow* window, TabInfos* infos);
44 void ShowAbout();
45public:
46 MainWindow();
47 TabInfos* NewGame(std::shared_ptr<Game> game);
49 void ApplyPreferences();
50};
Binary resources functions.
Class MainFrame.
Definition: gui.h:76
Main GUI window of OChess.
Definition: MainWindow.hpp:22
void ApplyPreferences()
Apply preferences to MainWindow and all the opened tabs.
Definition: MainWindow.cpp:235
MainWindow()
-------— MainWindow -------—
Definition: MainWindow.cpp:17
void NewEngine()
Setting up a new chess engine (select executable and open engine tab)
Definition: MainWindow.cpp:209
wxPreferencesEditor * prefsEditor
Preference popup window.
Definition: MainWindow.hpp:24
wxMenu * manageMenu
Menu to manage existing chess engines.
Definition: MainWindow.hpp:26
int engine_count
Store the number of available chess engines (to create entries in the menus)
Definition: MainWindow.hpp:28
Used by each tab of the GUI to attach additional informations and features.
Definition: ochess.hpp:47