-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmCheckBox.pas
58 lines (46 loc) · 1.17 KB
/
mCheckBox.pas
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
unit mCheckBox;
interface
uses
SysUtils, Classes, Controls, StdCtrls, StrUtils;
type
TmCheckBox = class(TCheckBox)
private
FEntidade : TCollectionItem;
FCampo : String;
function GetValue: String;
procedure SetValue(const Value: String);
public
constructor create(AOwner: TComponent); overload; override;
constructor create(AOwner : TComponent; AParent : TWinControl); overload;
published
property _Entidade : TCollectionItem read FEntidade write FEntidade;
property _Campo : String read FCampo write FCampo;
property _Value : String read GetValue write SetValue;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Comps MIGUEL', [TmCheckBox]);
end;
function TmCheckBox.GetValue: String;
begin
Result := IfThen(Checked, 'T', 'F');
end;
procedure TmCheckBox.SetValue(const Value: String);
begin
Checked := (Value = 'T');
end;
{ TmCheckBox }
constructor TmCheckBox.create(AOwner: TComponent);
begin
inherited;
Font.Size := 16;
Caption := ' ';
end;
constructor TmCheckBox.create(AOwner: TComponent; AParent: TWinControl);
begin
create(AOwner);
Parent := AParent;
end;
end.