cpp-project-template 0.0.1.0
C++ Project Template
Loading...
Searching...
No Matches
MainFrame.hpp
Go to the documentation of this file.
1
10
11#ifndef CPP_PROJ_MAINFRAME
12#define CPP_PROJ_MAINFRAME
13
14// For compilers that support precompilation, includes "wx/wx.h".
15#include <wx/wxprec.h>
16
17#ifndef WX_PRECOMP
18 #include <wx/wx.h>
19#endif
20
21namespace cpp_proj
22{
23
24class App;
25
29class MainFrame : public wxFrame
30{
31public:
40 MainFrame(const App& app, const wxString& title, const wxPoint& pos,
41 const wxSize& size);
42
43 ~MainFrame() override = default;
44 MainFrame(const MainFrame&) = delete;
45 MainFrame& operator=(const MainFrame&) = delete;
46 MainFrame(MainFrame&&) = delete;
48
49private:
50 static constexpr int LICENSE_COLUMN_WIDTH = 80;
51 static constexpr int LOGO_FINAL_WIDTH = 114;
52 static constexpr int LOGO_FINAL_HEIGHT = 128;
53
54 void OnHello(wxCommandEvent& event);
55 void OnExit(wxCommandEvent& event);
56 void OnAbout(wxCommandEvent& event);
58
59 const App& app_;
60
61 // These will be deleted automatically at the end, using unique_ptr
62 // would cause segmentation fault due to double deletion
63 // https://docs.wxwidgets.org/trunk/overview_windowdeletion.html
64 wxMenu* menuFile_;
65 wxMenu* menuHelp_;
66 wxMenuBar* menuBar_;
67
68 wxIcon logoIco_;
69};
70
71} // namespace cpp_proj
72
73#endif // CPP_PROJ_MAINFRAME
This class is the entry point for this wxWidgets app.
Definition App.hpp:36
static constexpr int LOGO_FINAL_WIDTH
Definition MainFrame.hpp:51
MainFrame(const MainFrame &)=delete
MainFrame(MainFrame &&)=delete
wxMenu * menuFile_
Definition MainFrame.hpp:64
const App & app_
Definition MainFrame.hpp:59
wxIcon logoIco_
Definition MainFrame.hpp:68
~MainFrame() override=default
static constexpr int LICENSE_COLUMN_WIDTH
Definition MainFrame.hpp:50
wxMenuBar * menuBar_
Definition MainFrame.hpp:66
MainFrame & operator=(MainFrame &&)=delete
wxMenu * menuHelp_
Definition MainFrame.hpp:65
void OnHello(wxCommandEvent &event)
Definition MainFrame.cpp:116
void OnAbout(wxCommandEvent &event)
Definition MainFrame.cpp:58
MainFrame(const App &app, const wxString &title, const wxPoint &pos, const wxSize &size)
Construct a new Main Frame object.
Definition MainFrame.cpp:20
MainFrame & operator=(const MainFrame &)=delete
static constexpr int LOGO_FINAL_HEIGHT
Definition MainFrame.hpp:52
void OnExit(wxCommandEvent &event)
Definition MainFrame.cpp:56
Namespace for this application.
Definition UserOpt.cpp:12