lcl: uncheck radiobutton siblings when handle not allocated, bug #17281

git-svn-id: trunk@27208 -
This commit is contained in:
blikblum 2010-08-27 01:48:32 +00:00
parent c9c3967f42
commit bb7a0731ed
2 changed files with 21 additions and 0 deletions

View File

@ -96,6 +96,26 @@ begin
RegisterRadioButton;
end;
procedure TRadioButton.ApplyChanges;
var
Sibling: TControl;
i: Integer;
begin
inherited ApplyChanges;
//the siblings are unchecked by the widgetset. When the handle is not allocated,
//the widgetset is not notified so it cannot update the siblings
if not HandleAllocated and (FState = cbChecked) and
(not (csLoading in ComponentState)) then
begin
for i := 0 to Parent.ControlCount - 1 do
begin
Sibling := Parent.Controls[i];
if (Sibling is TRadioButton) and (Sibling <> Self) then
TRadioButton(Sibling).Checked := False;
end;
end;
end;
function TRadioButton.DialogChar(var Message: TLMKey): boolean;
begin
if IsAccel(Message.CharCode, Caption) and CanFocus then

View File

@ -1315,6 +1315,7 @@ type
TRadioButton = class(TCustomCheckBox)
protected
class procedure WSRegisterClass; override;
procedure ApplyChanges; override;
function DialogChar(var Message: TLMKey): boolean; override;
procedure RealSetText(const Value: TCaption); override;
procedure DoClickOnChange; override;