forked from fenisoft/fenixsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfsoptions.pas
More file actions
110 lines (85 loc) · 2.91 KB
/
fsoptions.pas
File metadata and controls
110 lines (85 loc) · 2.91 KB
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
(*
fenixsql
author Alessandro Batisti
http://code.google.com/p/fenixsql
http://fblib.altervista.org
File: fsoptions.pas
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*)
unit fsoptions;
{$mode objfpc}{$H+}
interface
uses
Forms, Controls, ExtCtrls,
StdCtrls, Spin, Buttons, ComCtrls;
type
{ TOptionsForm }
TOptionsForm = class(TForm)
CancelButton: TBitBtn;
OkButton: TBitBtn;
BrowserGroupBox: TCheckGroup;
SqlCheckGroup: TCheckGroup;
GroupBox1: TGroupBox;
GroupBox: TGroupBox;
Label1: TLabel;
Label2: TLabel;
PageControl1: TPageControl;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
OutputRadioGroup: TRadioGroup;
MaxFetchSplinEdit: TSpinEdit;
MaxGridRowsSpinEdit: TSpinEdit;
TabSheet1: TTabSheet;
procedure OkButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure MaxFetchSplinEditChange(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
implementation
{$R *.lfm}
uses
fsconfig;
{ TOptionsForm }
procedure TOptionsForm.FormCreate(Sender: TObject);
begin
//{$I fsunixborder.inc}
BrowserGroupBox.Checked[0] := FsConfig.SystemObjectsVisible;
SqlCheckGroup.Checked[0] := FsConfig.AutoCommitDDL;
SqlCheckGroup.Checked[1] := FsConfig.VerboseSqlScript;
SqlCheckGroup.Checked[2] := FsConfig.SetTermVisible;
MaxGridRowsSpinEdit.Value := FsConfig.MaxGridRows;
MaxFetchSplinEdit.Value := FsConfig.MaxFetchResult;
OutputRadioGroup.ItemIndex := FsConfig.OutputGridType;
end;
//------------------------------------------------------------------------------
procedure TOptionsForm.MaxFetchSplinEditChange(Sender: TObject);
begin
if MaxFetchSplinEdit.Value < 0 then
MaxFetchSplinEdit.Value := 0;
end;
//------------------------------------------------------------------------------
procedure TOptionsForm.OkButtonClick(Sender: TObject);
begin
FsConfig.SystemObjectsVisible := BrowserGroupBox.Checked[0];
FsConfig.AutoCommitDDL := SqlCheckGroup.Checked[0];
FsConfig.VerboseSqlScript := SqlCheckGroup.Checked[1];
FsConfig.SetTermVisible := SqlCheckGroup.Checked[2];
FsConfig.OutputGridType := OutputRadioGroup.ItemIndex;
FsConfig.MaxGridRows := MaxGridRowsSpinEdit.Value;
FsConfig.MaxFetchResult := MaxFetchSplinEdit.Value;
FsConfig.WriteConfigFile;
ModalResult := mrOk;
end;
end.