======================= Enum (hwx.inspire.core) ======================= Store a string with a predefined list of allowed values and labels -------------- Public Methods -------------- +---------------------------------------------------+ | classmethod splitValues_ (cls, options) | +---------------------------------------------------+ | OnAttributeModify_ (self, obj, attr, *args) | +---------------------------------------------------+ | castForSet_ (self, obj, value) | +---------------------------------------------------+ | create_ (self, obj) | +---------------------------------------------------+ | disable_ (self, obj) | +---------------------------------------------------+ | enable_ (self, obj) | +---------------------------------------------------+ | getDisplayNames_ (self, obj) | +---------------------------------------------------+ | getGuiValue_ (self, obj) | +---------------------------------------------------+ | getValueFromDisplayName_ (self, obj, displayName) | +---------------------------------------------------+ | getValues_ (self, obj) | +---------------------------------------------------+ | getValuesAndDisplayNames_ (self, obj) | +---------------------------------------------------+ | makeValueValid_ (self, obj) | +---------------------------------------------------+ -------------- Method Details -------------- .. _splitValues: .. classmethod:: splitValues(cls, options) Splits the specified options into values and display names. .. _OnAttributeModify: .. method:: OnAttributeModify(self, obj, attr, *args) Callback method when the attribute gets modified. .. _castForSet: .. method:: castForSet(self, obj, value) Converts and validates the enum values before setting. :param obj: Object this attribute belongs to. :type obj: GeneralObject :param value: Value of the attribute to set. :type value: List[str] :returns: Validated and converted value. :rtype: Enum .. _create: .. method:: create(self, obj) Creates an enum attribute for the specified object. .. _disable: .. method:: disable(self, obj) Disables the attribute. .. _enable: .. method:: enable(self, obj) Enables the attribute. .. _getDisplayNames: .. method:: getDisplayNames(self, obj) Returns the display name. .. _getGuiValue: .. method:: getGuiValue(self, obj) Returns the formatted value, as shown in the Property Editor. .. _getValueFromDisplayName: .. method:: getValueFromDisplayName(self, obj, displayName) Returns the value from the specified display name and object. .. _getValues: .. method:: getValues(self, obj) Returns the enum values. .. _getValuesAndDisplayNames: .. method:: getValuesAndDisplayNames(self, obj) Returns all the enum value and the display names for it. .. _makeValueValid: .. method:: makeValueValid(self, obj) Make sure value is still valid after allowed values changes.