Commit de8a4702 authored by ondrej's avatar ondrej
Browse files

LCL: check box: call OnChange/OnClick notify events on State change. Issue #33076

git-svn-id: trunk@57155 -
parent 96d01f3f
......@@ -24,11 +24,21 @@
Set new state of the checkbox.
------------------------------------------------------------------------------}
procedure TCustomCheckBox.SetState(Value: TCheckBoxState);
var
OldState: TCheckBoxState;
begin
if FState <> Value then
begin
OldState := FState;
FState := Value;
if Action is TCustomAction then
TCustomAction(Action).Checked := FState = cbChecked;
ApplyChanges;
//some widgetsets (gtk*) does not allow to uncheck a radio button
//only call OnChange if effectivelly changed
FState := RetrieveState;
if FState <> OldState then
DoClickOnChange;
end;
end;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment