Hi,
I try to get all possible values for an enum for my custom object inspector (In OpenGL so I can't use the LCL one).
So from that
TTestEnum = ( value1, value2, value3 );
I want a stringlist with the lines 'value1', 'value2', 'value3'.
This code works for the enum above:
if ( FPropInfo^.PropType^.Kind in [ tkEnumeration, tkBool ]) then
begin
Result:= TStringList.Create;
for i:= 0 to GetEnumNameCount( FPropInfo^.PropType ) - 1 do
Result.Add( GetEnumName( FPropInfo^.PropType, i ));
WriteLn( Result.Text );
end
else
Result:= nil;
But for this enum it does not work.
TTestEnum2 = ( value1, value5 = 5, value7 = 7 ); // does only return value1
Does anyone know a solution or should I not use this kind of enum?