1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| unit myBitBtn;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, {Tlabel}
math {max}
;
type
TmyBitBtn = class(TCustomControl)
private
{ Private declarations }
FCaption : String;
protected
{ Protected declarations }
procedure SetCaption(const Value: String);
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
property Caption : String read FCaption write SetCaption;
end;
implementation
constructor TmyBitBtn.Create(AOwner: TComponent);
begin
Inherited Create(AOwner);
FCaption := Name;
Showmessage(Name)
end;
procedure TmyBitBtn.SetCaption(const Value : String);
begin
if value <> FCaption then begin
FCaption := Value;
end;
end; |
Partager