TRadioGroup ItemIndex set to -1 is Ignored
Original Reporter info from Mantis: TWhyman
-
Reporter name: Tony Whyman
Original Reporter info from Mantis: TWhyman
- Reporter name: Tony Whyman
Description:
At design time, when the itemindex is set to -1, no radio buttons are selected. However, at run time, it is impossible to have no selected button even when the itemindex is explicitly set to -1
Steps to reproduce:
Put a TRadioGroup on a form, click to set a radio button and then programmatically set itemindex to -1
Additional information:
I have tracked the problem down to TCustomRadioGroup.UpdateItems. This creates the handle for the hidden button and then immediately trashes it by a call to RemoveControl (in order to force the hidden button to list end). InsertControl is then called, but this does not recreate the handle.
The proposed solution is to create the handle after the calls to RemoveControl/InsertControl. Patch attached.
Mantis conversion info:
- Mantis ID: 29093
- OS: Linux
- OS Build: Mint 17
- Platform: AMD64
- Version: 1.4.4
- Monitored by: » TWhyman (Tony Whyman)