-
Notifications
You must be signed in to change notification settings - Fork 0
/
SeparateFr.pas
81 lines (66 loc) · 2.19 KB
/
SeparateFr.pas
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
unit SeparateFr;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, DynamicSkinForm, Vcl.StdCtrls,
SkinCtrls, Vcl.Mask, SkinBoxCtrls, spSkinShellCtrls;
type
TfrmSeparate = class(TForm)
btnSave: TspSkinButton;
btnCancel: TspSkinButton;
spSkinPanel1: TspSkinPanel;
spDynamicSkinForm1: TspDynamicSkinForm;
spSkinStdLabel1: TspSkinStdLabel;
spSkinFileEdit1: TspSkinFileEdit;
spSkinStdLabel2: TspSkinStdLabel;
spSkinFileEdit2: TspSkinFileEdit;
spSkinStdLabel3: TspSkinStdLabel;
spSkinDirectoryEdit1: TspSkinDirectoryEdit;
spSkinSaveDialog1: TspSkinSaveDialog;
procedure FormCreate(Sender: TObject);
procedure spSkinFileEdit1Change(Sender: TObject);
procedure spSkinFileEdit2Change(Sender: TObject);
procedure spSkinDirectoryEdit1Change(Sender: TObject);
private
{ Private declarations }
function SaveEnabled : boolean;
public
{ Public declarations }
end;
var
frmSeparate: TfrmSeparate;
implementation
{$R *.dfm}
uses MainFr, ModDataFr;
procedure TfrmSeparate.FormCreate(Sender: TObject);
begin
//
spSkinFileEdit1.OD.Title := 'Select Incomplete Weather File';
spSkinFileEdit2.OD.Title := 'Select First File from Historical Weather Files';
spSkinFileEdit2.OD.InitialDir := HistoricWthFolder;
spSkinDirectoryEdit1.SD.DialogWidth := 380;
spSkinDirectoryEdit1.SD.DialogHeight := 380;
spSkinDirectoryEdit1.SD.Title := 'Select Folder for Predicted Weather File';
spSkinDirectoryEdit1.SD.Directory := PredictedWtgFolder;
end;
function TfrmSeparate.SaveEnabled : boolean;
begin
Result := false;
if (UpperCase(ExtractFileExt(spSkinFileEdit1.Text)) = '.WTH') and
(UpperCase(ExtractFileExt(spSkinFileEdit2.Text)) = '.WTH') and
(spSkinDirectoryEdit1.Text <> '') then
Result := true;
end;
procedure TfrmSeparate.spSkinDirectoryEdit1Change(Sender: TObject);
begin
btnSave.Enabled := SaveEnabled;
end;
procedure TfrmSeparate.spSkinFileEdit1Change(Sender: TObject);
begin
btnSave.Enabled := SaveEnabled;
end;
procedure TfrmSeparate.spSkinFileEdit2Change(Sender: TObject);
begin
btnSave.Enabled := SaveEnabled;
end;
end.