diff options
Diffstat (limited to 'src/area_popup.h')
-rw-r--r-- | src/area_popup.h | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/area_popup.h b/src/area_popup.h index 00c644d..f8a2355 100644 --- a/src/area_popup.h +++ b/src/area_popup.h | |||
@@ -7,19 +7,53 @@ | |||
7 | #include <wx/wx.h> | 7 | #include <wx/wx.h> |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | #include <vector> | ||
11 | |||
10 | class AreaPopup : public wxScrolledCanvas { | 12 | class AreaPopup : public wxScrolledCanvas { |
11 | public: | 13 | public: |
12 | AreaPopup(wxWindow* parent, int area_id); | 14 | AreaPopup(wxWindow* parent, int area_id); |
13 | 15 | ||
16 | void ResetIndicators(); | ||
14 | void UpdateIndicators(); | 17 | void UpdateIndicators(); |
15 | 18 | ||
19 | int GetFullWidth() const { return full_width_; } | ||
20 | int GetFullHeight() const { return full_height_; } | ||
21 | |||
16 | private: | 22 | private: |
23 | enum IndicatorType { | ||
24 | kLOCATION, | ||
25 | kPAINTING, | ||
26 | }; | ||
27 | |||
28 | struct IndicatorInfo { | ||
29 | // For locations, the id is an index into the map area's locations list. | ||
30 | // For paintings, it is a real painting id. | ||
31 | int id; | ||
32 | IndicatorType type; | ||
33 | int y; | ||
34 | |||
35 | IndicatorInfo(int id, IndicatorType type, int y) | ||
36 | : id(id), type(type), y(y) {} | ||
37 | }; | ||
38 | |||
17 | void OnPaint(wxPaintEvent& event); | 39 | void OnPaint(wxPaintEvent& event); |
40 | void OnDPIChanged(wxDPIChangedEvent& event); | ||
41 | |||
42 | void LoadIcons(); | ||
18 | 43 | ||
19 | int area_id_; | 44 | int area_id_; |
20 | 45 | ||
21 | wxBitmap unchecked_eye_; | 46 | const wxBitmap* unchecked_eye_; |
22 | wxBitmap checked_eye_; | 47 | const wxBitmap* checked_eye_; |
48 | const wxBitmap* unchecked_owl_; | ||
49 | const wxBitmap* checked_owl_; | ||
50 | |||
51 | int full_width_ = 0; | ||
52 | int full_height_ = 0; | ||
53 | wxSize header_extent_; | ||
54 | |||
55 | std::vector<IndicatorInfo> indicators_; | ||
56 | |||
23 | wxBitmap rendered_; | 57 | wxBitmap rendered_; |
24 | }; | 58 | }; |
25 | 59 | ||