View Issue Details

IDProjectCategoryView StatusLast Update
0038157LazarusLCLpublic2020-12-02 13:14
ReporterMarkus Müller Assigned Towp  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.0.10 
Summary0038157: TCheckGroup.Items.Insert() do not move the .Checked[] elements
DescriptionIf 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 InformationI 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.
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Activities

Markus Müller

2020-12-01 08:50

reporter  

TestTCheckGroup.zip (128,180 bytes)
TCheckBox.avi (798,014 bytes)   

Markus Müller

2020-12-01 08:54

reporter   ~0127285

Test in the german Lazarus forum:
https://www.lazarusforum.de/viewtopic.php?f=18&t=13277

wp

2020-12-01 10:22

developer   ~0127290

Please test and close if ok.

Markus Müller

2020-12-02 13:14

reporter   ~0127319

Thank you very much, it works good.

Issue History

Date Modified Username Field Change
2020-12-01 08:50 Markus Müller New Issue
2020-12-01 08:50 Markus Müller File Added: TestTCheckGroup.zip
2020-12-01 08:50 Markus Müller File Added: TCheckBox.avi
2020-12-01 08:54 Markus Müller Note Added: 0127285
2020-12-01 10:16 wp Assigned To => wp
2020-12-01 10:16 wp Status new => assigned
2020-12-01 10:22 wp Status assigned => resolved
2020-12-01 10:22 wp Resolution open => fixed
2020-12-01 10:22 wp LazTarget => -
2020-12-01 10:22 wp Note Added: 0127290
2020-12-02 13:12 Markus Müller Issue cloned: 0038159
2020-12-02 13:14 Markus Müller Status resolved => closed
2020-12-02 13:14 Markus Müller Note Added: 0127319