View Issue Details

IDProjectCategoryView StatusLast Update
0014989LazarusLCLpublic2010-09-08 11:43
Reportertaka_jpAssigned ToPaul Ishenin 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target Version1.0.0Fixed in Version0.9.29 (SVN) 
Summary0014989: TRadioButton and TRadioGroup Click Bug
Description[TRadioButton] Win32 and Debian(X86_64)
1. RadioButton1 Click
  -> RadioButton1.OnClick
2. RadioButton2 Click
  -> RadioButton1.OnClick <-- bug
  -> RadioButton2.OnClick
3. RadioButton3 Click
  -> RadioButton2.OnClick <-- bug
  -> RadioButton3.OnClick

[TRadioGroup] Win32
When I click the item with the checkmark focus,
Two times of OnClick events are called

Click : OnClick(ItemIndex= -1) --> OnClick(ItemIndex=Clicked Index)

 --------------------------

attach Sample zip File
  project1.lpi lazarus
  project2.dpr Delphi


Additional InformationPerhaps it is caused by an event below

procedure TCustomCheckBox.DoChange(var Msg);
  inherited Click; // emulate delphi OnClick behaviour
end;

lcl/include/customcheckbox.inc
+ if (Self is TRadioButton)and(FState <> cbChecked) then Exit;
  inherited Click; // emulate delphi OnClick behaviour
TagsNo tags attached.
Fixed in Revision26761
LazTarget1.0
WidgetsetGTK 2, Win32/Win64
Attached Files

Activities

2009-11-04 03:58

 

fpc-laz-bug-RadioButtonClick.zip (254,740 bytes)

Paul Ishenin

2010-07-21 10:03

manager   ~0039519

Please test and close if ok.

Tsvetoslav

2010-07-22 10:18

reporter   ~0039583

I can't reopen the issue, but I think there is a problem with "OnChange" event.
Starting with 3 radio buttons, first one checked, and clicking 1 - 2 - 3 - 2 - 1 - 3 ..., the following events are sent:

RadioButton1 -> Clicked
RadioButton2 -> Changed
RadioButton2 -> Clicked
RadioButton3 -> Changed
RadioButton3 -> Clicked
RadioButton2 -> Clicked
RadioButton1 -> Clicked
RadioButton3 -> Clicked
...

Please note that there are only two "Changed" events. Well, I'm not sure how exactly it should work (Delphi does not have RadioButton.OnChange event), but it seems inconsistent to me.

Issue History

Date Modified Username Field Change
2009-11-04 03:58 removed New Issue
2009-11-04 03:58 removed File Added: fpc-laz-bug-RadioButtonClick.zip
2009-11-04 03:58 removed Widgetset => GTK 2, Win32/Win64
2009-11-18 21:52 Vincent Snijders LazTarget => 1.0
2009-11-18 21:52 Vincent Snijders Status new => acknowledged
2009-11-18 21:52 Vincent Snijders Target Version => 1.0.0
2010-07-21 10:03 Paul Ishenin Fixed in Revision => 26761
2010-07-21 10:03 Paul Ishenin Status acknowledged => resolved
2010-07-21 10:03 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-07-21 10:03 Paul Ishenin Resolution open => fixed
2010-07-21 10:03 Paul Ishenin Assigned To => Paul Ishenin
2010-07-21 10:03 Paul Ishenin Note Added: 0039519
2010-07-22 10:18 Tsvetoslav Note Added: 0039583
2010-09-08 11:43 removed Status resolved => closed