welcome_dialog.h

main 109 lines · 3.4 KB Raw
Alex Alex Commit Map Editor 18/10/2026 23:40
1//////////////////////////////////////////////////////////////////////
2// This file is part of Remere's Map Editor
3//////////////////////////////////////////////////////////////////////
4// Remere's Map Editor is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Remere's Map Editor is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//////////////////////////////////////////////////////////////////////
17
18#ifndef WELCOME_DIALOG_H
19#define WELCOME_DIALOG_H
20
21#include <wx/wx.h>
22
23wxDECLARE_EVENT(WELCOME_DIALOG_ACTION, wxCommandEvent);
24
25class WelcomeDialogPanel;
26
27class WelcomeDialog : public wxDialog {
28public:
29 WelcomeDialog(const wxString& titleText, const wxString& versionText, const wxSize& size, const wxBitmap& rmeLogo, const std::vector<wxString>& recentFiles);
30 void OnButtonClicked(const wxMouseEvent& event);
31 void OnCheckboxClicked(const wxCommandEvent& event);
32 void OnRecentItemClicked(const wxMouseEvent& event);
33
34private:
35 WelcomeDialogPanel* m_welcome_dialog_panel;
36};
37
38class WelcomeDialogPanel : public wxPanel {
39public:
40 WelcomeDialogPanel(WelcomeDialog* parent, const wxSize& size, const wxString& title_text, const wxString& version_text, const wxColour& base_colour, const wxBitmap& rme_logo, const std::vector<wxString>& recent_files);
41 void OnPaint(const wxPaintEvent& event);
42 void updateInputs();
43
44private:
45 wxBitmap m_rme_logo;
46 wxString m_title_text;
47 wxString m_version_text;
48 wxColour m_text_colour;
49 wxColour m_background_colour;
50 wxCheckBox* m_show_welcome_dialog_checkbox;
51};
52
53class WelcomeDialogButton : public wxPanel {
54public:
55 WelcomeDialogButton(wxWindow* parent, const wxPoint& pos, const wxSize& size, const wxColour& base_colour, const wxString& text);
56 void OnPaint(const wxPaintEvent& event);
57 void OnMouseEnter(const wxMouseEvent& event);
58 void OnMouseLeave(const wxMouseEvent& event);
59 wxStandardID GetAction() {
60 return m_action;
61 };
62 void SetAction(wxStandardID action) {
63 m_action = action;
64 };
65
66private:
67 wxStandardID m_action;
68 wxString m_text;
69 wxColour m_text_colour;
70 wxColour m_background;
71 wxColour m_background_hover;
72 bool m_is_hover;
73};
74
75class RecentMapsPanel : public wxPanel {
76public:
77 RecentMapsPanel(wxWindow* parent, WelcomeDialog* dialog, const wxColour& base_colour, const std::vector<wxString>& recent_files);
78};
79
80class WhatsNewPanel : public wxPanel {
81public:
82 WhatsNewPanel(wxWindow* parent, const wxColour& base_colour);
83 void LoadWhatsNew();
84private:
85 wxTextCtrl* whats_new_text;
86 wxColour m_text_colour;
87 wxColour m_background_colour;
88};
89
90class RecentItem : public wxPanel {
91public:
92 RecentItem(wxWindow* parent, const wxColour& base_colour, const wxString& item_name);
93 void OnMouseEnter(const wxMouseEvent& event);
94 void OnMouseLeave(const wxMouseEvent& event);
95 void PropagateItemClicked(wxMouseEvent& event);
96 wxString GetText() {
97 return m_item_text;
98 };
99
100private:
101 wxColour m_text_colour;
102 wxColour m_text_colour_hover;
103 wxStaticText* m_title;
104 wxStaticText* m_file_path;
105 wxString m_item_text;
106};
107
108#endif // WELCOME_DIALOG_H
109
Top