EnumList Class Member Meta-Data Tag
EnumList Meta-Tag
See Also: Class Member Meta-Data Tags
Purpose
Used by Studio CodeSense and designers to determine valid enumerated constants that can be used as a property's value.
Applies To
- Properties
Syntax
{ EnumList="{list of enumerated constants}" }
where {list of enumerated constants} is a comma-separated list of enumerated constants that are declared somewhere in the source code.
Use
This enumeration list will be available as selections in the Studio's Properties Panel.
To indicate that a property has an enumerated list of possible values, add the EnumList meta-data tag above the property declaration line.
Example 1
This sample code shows how to indicate that a property declared on a property declaration line has an enumerated list of possible values.
Enumeration_List
Define Circle
Define Oval
Define Rectangle
Define Square
End_Enumeration_List
Class cShape is a cObject
Procedure Construct_Object
forward send Construct_Object
{ EnumList="Circle, Oval, Rectangle, Square" }
Property Integer peShapeType Rectangle
End_Procedure
End_Class
Example 2
This sample code shows how to indicate that a property declared on a property declaration line has an enumerated list of possible values and an initial value of Rectangle (not in quotes, since it is an integer constant defined in an enumeration list).
Enumeration_List
Define Circle
Define Oval
Define Rectangle
Define Square
End_Enumeration_List
Class cShape is a cObject
Procedure Construct_Object
forward send Construct_Object
{ EnumList="Circle, Oval, Rectangle, Square" }
{ InitialValue=Rectangle }
Property Integer peShapeType
End_Procedure
End_Class
Of Special Note
The EnumList class member meta-data tag is inherited. If a superclass property has a specific EnumList (e.g., "Circle, Square"), the same property in subclasses of that class will have the same initial value (e.g., "Circle, Square"), unless it is explicitly changed in that subclass.