diff --git a/source/gwork/include/Gwork/Events.h b/source/gwork/include/Gwork/Events.h index 97d49c30..de274cad 100644 --- a/source/gwork/include/Gwork/Events.h +++ b/source/gwork/include/Gwork/Events.h @@ -107,6 +107,7 @@ namespace Gwk public: typedef void (Handler::*EventListener)(Event::Info info); + typedef std::function EventCallback; Listener(); ~Listener(); @@ -126,7 +127,8 @@ namespace Gwk private: - void AddInternal(Event::Handler* listener, EventListener function, + void AddInternal(Event::Handler* listener, + EventListener function, const Event::Packet& packet); void CleanLinks(); @@ -138,7 +140,6 @@ namespace Gwk , listener(nullptr) {} - typedef std::function EventCallback; EventCallback callback; Event::Handler* listener; Event::Packet Packet; diff --git a/source/test/source/factory/ReflectButton.cpp b/source/test/source/factory/ReflectButton.cpp index 9bead4ae..e569e422 100644 --- a/source/test/source/factory/ReflectButton.cpp +++ b/source/test/source/factory/ReflectButton.cpp @@ -60,7 +60,7 @@ GWK_CONTROL_CONSTRUCTOR(ReflectButton) ponder::UserObject buttonA = metaclass->construct(ponder::Args(static_cast(this))); assert(buttonA != ponder::UserObject::nothing); buttonA.set("text", "Hello world!"); - buttonA.get("onPress").call("add", this, &ReflectButton::onButtonA); +// buttonA.get("onPress").call("add", this, &ReflectButton::onButtonA); // { // Controls::Button* buttonA = new Controls::Button(this); diff --git a/source/util/include/Gwork/Util/ControlFactory.h b/source/util/include/Gwork/Util/ControlFactory.h index 1273995f..14c4acc8 100644 --- a/source/util/include/Gwork/Util/ControlFactory.h +++ b/source/util/include/Gwork/Util/ControlFactory.h @@ -17,6 +17,8 @@ PONDER_TYPE(Gwk::Margin) PONDER_TYPE(Gwk::Point) PONDER_TYPE(Gwk::Position) +PONDER_TYPE(Gwk::Event::Listener); + PONDER_TYPE(Gwk::Controls::Base) PONDER_TYPE(Gwk::Controls::Label) PONDER_TYPE(Gwk::Controls::LabelClickable) diff --git a/source/util/source/ControlFactory/ControlFactory.cpp b/source/util/source/ControlFactory/ControlFactory.cpp index 8742dd12..5b928169 100644 --- a/source/util/source/ControlFactory/ControlFactory.cpp +++ b/source/util/source/ControlFactory/ControlFactory.cpp @@ -40,8 +40,8 @@ void InitialiseControls() .value("fill", Gwk::Position::Fill) ; - ponder::Class::declare() - .function("add", [] (Event::Handler&, Controls::Base*)) + ponder::Class::declare() +// .function("add", [] (Event::Handler&, Controls::Base*)) ; ponder::Class::declare()