ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JDesigner/uSetup.pas
Revision: 1.1.1.1 (vendor branch)
Committed: Mon Dec 10 19:29:13 2001 UTC (14 years, 7 months ago) by hsauro
Branch: MAIN, hsauro
CVS Tags: V10, HEAD_NEW, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
no message

Line File contents
1 unit uSetup;
2
3 interface
4
5 uses Forms, IniFiles, SysUtils;
6
7 var
8 DefaultWindowTop : integer = -1 ; // -1 means use max window Top
9 DefaultWindowLeft : integer = -1 ; // -1 means use max window Left
10 DefaultWindowHeight : integer = -1; // -1 means use max window height
11 DefaultWindowWidth : integer = -1 ; // -1 means use max window width
12 DefaultPathToData : string = '.';
13
14 StoichGridVisible : boolean = False;
15 StoichGridWidth : integer = 229;
16
17
18 procedure LoadIniFile;
19 procedure SaveIniFile (frm : TForm);
20
21 implementation
22
23 Uses ufJDesigner;
24
25 procedure SaveIniFile (frm : TForm);
26 var IniFile : TIniFile; str : string;
27 MyTop, MyLeft : integer;
28 begin
29 str := ExtractFilePath (Application.ExeName) + 'jdesigner.ini';
30 DeleteFile (str);
31 IniFile := TIniFile.Create (str);
32 IniFile.WriteString('Environment', 'SearchPath', DefaultPathToData);
33 SetCurrentDir (DefaultPathToData);
34 MyTop := frm.Top; if frm.Top < -1 then MyTop := 0;
35 MyLeft := frm.Left; if frm.Left < -1 then MyLeft := 0;
36 IniFile.WriteInteger('VisualSetup', 'WindowTop', MyTop);
37 IniFile.WriteInteger('VisualSetup', 'WindowLeft', MyLeft);
38 IniFile.WriteInteger('VisualSetup', 'WindowHeight', frm.Height);
39 IniFile.WriteInteger('VisualSetup', 'WindowWidth', frm.Width);
40 IniFile.WriteBool ('VisualSetup', 'StoichGridVisible', (frm as TfrmNetworkEd).StoichGridVisible);
41 IniFile.WriteInteger ('VisualSetup', 'StoichGridWidth', (frm as TfrmNetworkEd).StoichGridWidth);
42
43 IniFile.Free;
44 end;
45
46
47 procedure LoadIniFile;
48 var IniFile : TIniFile; str : string; AppPath : string;
49 begin
50 AppPath := ExtractFilePath (Application.ExeName);
51 str := AppPath + 'jdesigner.ini';
52 if FileExists (str) then
53 begin
54 IniFile := TIniFile.Create(str);
55 IniFile.ReadString('Environment', 'SearchPath', DefaultPathToData);
56
57 DefaultWindowTop := IniFile.ReadInteger('VisualSetup', 'WindowTop', DefaultWindowTop);
58 DefaultWindowLeft := IniFile.ReadInteger('VisualSetup', 'WindowLeft', DefaultWindowLeft);
59 DefaultWindowHeight := IniFile.ReadInteger('VisualSetup', 'WindowHeight', DefaultWindowHeight);
60 DefaultWindowWidth := IniFile.ReadInteger('VisualSetup', 'WindowWidth', DefaultWindowWidth);
61
62 StoichGridVisible := IniFile.ReadBool ('VisualSetup', 'StoichGridVisible', False);
63 StoichGridWidth := IniFile.ReadInteger ('VisualSetup', 'StoichGridWidth', 229);
64
65 IniFile.Free;
66 end
67 else
68 begin
69 // Setup defaults if there is no ini file
70
71 //SysObj_SetPath (AppPath + DefaultPathToScripts);
72 //SysObj_SetModulePath (AppPath);
73 end;
74 end;
75
76
77 end.