From 3e989517ec46c40a82671620577c40765c94a41f Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 15 Mar 2015 11:19:20 -0400 Subject: Added basic ability to set tiles in map editor --- tools/mapedit/src/frame.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tools/mapedit/src/frame.cpp (limited to 'tools/mapedit/src/frame.cpp') diff --git a/tools/mapedit/src/frame.cpp b/tools/mapedit/src/frame.cpp new file mode 100644 index 0000000..858620e --- /dev/null +++ b/tools/mapedit/src/frame.cpp @@ -0,0 +1,30 @@ +#include "frame.h" +#include "widget.h" +#include "tile_widget.h" + +wxBEGIN_EVENT_TABLE(MapeditFrame, wxFrame) + EVT_MENU(wxID_EXIT, MapeditFrame::OnExit) +wxEND_EVENT_TABLE() + +MapeditFrame::MapeditFrame(Map map) : wxFrame(NULL, wxID_ANY, "Map Editor", wxPoint(50, 50), wxSize(GAME_WIDTH*3, GAME_HEIGHT*2)), map(map) +{ + wxMenu* menuFile = new wxMenu; + menuFile->Append(wxID_EXIT); + + wxMenuBar* menuBar = new wxMenuBar; + menuBar->Append(menuFile, "&File"); + + SetMenuBar(menuBar); + + wxPanel* panel = new wxPanel(this, wxID_ANY); + int clientWidth, clientHeight; + GetClientSize(&clientWidth, &clientHeight); + + TileWidget* tileEdit = new TileWidget(panel, wxID_ANY, 6, wxPoint(0,0), wxSize(TILE_WIDTH*3*6, clientHeight)); + MapeditWidget* wid = new MapeditWidget(panel, wxID_ANY, &this->map, tileEdit, wxPoint(TILE_WIDTH*3*6+8,0), wxSize(GAME_WIDTH*1.5, GAME_HEIGHT*1.5)); +} + +void MapeditFrame::OnExit(wxCommandEvent& event) +{ + Close(true); +} -- cgit 1.4.1