mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 00:54:03 +02:00
LCL: check box: call OnChange/OnClick notify events on State change. Issue #33076
git-svn-id: trunk@57155 -
This commit is contained in:
parent
96d01f3f8f
commit
de8a470231
@ -24,11 +24,21 @@
|
|||||||
Set new state of the checkbox.
|
Set new state of the checkbox.
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomCheckBox.SetState(Value: TCheckBoxState);
|
procedure TCustomCheckBox.SetState(Value: TCheckBoxState);
|
||||||
|
var
|
||||||
|
OldState: TCheckBoxState;
|
||||||
begin
|
begin
|
||||||
if FState <> Value then
|
if FState <> Value then
|
||||||
begin
|
begin
|
||||||
|
OldState := FState;
|
||||||
FState := Value;
|
FState := Value;
|
||||||
|
if Action is TCustomAction then
|
||||||
|
TCustomAction(Action).Checked := FState = cbChecked;
|
||||||
ApplyChanges;
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user