summary refs log tree commit diff stats
path: root/tools/mapedit/src/frame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mapedit/src/frame.cpp')
-rw-r--r--tools/mapedit/src/frame.cpp30
1 files changed, 30 insertions, 0 deletions
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 @@
1#include "frame.h"
2#include "widget.h"
3#include "tile_widget.h"
4
5wxBEGIN_EVENT_TABLE(MapeditFrame, wxFrame)
6 EVT_MENU(wxID_EXIT, MapeditFrame::OnExit)
7wxEND_EVENT_TABLE()
8
9MapeditFrame::MapeditFrame(Map map) : wxFrame(NULL, wxID_ANY, "Map Editor", wxPoint(50, 50), wxSize(GAME_WIDTH*3, GAME_HEIGHT*2)), map(map)
10{
11 wxMenu* menuFile = new wxMenu;
12 menuFile->Append(wxID_EXIT);
13
14 wxMenuBar* menuBar = new wxMenuBar;
15 menuBar->Append(menuFile, "&File");
16
17 SetMenuBar(menuBar);
18
19 wxPanel* panel = new wxPanel(this, wxID_ANY);
20 int clientWidth, clientHeight;
21 GetClientSize(&clientWidth, &clientHeight);
22
23 TileWidget* tileEdit = new TileWidget(panel, wxID_ANY, 6, wxPoint(0,0), wxSize(TILE_WIDTH*3*6, clientHeight));
24 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));
25}
26
27void MapeditFrame::OnExit(wxCommandEvent& event)
28{
29 Close(true);
30}