diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-03 12:43:16 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-03 12:43:16 -0400 |
| commit | 02c331f4e766558bba580d5b7db883357be005d5 (patch) | |
| tree | 16e8fd4a48c1951e0dd7785295fcbe62b9669880 /area_window.h | |
| parent | 47e59ea969c775bea316b1a910c845a7c8482091 (diff) | |
| download | lingo-ap-tracker-02c331f4e766558bba580d5b7db883357be005d5.tar.gz lingo-ap-tracker-02c331f4e766558bba580d5b7db883357be005d5.tar.bz2 lingo-ap-tracker-02c331f4e766558bba580d5b7db883357be005d5.zip | |
Changes to make it work better on Windows
AreaWindows are now no longer separate controls but are instead just painted onto the TrackerPanel. This lets us avoid the complexity of z-ordering with sibling controls. We can also use the mouse motion event to display and hide the popups, which conveniently doesn't fire when the mouse is over a popup, so the popup won't hide until you mouse off of the window AND popup.
Diffstat (limited to 'area_window.h')
| -rw-r--r-- | area_window.h | 38 |
1 files changed, 0 insertions, 38 deletions
| diff --git a/area_window.h b/area_window.h deleted file mode 100644 index 3e7c001..0000000 --- a/area_window.h +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | #ifndef AREA_WINDOW_H_C2653ACF | ||
| 2 | #define AREA_WINDOW_H_C2653ACF | ||
| 3 | |||
| 4 | #include <wx/wxprec.h> | ||
| 5 | |||
| 6 | #ifndef WX_PRECOMP | ||
| 7 | #include <wx/wx.h> | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #include "area_popup.h" | ||
| 11 | |||
| 12 | class AreaWindow : public wxWindow { | ||
| 13 | public: | ||
| 14 | static constexpr int ACTUAL_SIZE = 64; | ||
| 15 | static constexpr int BORDER_SIZE = 5; | ||
| 16 | static constexpr int EFFECTIVE_SIZE = ACTUAL_SIZE + BORDER_SIZE * 2; | ||
| 17 | |||
| 18 | AreaWindow(wxWindow* parent, int area_id, AreaPopup* popup); | ||
| 19 | |||
| 20 | int GetAreaId() const { return area_id_; } | ||
| 21 | |||
| 22 | AreaPopup* GetPopup() { return popup_; } | ||
| 23 | |||
| 24 | void UpdateIndicators(); | ||
| 25 | |||
| 26 | private: | ||
| 27 | void OnPaint(wxPaintEvent& event); | ||
| 28 | void OnEnterWindow(wxMouseEvent& event); | ||
| 29 | void OnLeaveWindow(wxMouseEvent& event); | ||
| 30 | |||
| 31 | void Redraw(); | ||
| 32 | |||
| 33 | int area_id_; | ||
| 34 | wxBitmap rendered_; | ||
| 35 | AreaPopup* popup_; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #endif /* end of include guard: AREA_WINDOW_H_C2653ACF */ | ||
