diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-15 15:50:04 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-15 15:50:04 -0400 |
commit | 8702c11db08f78b6c91ef950ce280f2289b1a6e6 (patch) | |
tree | ed0f093974c07cfd0a7b1d7fd24573662c05d5f3 /tools/mapedit/src/widget.h | |
parent | 3e989517ec46c40a82671620577c40765c94a41f (diff) | |
download | therapy-8702c11db08f78b6c91ef950ce280f2289b1a6e6.tar.gz therapy-8702c11db08f78b6c91ef950ce280f2289b1a6e6.tar.bz2 therapy-8702c11db08f78b6c91ef950ce280f2289b1a6e6.zip |
Added scrolling and zooming to map editor
Diffstat (limited to 'tools/mapedit/src/widget.h')
-rw-r--r-- | tools/mapedit/src/widget.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/mapedit/src/widget.h b/tools/mapedit/src/widget.h index f2bfbbe..f66b0b2 100644 --- a/tools/mapedit/src/widget.h +++ b/tools/mapedit/src/widget.h | |||
@@ -10,11 +10,14 @@ | |||
10 | #include "map.h" | 10 | #include "map.h" |
11 | #include "tile_widget.h" | 11 | #include "tile_widget.h" |
12 | 12 | ||
13 | class MapeditWidget : public wxControl { | 13 | class MapeditWidget : public wxScrolledWindow { |
14 | public: | 14 | public: |
15 | MapeditWidget(); | 15 | MapeditWidget(); |
16 | MapeditWidget(wxWindow* parent, wxWindowID winid, Map* map, TileWidget* tileWidget, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); | 16 | MapeditWidget(wxWindow* parent, wxWindowID winid, Map* map, TileWidget* tileWidget, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); |
17 | 17 | ||
18 | void ZoomIn(); | ||
19 | void ZoomOut(); | ||
20 | |||
18 | protected: | 21 | protected: |
19 | void Init(); | 22 | void Init(); |
20 | virtual wxSize DoGetBestSize() const; | 23 | virtual wxSize DoGetBestSize() const; |
@@ -25,11 +28,13 @@ class MapeditWidget : public wxControl { | |||
25 | 28 | ||
26 | private: | 29 | private: |
27 | void SetTile(wxPoint pos); | 30 | void SetTile(wxPoint pos); |
31 | void SetZoomSize(int zoom); | ||
28 | 32 | ||
29 | Map* const map = nullptr; | 33 | Map* const map = nullptr; |
30 | wxBitmap tiles; | 34 | wxBitmap tiles; |
31 | TileWidget* tileWidget; | 35 | TileWidget* tileWidget; |
32 | bool mouseIsDown = false; | 36 | bool mouseIsDown = false; |
37 | int scale; | ||
33 | 38 | ||
34 | DECLARE_DYNAMIC_CLASS(MapeditWidget); | 39 | DECLARE_DYNAMIC_CLASS(MapeditWidget); |
35 | DECLARE_EVENT_TABLE(); | 40 | DECLARE_EVENT_TABLE(); |