From 2ab44546bd5064d7007a95b106de658d01adeb82 Mon Sep 17 00:00:00 2001 From: Filip Sykala Date: Wed, 8 Dec 2021 16:30:32 +0100 Subject: [PATCH] Add virtual function to process mouse_event --- src/slic3r/GUI/Gizmos/GLGizmoBase.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp b/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp index 66ca4fca27..074baa54e8 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoBase.hpp @@ -113,7 +113,7 @@ public: GLGizmoBase(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id); - virtual ~GLGizmoBase() {} + virtual ~GLGizmoBase() = default; bool init() { return on_init(); } @@ -167,6 +167,13 @@ public: virtual std::string get_tooltip() const { return ""; } + /// + /// Implement when want to process mouse events in gizmo + /// Click, Right click, move, drag, ... + /// + /// Keep information about mouse click + /// Return True when use the information and don't want to propagate it otherwise False. + virtual bool on_mouse(const wxMouseEvent &mouse_event) { return false; } protected: virtual bool on_init() = 0; virtual void on_load(cereal::BinaryInputArchive& ar) {}