Line | |
---|
1 | unit unice;
|
---|
2 |
|
---|
3 | {$mode objfpc}{$H+}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
---|
9 | BGRAImageButton;
|
---|
10 |
|
---|
11 | type
|
---|
12 |
|
---|
13 | { TfrmNice }
|
---|
14 |
|
---|
15 | TfrmNice = class(TForm)
|
---|
16 | btn3: TBGRAImageButton;
|
---|
17 | btn4: TBGRAImageButton;
|
---|
18 | btn5: TBGRAImageButton;
|
---|
19 | btn6: TBGRAImageButton;
|
---|
20 | btn7: TBGRAImageButton;
|
---|
21 | btn8: TBGRAImageButton;
|
---|
22 | btn9: TBGRAImageButton;
|
---|
23 | btn10: TBGRAImageButton;
|
---|
24 | btn1: TBGRAImageButton;
|
---|
25 | btn2: TBGRAImageButton;
|
---|
26 | procedure FormCreate(Sender: TObject);
|
---|
27 | procedure FormResize(Sender: TObject);
|
---|
28 | private
|
---|
29 | { private declarations }
|
---|
30 | public
|
---|
31 | { public declarations }
|
---|
32 | end;
|
---|
33 |
|
---|
34 | var
|
---|
35 | frmNice: TfrmNice;
|
---|
36 |
|
---|
37 | implementation
|
---|
38 |
|
---|
39 | uses
|
---|
40 | bgrasamples;
|
---|
41 |
|
---|
42 | {$R *.lfm}
|
---|
43 |
|
---|
44 | { TfrmNice }
|
---|
45 |
|
---|
46 | procedure TfrmNice.FormCreate(Sender: TObject);
|
---|
47 | begin
|
---|
48 | // This call AccentColorImageButton for each TBGRAImageButton in the form
|
---|
49 | // using the TBGRAImageButton.Color property as parameter.
|
---|
50 | AccentColorImageButtonAll(Self);
|
---|
51 | end;
|
---|
52 |
|
---|
53 | procedure TfrmNice.FormResize(Sender: TObject);
|
---|
54 | var
|
---|
55 | i: integer;
|
---|
56 | begin
|
---|
57 | // This set the Font.Height property for each TBGRAImageButton in the form
|
---|
58 | // when the form is resized to be 1/3 of the button height.
|
---|
59 | for i := 0 to Self.ControlCount - 1 do
|
---|
60 | if Self.Controls[i] is TBGRAImageButton then
|
---|
61 | Self.Controls[i].Font.Height := Trunc(Self.Controls[i].Height div 3);
|
---|
62 | end;
|
---|
63 |
|
---|
64 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.