summaryrefslogtreecommitdiff
path: root/uidesigner/tests/tabtest.pas
blob: 9355a6d29a1ac6ec53b002b047e95c9c3f2c4ec6 (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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
unit tabtest;

{$mode objfpc}{$H+}

interface

uses
  SysUtils, Classes, gfxbase, fpgfx, gui_edit, 
  gfx_widget, gui_form, gui_label, gui_button,
  gui_listbox, gui_memo, gui_combobox, gui_grid, 
  gui_dialogs, gui_checkbox, gui_tree, gui_trackbar, 
  gui_progressbar, gui_radiobutton, gui_tab, gui_menu,
  gui_bevel;

type

  TfraGeneral = class(TfpgForm)
  public
    {@VFD_HEAD_BEGIN: fraGeneral}
    lblName1: TfpgLabel;
    edtName1: TfpgEdit;
    memName1: TfpgMemo;
    btnName1: TfpgButton;
    {@VFD_HEAD_END: fraGeneral}
    procedure AfterCreate; override;
  end;


  TfraAddress = class(TfpgForm)
  public
    {@VFD_HEAD_BEGIN: fraAddress}
    edtName1: TfpgEdit;
    lblName1: TfpgLabel;
    lblName2: TfpgLabel;
    lblName3: TfpgLabel;
    cbName1: TfpgComboBox;
    {@VFD_HEAD_END: fraAddress}
    procedure AfterCreate; override;
  end;


  TfrmTabTest = class(TfpgForm)
  private
    procedure btnCloseClicked(Sender: TObject);
  public
    {@VFD_HEAD_BEGIN: frmTabTest}
    pcName1: TfpgPageControl;
    btnClose: TfpgButton;
    {@VFD_HEAD_END: frmTabTest}
    
    // these must be added manually for now, until the GUI Designer is improved.
    tsGeneral: TfpgTabSheet;
    tsAddress: TfpgTabSheet;
    tsAccounts: TfpgTabSheet;
    fraGeneral: TfraGeneral;
    fraAddress: TfraAddress;
    procedure AfterCreate; override;
  end;


{@VFD_NEWFORM_DECL}

implementation

{@VFD_NEWFORM_IMPL}

procedure TfraAddress.AfterCreate;
begin
  {@VFD_BODY_BEGIN: fraAddress}
  Name := 'fraAddress';
  SetPosition(602, 485, 208, 127);
  WindowTitle := 'fraAddress';

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

  lblName1 := TfpgLabel.Create(self);
  with lblName1 do
  begin
    Name := 'lblName1';
    SetPosition(4, 4, 156, 16);
    Text := 'TabSheet - Address';
    FontDesc := '#Label2';
  end;

  lblName2 := TfpgLabel.Create(self);
  with lblName2 do
  begin
    Name := 'lblName2';
    SetPosition(8, 36, 44, 16);
    Text := 'Street';
    FontDesc := '#Label1';
  end;

  lblName3 := TfpgLabel.Create(self);
  with lblName3 do
  begin
    Name := 'lblName3';
    SetPosition(8, 60, 48, 16);
    Text := 'City';
    FontDesc := '#Label1';
  end;

  cbName1 := TfpgComboBox.Create(self);
  with cbName1 do
  begin
    Name := 'cbName1';
    SetPosition(64, 56, 120, 23);
    Items.Add('Somerset West');
    Items.Add('Cape Town');
    Items.Add('Durban');
    Items.Add('Jo''burg');
    Items.Add('Pretoria');
    FontDesc := '#List';
    FocusItem := 1;
  end;

  {@VFD_BODY_END: fraAddress}
end;


procedure TfraGeneral.AfterCreate;
begin
  {@VFD_BODY_BEGIN: fraGeneral}
  Name := 'fraGeneral';
  SetPosition(611, 290, 197, 165);
  WindowTitle := 'fraGeneral';

  lblName1 := TfpgLabel.Create(self);
  with lblName1 do
  begin
    Name := 'lblName1';
    SetPosition(4, 4, 212, 16);
    Text := 'TabSheet - General';
    FontDesc := '#Label2';
  end;

  edtName1 := TfpgEdit.Create(self);
  with edtName1 do
  begin
    Name := 'edtName1';
    SetPosition(12, 28, 144, 22);
    Anchors := [anLeft,anRight,anTop];
    Text := '';
    FontDesc := '#Edit1';
  end;

  memName1 := TfpgMemo.Create(self);
  with memName1 do
  begin
    Name := 'memName1';
    SetPosition(12, 56, 172, 96);
    Anchors := [anLeft,anRight,anTop,anBottom];
    FontDesc := '#Edit1';
  end;

  btnName1 := TfpgButton.Create(self);
  with btnName1 do
  begin
    Name := 'btnName1';
    SetPosition(160, 28, 19, 20);
    Anchors := [anRight,anTop];
    Text := '...';
    FontDesc := '#Label1';
    ImageName := '';
    ModalResult := 0;
  end;

  {@VFD_BODY_END: fraGeneral}
end;

procedure TfrmTabTest.btnCloseClicked(Sender: TObject);
begin
  Close;
end;

procedure TfrmTabTest.AfterCreate;
begin
  {@VFD_BODY_BEGIN: frmTabTest}
  Name := 'frmTabTest';
  SetPosition(293, 290, 275, 198);
  WindowTitle := 'Tab Design Test';

  pcName1 := TfpgPageControl.Create(self);
  with pcName1 do
  begin
    Name := 'pcName1';
    SetPosition(8, 12, 258, 148);
    Anchors := [anLeft,anRight,anTop,anBottom];
    FixedTabWidth := 0;
    Style := tsTabs;
    TabPosition := tpTop;
    tsGeneral   := AppendTabSheet('General');
    tsAddress   := AppendTabSheet('Address');
    tsAccounts  := AppendTabSheet('EAddress');
    ActivePage  := tsGeneral;
  end;

  btnClose := TfpgButton.Create(self);
  with btnClose do
  begin
    Name := 'btnClose';
    SetPosition(192, 168, 75, 24);
    Anchors := [anRight,anBottom];
    Text := 'Close';
    FontDesc := '#Label1';
    ImageName := '';
    ModalResult := 0;
    OnClick := @btnCloseClicked;
  end;

  {@VFD_BODY_END: frmTabTest}

  fraGeneral := TfraGeneral.Create(tsGeneral);
  fraGeneral.Align := alClient;
  fraAddress := TfraAddress.Create(tsAddress);
  fraAddress.Align := alClient;
end;

end.