Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 2,095
    • Issues 2,095
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FPC
  • LazarusLazarus
  • LazarusLazarus
  • Issues
  • #38157
Closed
Open
Issue created Dec 01, 2020 by FPC Admin account@fpc_adminOwner

TCheckGroup.Items.Insert() do not move the .Checked[] elements

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
Assignee
Assign to
Time tracking