summaryrefslogtreecommitdiff
path: root/examples/gui/customstyles/frm_test.pas
blob: bb429a3328f83f8c7ea7d4faf0491ab3e018d219 (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
unit frm_test;

{$mode objfpc}{$H+}

interface

uses
  SysUtils, Classes, fpg_base, fpg_main, fpg_widget,
  fpg_edit, fpg_form, fpg_label, fpg_button,
  fpg_listbox, fpg_memo, fpg_combobox, fpg_basegrid, fpg_grid, 
  fpg_dialogs, fpg_checkbox, fpg_tree, fpg_trackbar, 
  fpg_progressbar, fpg_radiobutton, fpg_tab, fpg_menu,
  fpg_panel, fpg_popupcalendar, fpg_gauge;

type

  TTestForm = class(TfpgForm)
  private
    {@VFD_HEAD_BEGIN: TestForm}
    btnName1: TfpgButton;
    lblName1: TfpgLabel;
    lblName2: TfpgLabel;
    btnName2: TfpgButton;
    lblName3: TfpgLabel;
    btnName3: TfpgButton;
    lblName4: TfpgLabel;
    btnName4: TfpgButton;
    edtName1: TfpgEdit;
    btnClose: TfpgButton;
    {@VFD_HEAD_END: TestForm}
    procedure CloseClicked(Sender: TObject);
  public
    procedure AfterCreate; override;
  end;

{@VFD_NEWFORM_DECL}

implementation

{@VFD_NEWFORM_IMPL}

procedure TTestForm.CloseClicked(Sender: TObject);
begin
  Close;
end;

procedure TTestForm.AfterCreate;
begin
  {@VFD_BODY_BEGIN: TestForm}
  Name := 'TestForm';
  SetPosition(335, 206, 300, 250);
  WindowTitle := 'Testing Custom Styles';
  WindowPosition := wpScreenCenter;

  btnName1 := TfpgButton.Create(self);
  with btnName1 do
  begin
    Name := 'btnName1';
    SetPosition(24, 48, 80, 24);
    Text := 'Button1';
    FontDesc := '#Label1';
    Hint := '';
    ImageName := '';
    TabOrder := 1;
  end;

  lblName1 := TfpgLabel.Create(self);
  with lblName1 do
  begin
    Name := 'lblName1';
    SetPosition(20, 24, 116, 16);
    FontDesc := '#Label2';
    Hint := '';
    Text := 'Standard Button';
  end;

  lblName2 := TfpgLabel.Create(self);
  with lblName2 do
  begin
    Name := 'lblName2';
    SetPosition(164, 24, 124, 16);
    FontDesc := '#Label2';
    Hint := '';
    Text := 'Embedded Button';
  end;

  btnName2 := TfpgButton.Create(self);
  with btnName2 do
  begin
    Name := 'btnName2';
    SetPosition(176, 48, 80, 24);
    Text := 'Button2';
    Embedded := True;
    FontDesc := '#Label1';
    Hint := '';
    ImageName := '';
    TabOrder := 2;
  end;

  lblName3 := TfpgLabel.Create(self);
  with lblName3 do
  begin
    Name := 'lblName3';
    SetPosition(20, 92, 100, 16);
    FontDesc := '#Label2';
    Hint := '';
    Text := 'Default Button';
  end;

  btnName3 := TfpgButton.Create(self);
  with btnName3 do
  begin
    Name := 'btnName3';
    SetPosition(24, 116, 80, 24);
    Text := 'Button3';
    FontDesc := '#Label1';
    Hint := '';
    ImageName := '';
    TabOrder := 3;
    Default := True;
  end;

  lblName4 := TfpgLabel.Create(self);
  with lblName4 do
  begin
    Name := 'lblName4';
    SetPosition(164, 92, 116, 16);
    FontDesc := '#Label2';
    Hint := '';
    Text := 'Flat Button';
  end;

  btnName4 := TfpgButton.Create(self);
  with btnName4 do
  begin
    Name := 'btnName4';
    SetPosition(176, 116, 80, 24);
    Text := 'Button4';
    Flat := True;
    FontDesc := '#Label1';
    Hint := '';
    ImageName := '';
    TabOrder := 4;
  end;

  edtName1 := TfpgEdit.Create(self);
  with edtName1 do
  begin
    Name := 'edtName1';
    SetPosition(24, 168, 120, 22);
    TabOrder := 5;
    Text := '';
    FontDesc := '#Edit1';
  end;

  btnClose := TfpgButton.Create(self);
  with btnClose do
  begin
    Name := 'btnClose';
    SetPosition(212, 216, 80, 24);
    Text := 'Close';
    FontDesc := '#Label1';
    Hint := '';
    ImageName := 'stdimg.close';
    TabOrder := 6;
    OnClick := @CloseClicked;
  end;

  {@VFD_BODY_END: TestForm}
end;



end.