forked from 1-berto/SpkControls
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpkCards.inc
More file actions
99 lines (82 loc) · 2.03 KB
/
Copy pathSpkCards.inc
File metadata and controls
99 lines (82 loc) · 2.03 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{%MainUnit SpkCtrls.pp}
(*
TCustomSpkCard
*)
(*
PROTECTED
*)
procedure TCustomSpkCard.DoDraw(const ABuffer: TBitmap);
var
BgFromColor, BgToColor, CaptionColor: TColor;
FontColor, BorderLightColor, BorderDarkColor: TColor;
R: T2DIntRect;
ClipRect: T2DIntRect;
Bk: TBackgroundKind;
begin
if (FToolbar = nil) then
Exit;
with FToolbar do
begin
BgFromColor := Appearance.Pane.GradientFromColor;
BgToColor := Appearance.Pane.GradientToColor;
CaptionColor := Appearance.Pane.CaptionBgColor;
FontColor := Appearance.Pane.CaptionFont.Color;
BorderLightColor := Appearance.Pane.BorderLightColor;
BorderDarkColor := Appearance.Pane.BorderDarkColor;
end;
{$IFDEF EnhancedRecordSupport}
R := T2DIntRect.Create(
{$ELSE}
R := Create2DIntRect(
{$ENDIF}
FRect.Left,
FRect.Top,
FRect.Right - PaneBorderHalfSize,
FRect.Bottom - PaneBorderHalfSize
);
ClipRect := FRect;
if FConcave then
Bk := bkConcave
else
Bk := bkVerticalGradient;
TGuiTools.DrawRoundRect(
ABuffer.Canvas,
R,
PaneCornerRadius,
BgFromColor,
BgToColor,
Bk,
ClipRect
);
TSpkCtrlsAux.DrawStyledBorder(FRect, ABuffer, FBorder, PaneCornerRadius, BorderDarkColor, BorderLightColor);
end;
procedure TCustomSpkCard.SetConcave(AValue: Boolean);
begin
FConcave := AValue;
Self.UpdateAppearance();
end;
procedure TCustomSpkCard.SetBorder(AValue: TSpkStyledBorder);
begin
FBorder := AValue;
Self.UpdateAppearance();
end;
procedure TCustomSpkCard.SetToolbar(const AValue: TSpkToolbar);
begin
inherited SetToolbar(AValue);
if (FToolbar <> nil) then
case FToolbar.Appearance.Pane.Style of
psDividerEtched, psDividerFlat, psDividerRaised: SetBorder(sbNone);
psRectangleEtched: SetBorder(sbEtched);
psRectangleFlat: SetBorder(sbFlat);
psRectangleRaised: SetBorder(sbRaised);
end;
end;
(*
PUBLIC
*)
constructor TCustomSpkCard.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FConcave := True;
FBorder := sbEtched;
end;