Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-10

TCheckListBox.OnClickCheck event

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Boian Mitov

Hi folks,

I am testing some code ported from Delphi.
I have discovered a bug in the Lazarus TCheckListBox implementation. If you create a new application in Windows and add TCheckListBox with few items in it, the OnClickCheck event is fired before the new item is selected, and the new check status is assigned:

procedure TForm1.CheckListBox1ClickCheck(Sender: TObject);
begin
  if( CheckListBox1.ItemIndex >= 0 ) then
    begin
    if( CheckListBox1.Checked[ CheckListBox1.ItemIndex ] ) then
      CheckListBox1.Items[ CheckListBox1.ItemIndex ] := 'Checked'
    else
      CheckListBox1.Items[ CheckListBox1.ItemIndex ] := 'Unchecked';
    end;
end;

Here is a test application I have uploaded:

www.mitov.com/CheckListBoxBug.zip

To reproduce just click on the check box of a non selected item.

This aside from being different than the Delphi version effectively renders the OnClickCheck largely useless. I have not tested it in Linux yet.

With best regards,
Boian Mitov

------------------------------------------------------- Mitov Software
www.mitov.com
------------------------------------------------------- -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091004/d07e5fb5/attachment.html>

Reply by email

Mattias Gaertner
to Boian Mitov
Show quoted text 32 lines
Hi folks, I am testing some code ported from Delphi. I have discovered a bug in the Lazarus TCheckListBox implementation. If you create a new application in Windows and add TCheckListBox with few items in it, the OnClickCheck event is fired before the new item is selected, and the new check status is assigned: procedure TForm1.CheckListBox1ClickCheck(Sender: TObject); begin if( CheckListBox1.ItemIndex >= 0 ) then begin if( CheckListBox1.Checked[ CheckListBox1.ItemIndex ] ) then CheckListBox1.Items[ CheckListBox1.ItemIndex ] := 'Checked' else CheckListBox1.Items[ CheckListBox1.ItemIndex ] := 'Unchecked'; end; end; Here is a test application I have uploaded: www.mitov.com/CheckListBoxBug.zip To reproduce just click on the check box of a non selected item. This aside from being different than the Delphi version effectively renders the OnClickCheck largely useless. I have not tested it in Linux yet.

Please create a bug report for this.

Mattias

Reply by email

Boian Mitov
to Paul Ishenin: Indeed. You found even 2 bugs. Both were fixed in r22038, r22039. Paul Ishenin.

Hi Paul,

Thank you!
I already reported the Page control bug from the other e-mail. If the Check Box bug is fixed, then there is no need for reporting it in the Bug Tracker. Will the fix be included in any of the daily snapshots ?

With best regards,
Boian Mitov

------------------------------------------------------- Mitov Software
www.mitov.com
-------------------------------------------------------

Earlier message 26 lines
----- Original Message ----- From: "Paul Ishenin" To: "Lazarus mailing list" Sent: Monday, October 05, 2009 1:04 AM Subject: Re: [Lazarus] TCheckListBox.OnClickCheck event > Boian Mitov wrote: > >> Here is a test application I have uploaded: >> >> www.mitov.com/CheckListBoxBug.zip >> <http://www.mitov.com/CheckListBoxBug.zip> > > > Indeed. You found even 2 bugs. Both were fixed in r22038, r22039. > > Best regards, > Paul Ishenin. > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Paul Ishenin
to Boian Mitov: Thank you! I already reported the Page control bug from the other e-mail. If the Check…
Boian Mitov wrote
Thank you! I already reported the Page control bug from the other e-mail. If the

Yes, I noticed and fixed it.

Check Box bug is fixed, then there is no need for reporting it in the Bug Tracker.

Yes, no need now.

Will the fix be included in any of the daily snapshots ?

Tomorow snapshot. Build from the svn if you don't like to wait for snapshots (moreover you need to download rather big file, uninstall, install). Building from the svn is easy.

Best regards,
Paul Ishenin.

Reply by email