1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00
Files
winscp/source/packages/my/GrayedCheckBox.pas
Martin Prikryl 1abb25b42b 5.2.3
2018-01-11 15:31:16 +01:00

40 lines
611 B
ObjectPascal

unit GrayedCheckBox;
interface
uses
StdCtrls;
type
TGrayedCheckBox = class(TCheckBox)
protected
procedure Toggle; override;
end;
procedure Register;
implementation
uses
Classes, Windows, SysUtils;
procedure Register;
begin
RegisterComponents('Martin', [TGrayedCheckBox]);
end;
{ TGrayedCheckBox }
procedure TGrayedCheckBox.Toggle;
begin
case State of
cbUnchecked: State := cbChecked;
cbChecked:
if AllowGrayed then State := cbGrayed else State := cbUnchecked;
cbGrayed: State := cbUnchecked;
end;
end;
initialization
end.