diff --git a/include/guisan/widgets/inputbox.hpp b/include/guisan/widgets/inputbox.hpp index 0fb7c32..763b224 100644 --- a/include/guisan/widgets/inputbox.hpp +++ b/include/guisan/widgets/inputbox.hpp @@ -74,7 +74,7 @@ namespace gcn /** * A non-movable window to get a short string from the user. */ - class GCN_CORE_DECLSPEC InputBox : public Window + class GCN_CORE_DECLSPEC InputBox : public Window, public ActionListener { public: @@ -118,9 +118,9 @@ namespace gcn */ int getClickedButton() const; - // Inherited from MouseListener + // Inherited from ActionListener - void mouseReleased(MouseEvent& mouseEvent) override; + void action(const ActionEvent& actionEvent) override; protected: int mClickedButton = -1; diff --git a/include/guisan/widgets/messagebox.hpp b/include/guisan/widgets/messagebox.hpp index 26cff60..fc56937 100644 --- a/include/guisan/widgets/messagebox.hpp +++ b/include/guisan/widgets/messagebox.hpp @@ -57,6 +57,7 @@ #ifndef GCN_MESSAGEBOX_HPP #define GCN_MESSAGEBOX_HPP +#include "guisan/actionlistener.hpp" #include "guisan/platform.hpp" #include "guisan/widgets/button.hpp" #include "guisan/widgets/label.hpp" @@ -71,7 +72,7 @@ namespace gcn /** * A non-movable window to display a message with some buttons. */ - class GCN_CORE_DECLSPEC MessageBox : public Window + class GCN_CORE_DECLSPEC MessageBox : public Window, public ActionListener { public: /** @@ -142,9 +143,9 @@ namespace gcn */ void addToContainer(Container* container); - // Inherited from MouseListener + // Inherited from ActionListener - void mouseReleased(MouseEvent& mouseEvent) override; + void action(const ActionEvent& keyEvent) override; protected: Graphics::Alignment mButtonAlignment = Graphics::Alignment::Left; diff --git a/src/widgets/inputbox.cpp b/src/widgets/inputbox.cpp index 9470a8e..1ac9b96 100644 --- a/src/widgets/inputbox.cpp +++ b/src/widgets/inputbox.cpp @@ -74,7 +74,6 @@ namespace gcn const std::string& cancel) : Window(caption) { - addMouseListener(this); setMovable(false); mLabel = std::make_unique