1 | {
|
---|
2 | READ BGRANeoButton.pas unit before using!
|
---|
3 | }
|
---|
4 |
|
---|
5 | unit utestbgraneobutton;
|
---|
6 |
|
---|
7 | {$mode objfpc}{$H+}
|
---|
8 |
|
---|
9 | interface
|
---|
10 |
|
---|
11 | uses
|
---|
12 | Forms, Graphics, BGRANeoButton;
|
---|
13 |
|
---|
14 | procedure Windows7StyleButton(AButton: TBGRANeoButton);
|
---|
15 |
|
---|
16 | type
|
---|
17 |
|
---|
18 | { TForm1 }
|
---|
19 |
|
---|
20 | TForm1 = class(TForm)
|
---|
21 | BGRANeoButton1: TBGRANeoButton;
|
---|
22 | BGRANeoButton2: TBGRANeoButton;
|
---|
23 | procedure FormCreate(Sender: TObject);
|
---|
24 | private
|
---|
25 | { private declarations }
|
---|
26 | public
|
---|
27 | { public declarations }
|
---|
28 | end;
|
---|
29 |
|
---|
30 | var
|
---|
31 | Form1: TForm1;
|
---|
32 |
|
---|
33 | implementation
|
---|
34 |
|
---|
35 | procedure Windows7StyleButton(AButton: TBGRANeoButton);
|
---|
36 | begin
|
---|
37 |
|
---|
38 | { Common }
|
---|
39 | with AButton.StyleNormal do
|
---|
40 | begin
|
---|
41 | Border.RoundX := 3;
|
---|
42 | Border.RoundY := 3;
|
---|
43 | Border.OuterWidth := 1;
|
---|
44 | Border.InnerColorAlpha := 175;
|
---|
45 | Border.InnerWidth := 1;
|
---|
46 | Text.Font.Height := 20;
|
---|
47 | Text.Font.Color := clBlack;
|
---|
48 | Shadow.OffsetX := 1;
|
---|
49 | Shadow.OffsetY := 1;
|
---|
50 | Shadow.Radius := 1;
|
---|
51 | end;
|
---|
52 |
|
---|
53 | AButton.StyleHover.Assign(AButton.StyleNormal);
|
---|
54 | AButton.StyleActive.Assign(AButton.StyleNormal);
|
---|
55 | AButton.StyleDisabled.Assign(AButton.StyleNormal);
|
---|
56 |
|
---|
57 | with AButton.StyleNormal do
|
---|
58 | begin
|
---|
59 | Border.OuterColor := RGBToColor(112, 112, 112);
|
---|
60 | Gradient1.Color1 := RGBToColor(242, 242, 242);
|
---|
61 | Gradient1.Color2 := RGBToColor(235, 235, 235);
|
---|
62 | Gradient2.Color1 := RGBToColor(221, 221, 221);
|
---|
63 | Gradient2.Color2 := RGBToColor(207, 207, 207);
|
---|
64 | end;
|
---|
65 |
|
---|
66 | with AButton.StyleHover do
|
---|
67 | begin
|
---|
68 | Border.OuterColor := RGBToColor(60, 127, 177);
|
---|
69 | Gradient1.Color1 := RGBToColor(234, 246, 253);
|
---|
70 | Gradient1.Color2 := RGBToColor(217, 240, 252);
|
---|
71 | Gradient2.Color1 := RGBToColor(190, 230, 253);
|
---|
72 | Gradient2.Color2 := RGBToColor(167, 217, 245);
|
---|
73 | end;
|
---|
74 |
|
---|
75 | with AButton.StyleActive do
|
---|
76 | begin
|
---|
77 | Border.OuterColor := RGBToColor(44, 98, 139);
|
---|
78 | Border.InnerColorAlpha := 100;
|
---|
79 | Gradient1.Color1 := RGBToColor(229, 244, 252);
|
---|
80 | Gradient1.Color2 := RGBToColor(196, 229, 246);
|
---|
81 | Gradient2.Color1 := RGBToColor(152, 209, 239);
|
---|
82 | Gradient2.Color2 := RGBToColor(104, 179, 219);
|
---|
83 | GradientPosition := 0.55;
|
---|
84 | end;
|
---|
85 |
|
---|
86 | with AButton.StyleDisabled do
|
---|
87 | begin
|
---|
88 | Border.OuterColor := RGBToColor(173, 178, 181);
|
---|
89 | Gradient1.Color1 := RGBToColor(244, 244, 244);
|
---|
90 | Gradient1.Color2 := RGBToColor(244, 244, 244);
|
---|
91 | Gradient2.Color1 := RGBToColor(244, 244, 244);
|
---|
92 | Gradient2.Color2 := RGBToColor(244, 244, 244);
|
---|
93 | Text.Font.Color := $006D6D6D;
|
---|
94 | end;
|
---|
95 |
|
---|
96 | end;
|
---|
97 |
|
---|
98 | {$R *.lfm}
|
---|
99 |
|
---|
100 | { TForm1 }
|
---|
101 |
|
---|
102 | procedure TForm1.FormCreate(Sender: TObject);
|
---|
103 | begin
|
---|
104 | Windows7StyleButton(BGRANeoButton1);
|
---|
105 | Windows7StyleButton(BGRANeoButton2);
|
---|
106 | end;
|
---|
107 |
|
---|
108 | end.
|
---|
109 |
|
---|