summary refs log tree commit diff stats
path: root/tools/mapedit/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mapedit/src/main.cpp')
-rw-r--r--tools/mapedit/src/main.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/tools/mapedit/src/main.cpp b/tools/mapedit/src/main.cpp new file mode 100644 index 0000000..09be151 --- /dev/null +++ b/tools/mapedit/src/main.cpp
@@ -0,0 +1,54 @@
1#include <wx/wxprec.h>
2
3#ifndef WX_PRECOMP
4#include <wx/wx.h>
5#endif
6
7#include "map.h"
8
9class MapeditApp : public wxApp {
10 public:
11 virtual bool OnInit();
12};
13
14class MapeditFrame : public wxFrame {
15 public:
16 MapeditFrame() : MapeditFrame(Map()) {}
17 MapeditFrame(Map map);
18
19 private:
20 void OnExit(wxCommandEvent& event);
21
22 Map map;
23
24 wxDECLARE_EVENT_TABLE();
25};
26
27wxBEGIN_EVENT_TABLE(MapeditFrame, wxFrame)
28 EVT_MENU(wxID_EXIT, MapeditFrame::OnExit)
29wxEND_EVENT_TABLE()
30
31wxIMPLEMENT_APP(MapeditApp);
32
33bool MapeditApp::OnInit()
34{
35 MapeditFrame* frame = new MapeditFrame();
36 frame->Show(true);
37 return true;
38}
39
40MapeditFrame::MapeditFrame(Map map) : wxFrame(NULL, wxID_ANY, "Map Editor", wxPoint(50, 50), wxSize(450, 340)), map(map)
41{
42 wxMenu* menuFile = new wxMenu;
43 menuFile->Append(wxID_EXIT);
44
45 wxMenuBar* menuBar = new wxMenuBar;
46 menuBar->Append(menuFile, "&File");
47
48 SetMenuBar(menuBar);
49}
50
51void MapeditFrame::OnExit(wxCommandEvent& event)
52{
53 Close(true);
54}