-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
55 lines (41 loc) · 1.23 KB
/
main.cpp
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
#include <wx/wx.h>
#include <wx/app.h>
#include <wx/event.h>
#include <wx/image.h>
#include <wx/iconbndl.h>
#include "MainFrame.h"
#include "Config.h"
extern ConfigInfo config;
MainFrame *main_frame_global;
// Define the MainApp
class MainApp : public wxApp
{
public:
MainApp() {}
virtual ~MainApp() {}
virtual bool OnInit()
{
if (!config.parseCommandLine(argc, argv))
return false;
// Add the common image handlers
wxImage::AddHandler( new wxPNGHandler );
wxImage::AddHandler( new wxJPEGHandler );
MainFrame *mainFrame = new MainFrame(NULL);
main_frame_global = mainFrame;
SetTopWindow(mainFrame);
// Set up the icons
wxIconBundle icons;
icons.AddIcon(wxIcon("icons/mesh_stat_icon_16.png"));
icons.AddIcon(wxIcon("icons/mesh_stat_icon_32.png"));
icons.AddIcon(wxIcon("icons/mesh_stat_icon_48.png"));
icons.AddIcon(wxIcon("icons/mesh_stat_icon_64.png"));
icons.AddIcon(wxIcon("icons/mesh_stat_icon_128.png"));
mainFrame->SetIcons(icons);
GetTopWindow()->Show();
mainFrame->refresh();
mainFrame->probeAllNodes();
return true;
}
};
DECLARE_APP(MainApp)
IMPLEMENT_APP(MainApp)