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.cpp36
1 files changed, 3 insertions, 33 deletions
diff --git a/tools/mapedit/src/main.cpp b/tools/mapedit/src/main.cpp index 09be151..28fa010 100644 --- a/tools/mapedit/src/main.cpp +++ b/tools/mapedit/src/main.cpp
@@ -5,50 +5,20 @@
5#endif 5#endif
6 6
7#include "map.h" 7#include "map.h"
8#include "frame.h"
8 9
9class MapeditApp : public wxApp { 10class MapeditApp : public wxApp {
10 public: 11 public:
11 virtual bool OnInit(); 12 virtual bool OnInit();
12}; 13};
13 14
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); 15wxIMPLEMENT_APP(MapeditApp);
32 16
33bool MapeditApp::OnInit() 17bool MapeditApp::OnInit()
34{ 18{
19 wxInitAllImageHandlers();
20
35 MapeditFrame* frame = new MapeditFrame(); 21 MapeditFrame* frame = new MapeditFrame();
36 frame->Show(true); 22 frame->Show(true);
37 return true; 23 return true;
38} 24}
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}