diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-02 05:39:33 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-02 05:39:33 +0400 |
commit | 4bb41c3dcdd029db63435e83700520070703a9bc (patch) | |
tree | 1253f9881b1a4853778fa52d3207c56cefeeed8b /source/blender/python | |
parent | ecdd332021dcafdec69525a5140c1f43e1dc434a (diff) |
UI: various panels fixes.
* Fix sometimes non-working close/open button.
* Fix panels being a bit out of the view on startup.
* Fix too large totrct region for view2d.
* Fix wrong panel order when changing vertical <-> horizontal.
* Fix wrong panel positions after switching contexts.
* Fix an access of freed memory when collapsing panels.
* Free align mode works again.
* Animations work again.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_ui.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/source/blender/python/intern/bpy_ui.c b/source/blender/python/intern/bpy_ui.c index 608086843ba..7db9808adf0 100644 --- a/source/blender/python/intern/bpy_ui.c +++ b/source/blender/python/intern/bpy_ui.c @@ -191,26 +191,29 @@ static PyObject *Method_drawBlock( PyObject * self, PyObject * args ) Py_RETURN_NONE; } -static PyObject *Method_drawPanels( PyObject * self, PyObject * args ) +static PyObject *Method_beginPanels( PyObject * self, PyObject * args ) { + bContext *C; PyObject *py_context; - int align; - if( !PyArg_ParseTuple( args, "O!i:drawPanels", &PyCObject_Type, &py_context, &align) ) + if( !PyArg_ParseTuple( args, "O!i:beginPanels", &PyCObject_Type, &py_context) ) return NULL; - uiDrawPanels(PyCObject_AsVoidPtr(py_context), align); + C= PyCObject_AsVoidPtr(py_context); + uiBeginPanels(C, CTX_wm_region(C)); Py_RETURN_NONE; } -static PyObject *Method_matchPanelsView2d( PyObject * self, PyObject * args ) +static PyObject *Method_endPanels( PyObject * self, PyObject * args ) { - PyObject *py_ar; + bContext *C; + PyObject *py_context; - if( !PyArg_ParseTuple( args, "O!:matchPanelsView2d", &PyCObject_Type, &py_ar) ) + if( !PyArg_ParseTuple( args, "O!:endPanels", &PyCObject_Type, &py_context) ) return NULL; - uiMatchPanelsView2d(PyCObject_AsVoidPtr(py_ar)); + C= PyCObject_AsVoidPtr(py_context); + uiEndPanels(C, CTX_wm_region(C)); Py_RETURN_NONE; } @@ -413,8 +416,8 @@ static struct PyMethodDef ui_methods[] = { {"blockEndAlign", (PyCFunction)Method_blockEndAlign, METH_VARARGS, ""}, {"blockSetFlag", (PyCFunction)Method_blockSetFlag, METH_VARARGS, ""}, {"newPanel", (PyCFunction)Method_newPanel, METH_VARARGS, ""}, - {"drawPanels", (PyCFunction)Method_drawPanels, METH_VARARGS, ""}, - {"matchPanelsView2d", (PyCFunction)Method_matchPanelsView2d, METH_VARARGS, ""}, + {"beginPanels", (PyCFunction)Method_beginPanels, METH_VARARGS, ""}, + {"endPanels", (PyCFunction)Method_endPanels, METH_VARARGS, ""}, {"register", (PyCFunction)Method_register, METH_VARARGS, ""}, // XXX not sure about this - registers current script with the ScriptSpace, like Draw.Register() {"registerKey", (PyCFunction)Method_registerKey, METH_VARARGS, ""}, // XXX could have this in another place too |