cpp-project-template 0.0.1.0
C++ Project Template
Loading...
Searching...
No Matches
App.hpp
Go to the documentation of this file.
1
10
11#ifndef CPP_PROJ_APP
12#define CPP_PROJ_APP
13
14// #undef __GXX_ABI_VERSION
15// #define __GXX_ABI_VERSION 1013 //XXX Better way to do this?
16
17// For compilers that support precompilation, includes "wx/wx.h".
18#include <wx/wxprec.h>
19
20#ifndef WX_PRECOMP
21 #include <wx/wx.h>
22#endif
23
24#include "MainFrame.hpp"
25
29namespace cpp_proj
30{
31
35class App : public wxApp
36{
37public:
45 bool OnInit() override;
46
47 App();
48 ~App() override = default;
49 App(const App&) = delete;
50 App& operator=(const App&) = delete;
51 App(App&&) = delete;
52 App& operator=(App&&) = delete;
53
59 const wxImage& getLogoImg() const { return logoImg_; }
60
61private:
62 static constexpr int WINDOW_POS_X = 50;
63 static constexpr int WINDOW_POS_Y = 50;
64 static constexpr int WINDOW_WIDTH = 1200;
65 static constexpr int WINDOW_HEIGHT = 800;
66
67 static constexpr int SPLASHSCREEN_DURATION_MS = 3000;
68
69 const wxString logoPathRel_ = "../images/logo.png";
70
71 wxString appPath_;
72 wxImage logoImg_;
73
74 // These will be deleted automatically at the end, using unique_ptr
75 // would cause segmentation fault due to doyble deletion
76 // https://docs.wxwidgets.org/trunk/overview_windowdeletion.html
78};
79
80} // namespace cpp_proj
81
82#endif // CPP_PROJ_APP
This class represents the main window.
~App() override=default
static constexpr int SPLASHSCREEN_DURATION_MS
Definition App.hpp:67
bool OnInit() override
The wxWidgets equivalent of a main procedure.
Definition App.cpp:20
App & operator=(const App &)=delete
static constexpr int WINDOW_POS_Y
Definition App.hpp:63
App(App &&)=delete
wxImage logoImg_
Definition App.hpp:72
static constexpr int WINDOW_POS_X
Definition App.hpp:62
static constexpr int WINDOW_HEIGHT
Definition App.hpp:65
App()
Definition App.cpp:13
static constexpr int WINDOW_WIDTH
Definition App.hpp:64
const wxString logoPathRel_
Definition App.hpp:69
App(const App &)=delete
App & operator=(App &&)=delete
const wxImage & getLogoImg() const
Get the Logo Img object.
Definition App.hpp:59
wxString appPath_
Definition App.hpp:71
MainFrame * frame_
Definition App.hpp:77
This class represents the main window.
Definition MainFrame.hpp:30
Namespace for this application.
Definition UserOpt.cpp:12