mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-09 15:46:11 +02:00
LCL: in TRadioGroup and TCheckGroup don't set the name for runtime created radiobuttons/checkboxes.
They are not needed and can give rise to unexpected crashes if the name already exists.
This commit is contained in:
parent
5137735655
commit
d405afa039
@ -249,10 +249,7 @@ begin
|
|||||||
for i:=0 to FItems.Count-1 do begin
|
for i:=0 to FItems.Count-1 do begin
|
||||||
CheckBox:=TCheckBox(FButtonList[i]);
|
CheckBox:=TCheckBox(FButtonList[i]);
|
||||||
CheckBox.Caption:=FItems[i];
|
CheckBox.Caption:=FItems[i];
|
||||||
CheckBox.Name := '';
|
|
||||||
end;
|
end;
|
||||||
for i:=0 to FButtonList.Count-1 do
|
|
||||||
TCheckBox(FButtonList[i]).Name:='CheckBox'+IntToStr(i);
|
|
||||||
finally
|
finally
|
||||||
FUpdatingItems:=false;
|
FUpdatingItems:=false;
|
||||||
end;
|
end;
|
||||||
@ -426,7 +423,6 @@ begin
|
|||||||
if (Idx <> -1) and (Idx < Items.Count) then
|
if (Idx <> -1) and (Idx < Items.Count) then
|
||||||
begin
|
begin
|
||||||
FButtonList.Delete(Idx);
|
FButtonList.Delete(Idx);
|
||||||
AComponent.Name := ''; //otherwise we get duplicate name error in UpdateItems
|
|
||||||
Items.Delete(Idx);
|
Items.Delete(Idx);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -228,10 +228,7 @@ begin
|
|||||||
ARadioButton := TRadioButton(FButtonList[i]);
|
ARadioButton := TRadioButton(FButtonList[i]);
|
||||||
ARadioButton.Checked := (i = FItemIndex);
|
ARadioButton.Checked := (i = FItemIndex);
|
||||||
ARadioButton.Visible := true;
|
ARadioButton.Visible := true;
|
||||||
ARadioButton.Name := '';
|
|
||||||
end;
|
end;
|
||||||
for i:=0 to FButtonList.Count-1 do
|
|
||||||
TRadioButton(FButtonList[i]).Name:='RadioButton'+IntToStr(i);
|
|
||||||
|
|
||||||
//FHiddenButton must remain the last item in Controls[], so that Controls[] is in sync with Items[]
|
//FHiddenButton must remain the last item in Controls[], so that Controls[] is in sync with Items[]
|
||||||
Self.RemoveControl(FHiddenButton);
|
Self.RemoveControl(FHiddenButton);
|
||||||
@ -479,7 +476,6 @@ begin
|
|||||||
if (Idx <> -1) and (Idx < Items.Count) then
|
if (Idx <> -1) and (Idx < Items.Count) then
|
||||||
begin
|
begin
|
||||||
FButtonList.Delete(Idx);
|
FButtonList.Delete(Idx);
|
||||||
AComponent.Name := '';
|
|
||||||
Items.Delete(Idx);
|
Items.Delete(Idx);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user