diff options
Diffstat (limited to 'tools/mapedit/src/main.cpp')
| -rw-r--r-- | tools/mapedit/src/main.cpp | 36 |
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 | ||
| 9 | class MapeditApp : public wxApp { | 10 | class MapeditApp : public wxApp { |
| 10 | public: | 11 | public: |
| 11 | virtual bool OnInit(); | 12 | virtual bool OnInit(); |
| 12 | }; | 13 | }; |
| 13 | 14 | ||
| 14 | class 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 | |||
| 27 | wxBEGIN_EVENT_TABLE(MapeditFrame, wxFrame) | ||
| 28 | EVT_MENU(wxID_EXIT, MapeditFrame::OnExit) | ||
| 29 | wxEND_EVENT_TABLE() | ||
| 30 | |||
| 31 | wxIMPLEMENT_APP(MapeditApp); | 15 | wxIMPLEMENT_APP(MapeditApp); |
| 32 | 16 | ||
| 33 | bool MapeditApp::OnInit() | 17 | bool 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 | |||
| 40 | MapeditFrame::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 | |||
| 51 | void MapeditFrame::OnExit(wxCommandEvent& event) | ||
| 52 | { | ||
| 53 | Close(true); | ||
| 54 | } | ||
