Hopefully this is a quick one, and "Easy if you know how"...
I'm writing some kind of Serialization/Scripting class to generate forms on the fly, I tried setting a TColor the other day and got an error
clBtnFace is not a valid integer value
or something like that and found that the constants used in properties are registered so that they can be converted to integer, and so I added code to fetch the converter and use it.
Now today I have a similar issue with the ModalResult property but I can't work out how the DFM deserializer handles this property? Any ideas how it converts mrOK
into an integer?
Edit
There isn't much of an example to give:
PropInfo := GetPropInfo(Instance, PropertyName);
SetPropValue(Instance, PropInfo, PropertyValue);
Where in this case Instance is a TButton, PropertyName is 'ModalResult' and PropertyValue is 'mrOK'