summary refs log tree commit diff stats
path: root/tools/mapedit/src/widget.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-03-15 11:19:20 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-03-15 11:19:20 -0400
commit3e989517ec46c40a82671620577c40765c94a41f (patch)
treeb7732fafbae6cca98290f91d869504d41c536539 /tools/mapedit/src/widget.h
parentb563953a4846bab720cae17ef4ab5a8296730c7c (diff)
downloadtherapy-3e989517ec46c40a82671620577c40765c94a41f.tar.gz
therapy-3e989517ec46c40a82671620577c40765c94a41f.tar.bz2
therapy-3e989517ec46c40a82671620577c40765c94a41f.zip
Added basic ability to set tiles in map editor
Diffstat (limited to 'tools/mapedit/src/widget.h')
-rw-r--r--tools/mapedit/src/widget.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/mapedit/src/widget.h b/tools/mapedit/src/widget.h new file mode 100644 index 0000000..f2bfbbe --- /dev/null +++ b/tools/mapedit/src/widget.h
@@ -0,0 +1,38 @@
1#ifndef WIDGET_H
2#define WIDGET_H
3
4#include <wx/wxprec.h>
5
6#ifndef WX_PRECOMP
7#include <wx/wx.h>
8#endif
9
10#include "map.h"
11#include "tile_widget.h"
12
13class MapeditWidget : public wxControl {
14 public:
15 MapeditWidget();
16 MapeditWidget(wxWindow* parent, wxWindowID winid, Map* map, TileWidget* tileWidget, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
17
18 protected:
19 void Init();
20 virtual wxSize DoGetBestSize() const;
21 void OnPaint(wxPaintEvent& event);
22 void OnClick(wxMouseEvent& event);
23 void OnMouseMove(wxMouseEvent& event);
24 void OnMouseUp(wxMouseEvent& event);
25
26 private:
27 void SetTile(wxPoint pos);
28
29 Map* const map = nullptr;
30 wxBitmap tiles;
31 TileWidget* tileWidget;
32 bool mouseIsDown = false;
33
34 DECLARE_DYNAMIC_CLASS(MapeditWidget);
35 DECLARE_EVENT_TABLE();
36};
37
38#endif