@@ -47,14 +47,82 @@ static PyObject *py_ue_swidget_bind_on_mouse_button_down(ue_PySWidget *self, PyO
4747 UPythonSlateDelegate *py_delegate = NewObject<UPythonSlateDelegate>();
4848 py_delegate->SetPyCallable (py_callable);
4949 py_delegate->AddToRoot ();
50- handler.BindUObject (py_delegate, &UPythonSlateDelegate::OnMouseButtonDown );
50+ handler.BindUObject (py_delegate, &UPythonSlateDelegate::OnMouseEvent );
5151
5252 self->s_widget ->SetOnMouseButtonDown (handler);
5353
5454 Py_INCREF (self);
5555 return (PyObject *)self;
5656}
5757
58+ static PyObject *py_ue_swidget_bind_on_mouse_button_up (ue_PySWidget *self, PyObject * args) {
59+ PyObject *py_callable;
60+ if (!PyArg_ParseTuple (args, " O:bind_on_mouse_button_up" , &py_callable)) {
61+ return NULL ;
62+ }
63+
64+ if (!PyCallable_Check (py_callable)) {
65+ return PyErr_Format (PyExc_Exception, " argument is not callable" );
66+ }
67+
68+ FPointerEventHandler handler;
69+ UPythonSlateDelegate *py_delegate = NewObject<UPythonSlateDelegate>();
70+ py_delegate->SetPyCallable (py_callable);
71+ py_delegate->AddToRoot ();
72+ handler.BindUObject (py_delegate, &UPythonSlateDelegate::OnMouseEvent);
73+
74+ self->s_widget ->SetOnMouseButtonUp (handler);
75+
76+ Py_INCREF (self);
77+ return (PyObject *)self;
78+ }
79+
80+ static PyObject *py_ue_swidget_bind_on_mouse_double_click (ue_PySWidget *self, PyObject * args) {
81+ PyObject *py_callable;
82+ if (!PyArg_ParseTuple (args, " O:bind_on_mouse_double_click" , &py_callable)) {
83+ return NULL ;
84+ }
85+
86+ if (!PyCallable_Check (py_callable)) {
87+ return PyErr_Format (PyExc_Exception, " argument is not callable" );
88+ }
89+
90+ FPointerEventHandler handler;
91+ UPythonSlateDelegate *py_delegate = NewObject<UPythonSlateDelegate>();
92+ py_delegate->SetPyCallable (py_callable);
93+ py_delegate->AddToRoot ();
94+ handler.BindUObject (py_delegate, &UPythonSlateDelegate::OnMouseEvent);
95+
96+ self->s_widget ->SetOnMouseDoubleClick (handler);
97+
98+ Py_INCREF (self);
99+ return (PyObject *)self;
100+ }
101+
102+ static PyObject *py_ue_swidget_bind_on_mouse_move (ue_PySWidget *self, PyObject * args) {
103+ PyObject *py_callable;
104+ if (!PyArg_ParseTuple (args, " O:bind_on_mouse_move" , &py_callable)) {
105+ return NULL ;
106+ }
107+
108+ if (!PyCallable_Check (py_callable)) {
109+ return PyErr_Format (PyExc_Exception, " argument is not callable" );
110+ }
111+
112+ FPointerEventHandler handler;
113+ UPythonSlateDelegate *py_delegate = NewObject<UPythonSlateDelegate>();
114+ py_delegate->SetPyCallable (py_callable);
115+ py_delegate->AddToRoot ();
116+ handler.BindUObject (py_delegate, &UPythonSlateDelegate::OnMouseEvent);
117+
118+ self->s_widget ->SetOnMouseMove (handler);
119+
120+ Py_INCREF (self);
121+ return (PyObject *)self;
122+ }
123+
124+
125+
58126static PyObject *py_ue_swidget_has_keyboard_focus (ue_PySWidget *self, PyObject * args) {
59127
60128 if (self->s_widget ->HasKeyboardFocus ()) {
@@ -78,6 +146,9 @@ static PyMethodDef ue_PySWidget_methods[] = {
78146 { " set_tooltip_text" , (PyCFunction)py_ue_swidget_set_tooltip_text, METH_VARARGS, " " },
79147 { " has_keyboard_focus" , (PyCFunction)py_ue_swidget_has_keyboard_focus, METH_VARARGS, " " },
80148 { " bind_on_mouse_button_down" , (PyCFunction)py_ue_swidget_bind_on_mouse_button_down, METH_VARARGS, " " },
149+ { " bind_on_mouse_button_up" , (PyCFunction)py_ue_swidget_bind_on_mouse_button_down, METH_VARARGS, " " },
150+ { " bind_on_mouse_double_click" , (PyCFunction)py_ue_swidget_bind_on_mouse_double_click, METH_VARARGS, " " },
151+ { " bind_on_mouse_move" , (PyCFunction)py_ue_swidget_bind_on_mouse_move, METH_VARARGS, " " },
81152 { NULL } /* Sentinel */
82153};
83154
0 commit comments