-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSpkSplitter.inc
More file actions
67 lines (59 loc) · 1.58 KB
/
SpkSplitter.inc
File metadata and controls
67 lines (59 loc) · 1.58 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
{%MainUnit SpkCtrls.pp}
(*
TCustomSpkSplitter
*)
(*
PROTECTED
*)
procedure TCustomSpkSplitter.SetToolbar(const AValue: TSpkToolbar);
begin
FToolbar := AValue;
Repaint();
end;
(*
PRIVATE
*)
procedure TCustomSpkSplitter.SpkPaintEvent(Sender: TObject);
var
I: Integer;
Clip: T2DIntRect;
begin
if (FToolbar = nil) then
Exit;
{$IFDEF EnhancedRecordSupport}
Clip := T2DIntRect.Create(0, 0, Width, Height);
{$ELSE}
Clip.Create(0, 0, Width, Height);
{$ENDIF}
Canvas.Brush.Color := FToolbar.Appearance.Pane.CaptionBgColor;
Canvas.FillRect(Self.GetClientRect());
if (Self.Cursor = crHSplit) then
begin
I := (Self.Height - PaneRowHeight) div 2;
TGUITools.DrawVLine(Canvas, 2, I, I+PaneRowHeight, FToolbar.Appearance.Pane.BorderDarkColor, Clip);
TGUITools.DrawVLine(Canvas, 5, I, I+ PaneRowHeight, FToolbar.Appearance.Pane.BorderDarkColor, Clip);
end
else
if (Self.Cursor = crVSplit) then
begin
I := (Self.Width - PaneRowHeight) div 2;
TGUITools.DrawHLine(Canvas, I, I+PaneRowHeight, 2, FToolbar.Appearance.Pane.BorderDarkColor, Clip);
TGUITools.DrawHLine(Canvas, I, I+PaneRowHeight, 5, FToolbar.Appearance.Pane.BorderDarkColor, Clip);
end;
end;
(*
PUBLIC
*)
constructor TCustomSpkSplitter.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FToolbar := nil;
OnPaint := @SpkPaintEvent;
Color := SPKCTRLS_TRANSPARENT_COLOR;
Constraints.MinWidth := (PaneRowHeight div 3) +1;
Constraints.MinHeight:= (PaneRowHeight div 3) +1;
end;
procedure TCustomSpkSplitter.ReDraw();
begin
Invalidate;
end;