Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2018-10-03 15:07:10 +0300
committerVojtech Kral <vojtech@kral.hk>2018-10-03 15:07:10 +0300
commit83f55b608c49993ee3279f5b598748a36b04d979 (patch)
tree96b24a1bbe1bf44b4241135085601ee7f0ed58ab /src/slic3r/GUI/Event.hpp
parent770d944283cda7c90ea7aa614be824aaa3de3519 (diff)
Event.hpp: Set event object
Diffstat (limited to 'src/slic3r/GUI/Event.hpp')
-rw-r--r--src/slic3r/GUI/Event.hpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/slic3r/GUI/Event.hpp b/src/slic3r/GUI/Event.hpp
index ffcad7f9f..63800fa00 100644
--- a/src/slic3r/GUI/Event.hpp
+++ b/src/slic3r/GUI/Event.hpp
@@ -1,6 +1,7 @@
#ifndef slic3r_Events_hpp_
#define slic3r_Events_hpp_
+
#include <wx/event.h>
@@ -11,11 +12,14 @@ namespace GUI {
struct SimpleEvent : public wxEvent
{
- SimpleEvent(wxEventType type, int id = 0) : wxEvent(id, type) {}
+ SimpleEvent(wxEventType type, wxObject* origin = nullptr) : wxEvent(0, type)
+ {
+ SetEventObject(origin);
+ }
virtual wxEvent* Clone() const
{
- return new SimpleEvent(GetEventType(), GetId());
+ return new SimpleEvent(GetEventType(), GetEventObject());
}
};
@@ -23,26 +27,30 @@ template<class T, size_t N> struct ArrayEvent : public wxEvent
{
std::array<T, N> data;
- ArrayEvent(wxEventType type, std::array<T, N> data, int id = 0)
- : wxEvent(id, type), data(std::move(data))
- {}
+ ArrayEvent(wxEventType type, std::array<T, N> data, wxObject* origin = nullptr)
+ : wxEvent(0, type), data(std::move(data))
+ {
+ SetEventObject(origin);
+ }
virtual wxEvent* Clone() const
{
- return new ArrayEvent<T, N>(GetEventType(), data, GetId());
+ return new ArrayEvent<T, N>(GetEventType(), data, GetEventObject());
}
};
template<class T> struct ArrayEvent<T, 1> : public wxEvent
{
T data;
- ArrayEvent(wxEventType type, T data, int id = 0)
- : wxEvent(id, type), data(std::move(data))
- {}
+ ArrayEvent(wxEventType type, T data, wxObject* origin = nullptr)
+ : wxEvent(0, type), data(std::move(data))
+ {
+ SetEventObject(origin);
+ }
virtual wxEvent* Clone() const
{
- return new ArrayEvent<T, 1>(GetEventType(), data, GetId());
+ return new ArrayEvent<T, 1>(GetEventType(), data, GetEventObject());
}
};