-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainEditorFrame.hpp
66 lines (65 loc) · 2.05 KB
/
MainEditorFrame.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* @file MainEditorFrame.hpp
* @brief This class is responsible for managing the main frame of the application.
* @version 0.1
* @date 2024-01-30
* @Author Renato German Chavez Chicoma
*/
#ifndef EDITOR_MAINEDITORFRAME_HPP
#define EDITOR_MAINEDITORFRAME_HPP
#include <wx/wx.h>
#include <wx/stc/stc.h>
#include <wx/button.h>
#include <wx/wfstream.h>
#include "Constants.hpp"
#include "FindDialog.hpp"
#include <wx/filename.h>
#include <wx/timer.h>
#include <algorithm>
#include "app.hpp"
#include "EditorComponent.hpp"
#include "ToolbarComponent.hpp"
#include "FileOperations.hpp"
#include "LayoutComponent.hpp"
#include "StatusBarComponent.hpp"
#include <wx/icon.h>
#include <filesystem>
class MainEditorFrame : public wxFrame
{
private:
wxTimer m_timer;
wxDECLARE_EVENT_TABLE();
static const int ZOOM_INCREMENT = 12;
private:
std::unique_ptr<EditorComponent> m_editorComponent;
std::unique_ptr<ToolbarComponent> m_toolbarComponent;
std::unique_ptr<FileOperations> m_fileOperations;
std::unique_ptr<LayoutComponent> m_layoutComponent;
std::unique_ptr<StatusBarComponent> m_statusBarComponent;
public:
MainEditorFrame(const wxString &title, const wxPoint &pos, const wxSize &size);
void OnToggleDarkMode(wxCommandEvent &event);
void ApplyEditorStyles(bool isDarkMode);
void OnFind(wxCommandEvent& event);
void OnReplace(wxCommandEvent& event);
void OnEditorUpdate(wxCommandEvent& event);
void OnTimer(wxTimerEvent& event);
void OnZoomIn(wxCommandEvent& event);
void OnZoomOut(wxCommandEvent& event);
void SaveLastFilePath(const wxString& path);
wxString LoadLastFilePath();
void OnMarginLeftDown(wxMouseEvent& event);
void OnMarginLeftUp(wxMouseEvent& event);
void OnMarginMotion(wxMouseEvent& event);
void SetDefaultStatusText();
void InitializeFrame();
void InitializeEditor();
void SetupLayout();
void BindButtonEvents();
void BindEditorEvents();
void LoadLastFile();
private:
void InitializeComponents();
void InitializeUI();
};
#endif //EDITOR_MAINEDITORFRAME_HPP