-
Notifications
You must be signed in to change notification settings - Fork 1
/
WispCheckBox.pas
55 lines (47 loc) · 1.24 KB
/
WispCheckBox.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
unit WispCheckBox;
interface
uses
cxCheckBox,
cxLabel,
Controls,
Classes,
WispVisualComponent,
WispStyleManager;
type
TWispCheckBox = Class(TWispVisualComponent)
private
Spacing: integer;
public
Lbl: TcxLabel;
ChkBox: TcxCheckBox;
Constructor Create(ParamOwner: TComponent; ParamParent: TWinControl;
ParamEdtWidth, ParamX, ParamY: integer; ParamCaption: String);
procedure CenterHorizontally;
End;
implementation
Constructor TWispCheckBox.Create(ParamOwner: TComponent;
ParamParent: TWinControl; ParamEdtWidth, ParamX, ParamY: integer;
ParamCaption: String);
begin
ChkBox := TcxCheckBox.Create(ParamOwner);
with ChkBox do
begin
Width := ParamEdtWidth;
Height := 32;
Parent := ParamParent;
ParentFont := FALSE;
Caption := ParamCaption;
Left := ParamX;
Top := ParamY + Spacing;
Transparent := TRUE;
Style.TextColor := Global_Singleton_Style.TextColor;
Style.Font.Name := Global_Singleton_Style.DefaultFont;
end;
end;
procedure TWispCheckBox.CenterHorizontally;
Var TmpInt : integer;
begin
TmpInt := Round((ChkBox.Parent.Width - ChkBox.Width)/2);
ChkBox.Left := TmpInt;
end;
end.