PageRenderTime 23ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/Source/FR_IFLDS.PAS

http://github.com/FastReports/FreeReport
Pascal | 99 lines | 66 code | 16 blank | 17 comment | 2 complexity | b2afc156b91031c0a3966c6886dbddbf MD5 | raw file
 1
 2{*****************************************}
 3{                                         }
 4{             FastReport v2.3             }
 5{          Insert fields dialog           }
 6{                                         }
 7{  Copyright (c) 1998-99 by Tzyganenko A. }
 8{                                         }
 9{*****************************************}
10
11unit FR_IFlds;
12
13interface
14
15{$I FR.inc}
16
17uses
18  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
19  StdCtrls, FR_DBRel;
20
21type
22  TfrInsertFieldsForm = class(TForm)
23    FieldsL: TListBox;
24    DatasetCB: TComboBox;
25    Label1: TLabel;
26    GroupBox1: TGroupBox;
27    HorzRB: TRadioButton;
28    VertRB: TRadioButton;
29    Button1: TButton;
30    Button2: TButton;
31    GroupBox2: TGroupBox;
32    HeaderCB: TCheckBox;
33    BandCB: TCheckBox;
34    procedure DatasetCBChange(Sender: TObject);
35    procedure FormShow(Sender: TObject);
36    procedure FormCreate(Sender: TObject);
37  private
38    { Private declarations }
39    procedure GetFields;
40  public
41    { Public declarations }
42    DataSet: TfrTDataSet;
43  end;
44
45var
46  frInsertFieldsForm: TfrInsertFieldsForm;
47
48implementation
49
50uses FR_Class, FR_Const, FR_Utils
51{$IFDEF IBO}
52  , IB_Components
53{$ELSE}
54  , DB
55{$ENDIF};
56
57{$R *.DFM}
58
59procedure TfrInsertFieldsForm.FormShow(Sender: TObject);
60begin
61  DataSet := nil;
62{$IFDEF IBO}
63  frGetComponents(CurReport.Owner, TIB_DataSet, DatasetCB.Items, nil);
64{$ELSE}
65  frGetComponents(CurReport.Owner, TDataSet, DatasetCB.Items, nil);
66{$ENDIF}
67  if DatasetCB.Items.Count > 0 then
68    DatasetCB.ItemIndex := 0;
69  GetFields;
70end;
71
72procedure TfrInsertFieldsForm.DatasetCBChange(Sender: TObject);
73begin
74  GetFields;
75end;
76
77procedure TfrInsertFieldsForm.GetFields;
78begin
79  FieldsL.Items.Clear;
80  DataSet := frGetDataSet(DatasetCB.Items[DatasetCB.ItemIndex]);
81  if DataSet <> nil then
82    frGetFieldNames(DataSet, FieldsL.Items);
83end;
84
85procedure TfrInsertFieldsForm.FormCreate(Sender: TObject);
86begin
87  Caption := LoadStr(frRes + 630);
88  Label1.Caption := LoadStr(frRes + 631);
89  GroupBox1.Caption := LoadStr(frRes + 632);
90  HorzRB.Caption := LoadStr(frRes + 633);
91  VertRB.Caption := LoadStr(frRes + 634);
92  HeaderCB.Caption := LoadStr(frRes + 635);
93  BandCB.Caption := LoadStr(frRes + 636);
94  Button1.Caption := LoadStr(SOk);
95  Button2.Caption := LoadStr(SCancel);
96end;
97
98end.
99