function TdhStickyButton.GetChecked: Boolean;
begin
Result := Down;
end;
procedure TdhStickyButton.SetChecked(Value: Boolean);
begin
Down := Value;
end;
The declaration section now becomes:
type
TdhStickyButton = class(TButton)
private
FDDown: Boolean;
FJustKilledWhenDown: Boolean;
procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS;
procedure CNCommand(var Message: TWMCommand); message CN_COMMAND;
procedure SetDownState(Value: Boolean);
protected
function GetChecked: Boolean; override;
procedure SetChecked(Value: Boolean); override;
public
constructor Create(AOwner: TComponent); override;
published
property Down: Boolean read FDDown write SetDownState default false;
end;
No comments:
Post a Comment