mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 14:09:16 +02:00
lcl: uncheck radiobutton siblings when handle not allocated, bug #17281
git-svn-id: trunk@27208 -
This commit is contained in:
parent
c9c3967f42
commit
bb7a0731ed
@ -96,6 +96,26 @@ begin
|
|||||||
RegisterRadioButton;
|
RegisterRadioButton;
|
||||||
end;
|
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;
|
function TRadioButton.DialogChar(var Message: TLMKey): boolean;
|
||||||
begin
|
begin
|
||||||
if IsAccel(Message.CharCode, Caption) and CanFocus then
|
if IsAccel(Message.CharCode, Caption) and CanFocus then
|
||||||
|
@ -1315,6 +1315,7 @@ type
|
|||||||
TRadioButton = class(TCustomCheckBox)
|
TRadioButton = class(TCustomCheckBox)
|
||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
|
procedure ApplyChanges; override;
|
||||||
function DialogChar(var Message: TLMKey): boolean; override;
|
function DialogChar(var Message: TLMKey): boolean; override;
|
||||||
procedure RealSetText(const Value: TCaption); override;
|
procedure RealSetText(const Value: TCaption); override;
|
||||||
procedure DoClickOnChange; override;
|
procedure DoClickOnChange; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user