ochess/src/MainWindow.hpp

37 lines
1 KiB
C++
Raw Normal View History

2022-02-26 12:30:07 +01:00
#pragma once
2022-02-24 10:18:02 +01:00
#include "base_tab/BaseTab.hpp"
#include "game_tab/GameTab.hpp"
2022-02-23 18:11:55 +01:00
#include "ochess.hpp"
#include <wx/aui/auibook.h>
#include <wx/filedlg.h>
2022-02-23 19:41:50 +01:00
#include <wx/preferences.h>
#include <wx/textdlg.h>
2022-02-23 18:11:55 +01:00
wxDECLARE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent);
wxDECLARE_EVENT(NEW_GAME_EVENT, wxCommandEvent);
2022-02-26 20:34:42 +01:00
wxDECLARE_EVENT(CLOSE_TAB_EVENT, wxCommandEvent);
2022-02-26 21:43:09 +01:00
wxDECLARE_EVENT(REFRESH_ENGINE_LIST, wxCommandEvent);
2022-02-23 18:11:55 +01:00
2022-02-28 15:27:51 +01:00
class MainWindow : public MainFrame {
2022-02-23 19:41:50 +01:00
wxPreferencesEditor *prefsEditor;
2022-02-26 21:43:09 +01:00
wxMenu *manageMenu;
2022-02-23 18:11:55 +01:00
2022-02-23 19:41:50 +01:00
void OnClose(wxCloseEvent &e);
2022-02-26 21:43:09 +01:00
void NewGame(bool useFen);
2022-02-23 18:11:55 +01:00
void OnNewGame(wxCommandEvent &event);
2022-02-26 21:43:09 +01:00
void OpenFile();
2022-02-23 18:11:55 +01:00
void OnPageChange(wxAuiNotebookEvent &event);
void OnRefreshTabTitle(wxCommandEvent &event);
2022-12-24 12:46:59 +01:00
TabInfos* NewGame(std::shared_ptr<Game> game);
2022-02-26 21:43:09 +01:00
void OpenSettings();
void NewEngine();
2022-02-26 20:34:42 +01:00
void OnCloseTabEvent(wxCommandEvent &event);
2022-02-26 21:43:09 +01:00
void OnRefreshEngineList(wxCommandEvent &event);
void OnMenuItemClick(wxCommandEvent &event);
2022-02-23 18:11:55 +01:00
public:
MainWindow();
void ApplyPreferences();
2022-02-26 21:43:09 +01:00
std::vector<TabInfos *> ListTabInfos();
2022-02-23 18:11:55 +01:00
};