From b563953a4846bab720cae17ef4ab5a8296730c7c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 14 Mar 2015 21:02:01 -0400 Subject: Started writing map editor --- tools/mapedit/src/main.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tools/mapedit/src/main.cpp (limited to 'tools/mapedit/src/main.cpp') 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 @@ +#include + +#ifndef WX_PRECOMP +#include +#endif + +#include "map.h" + +class MapeditApp : public wxApp { + public: + virtual bool OnInit(); +}; + +class MapeditFrame : public wxFrame { + public: + MapeditFrame() : MapeditFrame(Map()) {} + MapeditFrame(Map map); + + private: + void OnExit(wxCommandEvent& event); + + Map map; + + wxDECLARE_EVENT_TABLE(); +}; + +wxBEGIN_EVENT_TABLE(MapeditFrame, wxFrame) + EVT_MENU(wxID_EXIT, MapeditFrame::OnExit) +wxEND_EVENT_TABLE() + +wxIMPLEMENT_APP(MapeditApp); + +bool MapeditApp::OnInit() +{ + MapeditFrame* frame = new MapeditFrame(); + frame->Show(true); + return true; +} + +MapeditFrame::MapeditFrame(Map map) : wxFrame(NULL, wxID_ANY, "Map Editor", wxPoint(50, 50), wxSize(450, 340)), map(map) +{ + wxMenu* menuFile = new wxMenu; + menuFile->Append(wxID_EXIT); + + wxMenuBar* menuBar = new wxMenuBar; + menuBar->Append(menuFile, "&File"); + + SetMenuBar(menuBar); +} + +void MapeditFrame::OnExit(wxCommandEvent& event) +{ + Close(true); +} -- cgit 1.4.1