Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_layout.c
| Context not available. | |||||
| but->str[0] = 0; | but->str[0] = 0; | ||||
| } | } | ||||
| /* Setting initially selected item. */ | |||||
| void *active = NULL; | |||||
| switch (RNA_property_type(prop)) { | |||||
| case PROP_POINTER: | |||||
| { | |||||
| PointerRNA pptr = RNA_property_pointer_get(ptr, prop); | |||||
| active = pptr.data; | |||||
| break; | |||||
| } | |||||
| case PROP_ENUM: | |||||
| { | |||||
| active = RNA_property_enum_get(ptr, prop); | |||||
| break; | |||||
| } | |||||
| case PROP_STRING: | |||||
| { | |||||
| /* Searchbox does not handle string comparisons. | |||||
| * When active is NULL, a visible item that matches but->editstr will be selected. (VertexGroups) */ | |||||
| break; | |||||
| } | |||||
| } | |||||
| UI_but_func_search_set( | UI_but_func_search_set( | ||||
| but, ui_searchbox_create_generic, ui_rna_collection_search_cb, | but, ui_searchbox_create_generic, ui_rna_collection_search_cb, | ||||
| coll_search, true, NULL, NULL); | coll_search, true, NULL, active); | ||||
| } | } | ||||
| else if (but->type == UI_BTYPE_SEARCH_MENU) { | else if (but->type == UI_BTYPE_SEARCH_MENU) { | ||||
| /* In case we fail to find proper searchprop, | /* In case we fail to find proper searchprop, | ||||
| Context not available. | |||||