summary refs log tree commit diff stats
path: root/tools/mapedit/src/widget.h
diff options
context:
space:
mode:
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