mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
40 lines
611 B
ObjectPascal
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.
|