diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-25 00:17:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-25 00:17:14 +0300 |
commit | 5f4e24d5990a7ecd6198ee394da8b7c07277cd91 (patch) | |
tree | 9a1909d90276f0243d50c6624da43c794cc52dad /source/blender/windowmanager | |
parent | 4b8bc301c62784d111f2cffcbc35cf9c6189e37b (diff) |
operator draw function working again. needed to add layout to the operator to give access to "self.layout" - like panels, headers and manu's have
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 21 |
2 files changed, 16 insertions, 7 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index f0ccbed06c3..78125954816 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -383,7 +383,7 @@ typedef struct wmOperatorType { int (*poll)(struct bContext *); /* optional panel for redo and repeat, autogenerated if not set */ - void (*ui)(struct bContext *, struct wmOperator *, struct uiLayout *); + void (*ui)(struct bContext *, struct wmOperator *); /* rna for properties */ struct StructRNA *srna; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 6d008d5cbb3..8a9fb1fa5b5 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -774,8 +774,11 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, width, 20, style); uiItemL(layout, op->type->name, 0); - if(op->type->ui) - op->type->ui((bContext*)C, op, layout); + if(op->type->ui) { + op->layout= layout; + op->type->ui((bContext*)C, op); + op->layout= NULL; + } else uiDefAutoButsRNA(C, layout, &ptr, columns); @@ -808,8 +811,11 @@ static uiBlock *wm_operator_create_ui(bContext *C, ARegion *ar, void *userData) RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style); - if(op->type->ui) - op->type->ui((bContext*)C, op, layout); + if(op->type->ui) { + op->layout= layout; + op->type->ui((bContext*)C, op); + op->layout= NULL; + } uiPopupBoundsBlock(block, 4.0f, 0, 0); uiEndBlock(C, block); @@ -862,8 +868,11 @@ static uiBlock *wm_block_create_menu(bContext *C, ARegion *ar, void *arg_op) layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 300, 20, style); uiItemL(layout, op->type->name, 0); - if(op->type->ui) - op->type->ui(C, op, layout); + if(op->type->ui) { + op->layout= layout; + op->type->ui(C, op); + op->layout= NULL; + } else uiDefAutoButsRNA(C, layout, op->ptr, 2); |