Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_layout.c
| Show First 20 Lines • Show All 1,684 Lines • ▼ Show 20 Lines | void uiItemEnumO_string(uiLayout *layout, | ||||
| if (prop == NULL) { | if (prop == NULL) { | ||||
| RNA_warning("%s.%s not found", RNA_struct_identifier(ptr.type), propname); | RNA_warning("%s.%s not found", RNA_struct_identifier(ptr.type), propname); | ||||
| return; | return; | ||||
| } | } | ||||
| /* enum lookup */ | /* enum lookup */ | ||||
| /* no need for translations here */ | /* no need for translations here */ | ||||
| const EnumPropertyItem *item; | const EnumPropertyItem *item; | ||||
| const EnumPropertyItem_Order *item_order; | |||||
| bool free; | bool free; | ||||
| RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, NULL, &free); | RNA_property_enum_items_with_order( | ||||
| layout->root->block->evil_C, &ptr, prop, &item, &item_order, NULL, &free); | |||||
| int value; | int value; | ||||
| if (item == NULL || RNA_enum_value_from_id(item, value_str, &value) == 0) { | if ((item == NULL) || | ||||
| (RNA_enum_value_from_id_with_order(item, item_order, value_str, &value) == 0)) { | |||||
| if (free) { | if (free) { | ||||
| MEM_freeN((void *)item); | MEM_freeN((void *)item); | ||||
| } | } | ||||
| RNA_warning("%s.%s, enum %s not found", RNA_struct_identifier(ptr.type), propname, value_str); | RNA_warning("%s.%s, enum %s not found", RNA_struct_identifier(ptr.type), propname, value_str); | ||||
| return; | return; | ||||
| } | } | ||||
| if (free) { | if (free) { | ||||
| ▲ Show 20 Lines • Show All 816 Lines • ▼ Show 20 Lines | void uiItemEnumR_string_prop(uiLayout *layout, | ||||
| if (UNLIKELY(RNA_property_type(prop) != PROP_ENUM)) { | if (UNLIKELY(RNA_property_type(prop) != PROP_ENUM)) { | ||||
| const char *propname = RNA_property_identifier(prop); | const char *propname = RNA_property_identifier(prop); | ||||
| ui_item_disabled(layout, propname); | ui_item_disabled(layout, propname); | ||||
| RNA_warning("not an enum property: %s.%s", RNA_struct_identifier(ptr->type), propname); | RNA_warning("not an enum property: %s.%s", RNA_struct_identifier(ptr->type), propname); | ||||
| return; | return; | ||||
| } | } | ||||
| const EnumPropertyItem *item; | const EnumPropertyItem *item; | ||||
| const EnumPropertyItem_Order *item_order; | |||||
| bool free; | bool free; | ||||
| RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, NULL, &free); | RNA_property_enum_items_with_order( | ||||
| layout->root->block->evil_C, ptr, prop, &item, &item_order, NULL, &free); | |||||
| int ivalue; | int ivalue; | ||||
| if (!RNA_enum_value_from_id(item, value, &ivalue)) { | if (!RNA_enum_value_from_id_with_order(item, item_order, value, &ivalue)) { | ||||
| const char *propname = RNA_property_identifier(prop); | const char *propname = RNA_property_identifier(prop); | ||||
| if (free) { | if (free) { | ||||
| MEM_freeN((void *)item); | MEM_freeN((void *)item); | ||||
| } | } | ||||
| ui_item_disabled(layout, propname); | ui_item_disabled(layout, propname); | ||||
| RNA_warning("enum property value not found: %s", value); | RNA_warning("enum property value not found: %s", value); | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 3,451 Lines • Show Last 20 Lines | |||||