diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-24 07:02:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-24 07:02:27 +0400 |
commit | 5c604e5524ace49caeda7c0bff9443afc43b236f (patch) | |
tree | aab6dd5d645b92a7d451b3d62a16d0d0e716d318 /source/blender/editors | |
parent | 48e34b995686d50177932660ec422528eb4a6da8 (diff) |
remove recently added rna function uilayout.prop_search_self() and instead allow collections to be coerced into rna structs when they define a type.
eg:
row.prop_search_self(scene, "active", "keying_sets", text="")
...becomes
row.prop_search(scene.keying_sets, "active", scene, "keying_sets", text="")
This is more flexible since it works for other UI functions too.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 60 |
2 files changed, 0 insertions, 61 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index d95e82b0824..b126c6235d5 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -717,7 +717,6 @@ void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *value, char *name, int icon); void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname, char *name, int icon); -void uiItemPointerSubR(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *searchpropname, char *name, int icon); void uiItemsFullEnumO(uiLayout *layout, char *opname, char *propname, struct IDProperty *properties, int context, int flag); void uiItemL(uiLayout *layout, char *name, int icon); /* label */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index e7af748ba37..1d98b1f22c1 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1263,66 +1263,6 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, char *propname, st ui_but_add_search(but, ptr, prop, searchptr, searchprop); } -/* almost the same as uiItemPointerR except the collection is used to get the propname */ -void uiItemPointerSubR(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *searchpropname, char *name, int icon) -{ - PropertyRNA *prop, *searchprop; - PropertyType type; - PointerRNA c_ptr; - uiBut *but; - uiBlock *block; - StructRNA *icontype; - int w, h; - - /* validate arguments */ - searchprop= RNA_struct_find_property(ptr, searchpropname); - - if(!searchprop || RNA_property_type(searchprop) != PROP_COLLECTION) { - printf("uiItemCollectionPointerR: search collection property not found: %s.%s\n", RNA_struct_identifier(ptr->type), searchpropname); - return; - } - - if(!RNA_property_collection_type_get(ptr, searchprop, &c_ptr)) { - printf("uiItemCollectionPointerR: search collection sub-property not found1: %s.%s.%s\n", RNA_struct_identifier(ptr->type), searchpropname, propname); - return; - } - - if ((prop = RNA_struct_find_property(&c_ptr, propname))) { - /* don't need this, pass */ - /* d_ptr= RNA_property_pointer_get(ptr, prop); */ - } - else { - printf("uiItemCollectionPointerR: search collection sub-property not found2: %s.%s.%s\n", RNA_struct_identifier(ptr->type), searchpropname, propname); - return; - } - - type= RNA_property_type(prop); - if(!ELEM(type, PROP_POINTER, PROP_STRING)) { - printf("uiItemCollectionPointerR: property %s must be a pointer or string.\n", propname); - return; - } - - /* get icon & name */ - if(!icon) { - if(type == PROP_POINTER) - icontype= RNA_property_pointer_type(&c_ptr, prop); - else - icontype= RNA_property_pointer_type(ptr, searchprop); - - icon= RNA_struct_ui_icon(icontype); - } - if(!name) - name= (char*)RNA_property_ui_name(prop); - - /* create button */ - block= uiLayoutGetBlock(layout); - - ui_item_rna_size(layout, name, icon, &c_ptr, prop, 0, 0, &w, &h); - but= ui_item_with_label(layout, block, name, icon, &c_ptr, prop, 0, 0, 0, w, h, 0); - - ui_but_add_search(but, &c_ptr, prop, ptr, searchprop); -} - /* menu item */ static void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt) { |