-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmScrollBox.pas
77 lines (61 loc) · 1.46 KB
/
mScrollBox.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
unit mScrollBox;
interface
uses
SysUtils, Classes, Controls,
Forms, Windows, Graphics;
type
TmScrollBox = class(TScrollBox)
procedure CreateParams(var Params: TCreateParams); override;
procedure PaintWindow(DC: HDC); override;
private
FDrow: Boolean;
FCanvas: TControlCanvas;
function GetCanvas: TCanvas;
protected
public
constructor Create(AOwner:TComponent); override;
published
property _Drow : Boolean read FDrow write FDrow;
property _Canvas : TCanvas read GetCanvas;
end;
procedure Register;
implementation
uses
mControl;
function TmScrollBox.GetCanvas: TCanvas;
begin
Result := FCanvas;
end;
procedure Register;
begin
RegisterComponents('Comps MIGUEL', [TmScrollBox]);
end;
constructor TmScrollBox.Create(AOwner: TComponent);
begin
inherited;
//Brush.Style := bsClear;
FCanvas := TControlCanvas.Create();
end;
procedure TmScrollBox.CreateParams(var Params: TCreateParams);
begin
inherited;
//Params.ExStyle := Params.ExStyle or WS_EX_TRANSPARENT or WS_EX_COMPOSITED;
end;
procedure TmScrollBox.PaintWindow(DC: HDC);
var
vBitmap : TBitmap;
begin
inherited;
if not _Drow then
Exit;
// Do not remove this comment to keep transparancy
vBitmap := mControl.GetImageFundo();
FCanvas.Handle := DC;
FCanvas.Control := Self;
FCanvas.Brush.Color := clWhite;
if (vBitmap <> nil) then
FCanvas.Brush.Bitmap := vBitmap;
FCanvas.FillRect(GetClientRect);
FCanvas.Handle := 0;
end;
end.