diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-12-23 03:56:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-12-23 03:56:40 +0300 |
commit | ea837b25e39a920f466d6acd6b2f490ba1d97382 (patch) | |
tree | 029533059178969715e3819637206cdd93e74e47 /source/blender/python/api2_2x/Draw.c | |
parent | 1ad1522d10a0efbb5929826af4801724adf4a357 (diff) |
Added Draw.BeginAlign(), Draw.EndAlign()
added align to a few scripts where it looks nice.
Diffstat (limited to 'source/blender/python/api2_2x/Draw.c')
-rw-r--r-- | source/blender/python/api2_2x/Draw.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c index c5e8fb27559..173d971e7b8 100644 --- a/source/blender/python/api2_2x/Draw.c +++ b/source/blender/python/api2_2x/Draw.c @@ -107,10 +107,12 @@ static PyObject *Method_String( PyObject * self, PyObject * args ); static PyObject *Method_GetStringWidth( PyObject * self, PyObject * args ); static PyObject *Method_Text( PyObject * self, PyObject * args ); static PyObject *Method_PupMenu( PyObject * self, PyObject * args ); -/* next three by Campbell: */ +/* next Five by Campbell: */ static PyObject *Method_PupIntInput( PyObject * self, PyObject * args ); static PyObject *Method_PupFloatInput( PyObject * self, PyObject * args ); static PyObject *Method_PupStrInput( PyObject * self, PyObject * args ); +static PyObject *Method_BeginAlign( PyObject * self ); +static PyObject *Method_EndAlign( PyObject * self ); /* next by Jonathan Merritt (lancelet): */ static PyObject *Method_Image( PyObject * self, PyObject * args); /* CLEVER NUMBUT */ @@ -158,6 +160,12 @@ static char Method_Button_doc[] = [tooltip=] The button's tooltip\n\n\ This function can be called as Button() or PushButton()."; +static char Method_BeginAlign_doc[] = + "Buttons after this function will draw aligned (button layout only)"; + +static char Method_EndAlign_doc[] = + "Use after BeginAlign() to stop aligning the buttons (button layout only)."; + static char Method_Menu_doc[] = "(name, event, x, y, width, height, default, [tooltip]) - Create a new Menu \ button\n\n\ @@ -348,6 +356,8 @@ static struct PyMethodDef Draw_methods[] = { MethodDef( Draw ), MethodDef( Register ), {"PushButton", Method_Button, METH_VARARGS, Method_Button_doc}, + {"BeginAlign", Method_BeginAlign, METH_NOARGS, Method_BeginAlign_doc}, + {"EndAlign", Method_EndAlign, METH_NOARGS, Method_EndAlign_doc}, {NULL, NULL, 0, NULL} }; @@ -856,6 +866,28 @@ static PyObject *Method_Button( PyObject * self, PyObject * args ) return EXPP_incr_ret( Py_None ); } + + +static PyObject *Method_BeginAlign( PyObject * self ) +{ + uiBlock *block = Get_uiBlock( ); + + if (block) + uiBlockBeginAlign(block); + + return EXPP_incr_ret( Py_None ); +} + +static PyObject *Method_EndAlign( PyObject * self ) +{ + uiBlock *block = Get_uiBlock( ); + + if (block) + uiBlockEndAlign(block); + + return EXPP_incr_ret( Py_None ); +} + static PyObject *Method_Menu( PyObject * self, PyObject * args ) { uiBlock *block; |