| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 23467ec commit 0f2979d
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | 7 | #define sw_python_multicolumn_table_row StaticCastSharedRef<SPythonMultiColumnTableRow>(self->s_compound_widget.s_widget.s_widget) | |
| 8 | 8 | ||
| 9 | - static PyMethodDef ue_PySPythonListView_methods[] = { | ||
| 9 | + static PyMethodDef ue_PySPythonMultiColumnTableRow_methods[] = { | ||
| 10 | 10 | { NULL } /* Sentinel */ | |
| 11 | 11 | }; | |
| 12 | 12 | ||
@@ -38,7 +38,7 @@ PyTypeObject ue_PySPythonMultiColumnTableRowType = { | |||
| 38 | 38 | 0, /* tp_weaklistoffset */ | |
| 39 | 39 | 0, /* tp_iter */ | |
| 40 | 40 | 0, /* tp_iternext */ | |
| 41 | - ue_PySPythonListView_methods, /* tp_methods */ | ||
| 41 | + ue_PySPythonMultiColumnTableRow_methods, /* tp_methods */ | ||
| 42 | 42 | }; | |
| 43 | 43 | ||
| 44 | 44 | static int ue_py_spython_multicolumn_table_row_init(ue_PySPythonMultiColumnTableRow *self, PyObject *args, PyObject *kwargs) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -108,6 +108,27 @@ static PyObject *py_ue_swindow_add_modal(ue_PySWindow *self, PyObject * args) | |||
| 108 | 108 | } | |
| 109 | 109 | #endif | |
| 110 | 110 | ||
| 111 | + static PyObject *py_ue_swindow_add_child(ue_PySWindow *self, PyObject * args) | ||
| 112 | + { | ||
| 113 | + PyObject *py_obj; | ||
| 114 | + if (!PyArg_ParseTuple(args, "O:add_child", &py_obj)) | ||
| 115 | + { | ||
| 116 | + return NULL; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + ue_PySWindow *py_swindow_child = py_ue_is_swindow(py_obj); | ||
| 120 | + if (!py_swindow_child) | ||
| 121 | + { | ||
| 122 | + return PyErr_Format(PyExc_Exception, "argument is not a SWindow"); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + FSlateApplication::Get().AddWindowAsNativeChild( | ||
| 126 | + StaticCastSharedRef<SWindow>(py_swindow_child->s_compound_widget.s_widget.s_widget), | ||
| 127 | + sw_window); | ||
| 128 | + | ||
| 129 | + Py_RETURN_NONE; | ||
| 130 | + } | ||
| 131 | + | ||
| 111 | 132 | static PyMethodDef ue_PySWindow_methods[] = { | |
| 112 | 133 | { "set_title", (PyCFunction)py_ue_swindow_set_title, METH_VARARGS, "" }, | |
| 113 | 134 | { "set_sizing_rule", (PyCFunction)py_ue_swindow_set_sizing_rule, METH_VARARGS, "" }, | |
@@ -119,6 +140,7 @@ static PyMethodDef ue_PySWindow_methods[] = { | |||
| 119 | 140 | #if WITH_EDITOR | |
| 120 | 141 | { "add_modal", (PyCFunction)py_ue_swindow_add_modal, METH_VARARGS, "" }, | |
| 121 | 142 | #endif | |
| 143 | + { "add_child", (PyCFunction)py_ue_swindow_add_child, METH_VARARGS, "" }, | ||
| 122 | 144 | { NULL } /* Sentinel */ | |
| 123 | 145 | }; | |
| 124 | 146 | ||
@@ -222,7 +244,12 @@ static int ue_py_swindow_init(ue_PySWindow *self, PyObject *args, PyObject *kwar | |||
| 222 | 244 | sw_window->SetOnWindowClosed(handler); | |
| 223 | 245 | } | |
| 224 | 246 | ||
| 225 | - FSlateApplication::Get().AddWindow(StaticCastSharedRef<SWindow>(sw_window->AsShared()), true); | ||
| 247 | + // is it a child ? | ||
| 248 | + PyObject *is_child = ue_py_dict_get_item(kwargs, "child"); | ||
| 249 | + if (!(is_child && PyObject_IsTrue(is_child))) | ||
| 250 | + { | ||
| 251 | + FSlateApplication::Get().AddWindow(StaticCastSharedRef<SWindow>(sw_window->AsShared()), true); | ||
| 252 | + } | ||
| 226 | 253 | ||
| 227 | 254 | return 0; | |
| 228 | 255 | } | |
@@ -241,3 +268,10 @@ void ue_python_init_swindow(PyObject *ue_module) | |||
| 241 | 268 | Py_INCREF(&ue_PySWindowType); | |
| 242 | 269 | PyModule_AddObject(ue_module, "SWindow", (PyObject *)&ue_PySWindowType); | |
| 243 | 270 | } | |
| 271 | + | ||
| 272 | + ue_PySWindow *py_ue_is_swindow(PyObject *obj) | ||
| 273 | + { | ||
| 274 | + if (!PyObject_IsInstance(obj, (PyObject *)&ue_PySWindowType)) | ||
| 275 | + return nullptr; | ||
| 276 | + return (ue_PySWindow *)obj; | ||
| 277 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,3 +14,5 @@ typedef struct { | |||
| 14 | 14 | } ue_PySWindow; | |
| 15 | 15 | ||
| 16 | 16 | void ue_python_init_swindow(PyObject *); | |
| 17 | + | ||
| 18 | + ue_PySWindow *py_ue_is_swindow(PyObject *obj); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ | |||
| 17 | 17 | "Modules": [ | |
| 18 | 18 | { | |
| 19 | 19 | "Name": "UnrealEnginePython", | |
| 20 | - "Type": "Runtime", | ||
| 20 | + "Type": "Developer", | ||
| 21 | 21 | "LoadingPhase": "Default" | |
| 22 | 22 | }, | |
| 23 | 23 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments