2.5: layout.itemO now returns OperatorProperties to be filled in,

when passing properties=True as argument.

Other changes:
* uiItemR, uiItemFullR, uiItemFullO now accept a flag argument rather
  than multiple different "boolean" arguments, but still exposed as
  booleans to python.
* Fix RNA to support setting PROP_RNAPTR for return values.
This commit is contained in:
2009-08-21 12:57:47 +00:00
parent 27797a45ee
commit 1c614f6cf6
16 changed files with 170 additions and 182 deletions

View File

@@ -2759,13 +2759,10 @@ static void proxy_group_objects_menu (bContext *C, wmOperator *op, Object *ob, G
if (go->ob) {
PointerRNA props_ptr;
/* create operator properties, and assign the relevant pointers to that,
* and add a menu entry which uses these props
*/
WM_operator_properties_create(&props_ptr, op->idname);
RNA_string_set(&props_ptr, "object", go->ob->id.name+2);
RNA_string_set(&props_ptr, "group_object", go->ob->id.name+2);
uiItemFullO(layout, go->ob->id.name+2, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN);
/* create operator menu item with relevant properties filled in */
props_ptr= uiItemFullO(layout, go->ob->id.name+2, 0, op->idname, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
RNA_string_set(&props_ptr, "object", go->ob->id.name+2);
RNA_string_set(&props_ptr, "group_object", go->ob->id.name+2);
}
}
@@ -2793,12 +2790,9 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt)
uiLayout *layout= uiPupMenuLayout(pup);
PointerRNA props_ptr;
/* create operator properties, and assign the relevant pointers to that,
* and add a menu entry which uses these props
*/
WM_operator_properties_create(&props_ptr, op->idname);
RNA_string_set(&props_ptr, "object", ob->id.name+2);
uiItemFullO(layout, op->type->name, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN);
/* create operator menu item with relevant properties filled in */
props_ptr= uiItemFullO(layout, op->type->name, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
RNA_string_set(&props_ptr, "object", ob->id.name+2);
/* present the menu and be done... */
uiPupMenuEnd(C, pup);