[RTTI Controls] editing an enum in the TIPropertyGrid is not type safe
Original Reporter info from Mantis: BBaz @basile.b
-
Reporter name:
Original Reporter info from Mantis: BBaz @basile.b
- Reporter name:
Description:
In the TIPropertyGrid, the value of an enumeration can be edited by hand. In case of invalid value, the grid displays the last member, which leads to think that the value of the property is limited but actually, after such a typo, the value of the target field is undetermined.
Later other exceptions can be thrown (an example is a constant array indexed and accessed with an enumeration).
See attachment for more details.
Steps to reproduce:
- Open and run the project in the attachment.
- Click the button at the top.
Additional information:
Even if te problem can be solved bu using a setter in the object that published the source enum I suggest to add some code in the RTTI controls:
- either to raise an exception
- either to auto fix the invalid value (let's say to the value of the last member
Mantis conversion info:
- Mantis ID: 29240
- Version: 1.6RC1
- Fixed in revision: r55831 (#3c494228)