TCheckGroup.Items.Insert() do not move the .Checked[] elements
Original Reporter info from Mantis: mmvisual
-
Reporter name: Markus Müller
Original Reporter info from Mantis: mmvisual
- Reporter name: Markus Müller
Description:
If there is a TCheckGroup with some checked items, after insert at position 0 a new item, the checked [0..n] are not moved to [1..n+1]
Steps to reproduce:
// Create a new Application, put a TCheckGroup and a TButton into the form and fill out this two events:
// Add into a TCheckGroup some elements and check it:
Procedure TForm1.FormCreate(Sender: TObject);
Var i: Integer;
Begin
For i := 0 To 3 Do
Begin
CheckGroup1.Items.Add('Nr ' + (i+2).ToString);
CheckGroup1.Checked[i] := True;
End;
end;
// Press Button1 to insert a new element at position 1
Procedure TForm1.Button1Click(Sender: TObject);
Begin
CheckGroup1.Items.Insert(0, 'Nr 1');
CheckGroup1.Checked[0] := True;
end;
Additional information:
I think it is a litte difficult to solve this problem, because the Items list has no diectly connection to the Checked list.
You can see the movie "TCheckBox.avi" from screen recorder.
Mantis conversion info:
- Mantis ID: 38157
- Version: 2.0.10