source: trunk/Packages/bgracontrols/testbgracontrols/unice.pas

Last change on this file was 2, checked in by chronos, 5 years ago
File size: 1.3 KB
Line 
1unit unice;
2
3{$mode objfpc}{$H+}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
9 BGRAImageButton;
10
11type
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
34var
35 frmNice: TfrmNice;
36
37implementation
38
39uses
40 bgrasamples;
41
42{$R *.lfm}
43
44{ TfrmNice }
45
46procedure TfrmNice.FormCreate(Sender: TObject);
47begin
48 // This call AccentColorImageButton for each TBGRAImageButton in the form
49 // using the TBGRAImageButton.Color property as parameter.
50 AccentColorImageButtonAll(Self);
51end;
52
53procedure TfrmNice.FormResize(Sender: TObject);
54var
55 i: integer;
56begin
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);
62end;
63
64end.
Note: See TracBrowser for help on using the repository browser.