-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (42 loc) · 1.11 KB
/
Copy pathmain.cpp
File metadata and controls
48 lines (42 loc) · 1.11 KB
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
#include <wx/wx.h>
#include "NE_Debug.hpp"
#include "MainWindow.hpp"
#ifdef DEBUG
#pragma comment(lib, "NodeEngineDebug.lib")
#pragma comment(lib, "NodeUIEngineDebug.lib")
#pragma comment(lib, "BuiltInNodesDebug.lib")
#pragma comment(lib, "WindowsAppSupportDebug.lib")
#pragma comment(lib, "wxWidgetsAppSupportDebug.lib")
#else
#pragma comment(lib, "NodeEngine.lib")
#pragma comment(lib, "NodeUIEngine.lib")
#pragma comment(lib, "BuiltInNodes.lib")
#pragma comment(lib, "WindowsAppSupport.lib")
#pragma comment(lib, "wxWidgetsAppSupport.lib")
#endif
class Application : public wxApp
{
public:
Application ()
{
EnableLeakDetection ();
}
virtual bool OnInit ()
{
if (argc == 1 || argc == 2) {
wxInitAllImageHandlers ();
std::wstring defaultFileName;
if (argc == 2) {
defaultFileName = wxString (argv[1]).ToStdWstring ();
}
MainWindow* mainWindow = new MainWindow (defaultFileName);
mainWindow->Show (true);
return true;
}
// make sure to exit the app correctly
wxFrame* dummyFrame = new wxFrame (nullptr, wxID_ANY, L"");
dummyFrame->Destroy ();
return true;
}
};
IMPLEMENT_APP (Application)