diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-14 21:02:01 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-14 21:02:01 -0400 |
| commit | b563953a4846bab720cae17ef4ab5a8296730c7c (patch) | |
| tree | e585bda1e4a8b979c8864cd25a84f663122c83b7 /tools/mapedit/src/main.cpp | |
| parent | 6b1dcc5df51df4a2d8b724187eb1bcdb4fd9df8b (diff) | |
| download | therapy-b563953a4846bab720cae17ef4ab5a8296730c7c.tar.gz therapy-b563953a4846bab720cae17ef4ab5a8296730c7c.tar.bz2 therapy-b563953a4846bab720cae17ef4ab5a8296730c7c.zip | |
Started writing map editor
Diffstat (limited to 'tools/mapedit/src/main.cpp')
| -rw-r--r-- | tools/mapedit/src/main.cpp | 54 |
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 | |||
| 9 | class MapeditApp : public wxApp { | ||
| 10 | public: | ||
| 11 | virtual bool OnInit(); | ||
| 12 | }; | ||
| 13 | |||
| 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); | ||
| 32 | |||
| 33 | bool MapeditApp::OnInit() | ||
| 34 | { | ||
| 35 | MapeditFrame* frame = new MapeditFrame(); | ||
| 36 | frame->Show(true); | ||
| 37 | return true; | ||
| 38 | } | ||
| 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 | } | ||
