-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripture.pas
557 lines (514 loc) · 18.3 KB
/
scripture.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
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
unit Scripture;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons, LCLType, ComCtrls, Character;
type
{ TScriptureForm }
TScriptureForm = class(TForm)
BShowAll: TButton;
BScripLoad: TButton;
BScripSave: TButton;
CBPrimaryBible: TComboBox;
CBSecondaryBible: TComboBox;
CBVerseNL: TCheckBox;
CBTertiaryBible: TComboBox;
EGap: TEdit;
LbTertiary: TLabel;
LGap: TLabel;
LbSplit: TLabel;
LbSecondary: TLabel;
LbPrimary: TLabel;
LBChapter2: TListBox;
LBVerse2: TListBox;
LBScrip: TListBox;
LVerse: TLabel;
RBHoriz: TRadioButton;
RBVert: TRadioButton;
ScriptureShow: TButton;
LChapter: TLabel;
LBook: TLabel;
LBBook: TListBox;
LBChapter: TListBox;
LBVerse: TListBox;
SBAddScrip: TSpeedButton;
SBDelScrip: TSpeedButton;
SBScripUp: TSpeedButton;
SBScripDown: TSpeedButton;
SBBlank: TSpeedButton;
TBSplit: TTrackBar;
procedure AddScripClick(Sender: TObject);
procedure BScripLoadClick(Sender: TObject);
procedure BScripSaveClick(Sender: TObject);
procedure BShowAllClick(Sender: TObject);
procedure CBPrimaryBibleChange(Sender: TObject);
procedure CBSecondaryBibleChange(Sender: TObject);
procedure CBTertiaryBibleChange(Sender: TObject);
procedure CBVerseNLChange(Sender: TObject);
procedure EGapChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure LBBookSelectionChange(Sender: TObject; {%H-}User: boolean);
procedure LBChapter2SelectionChange(Sender: TObject; {%H-}User: boolean);
procedure LBChapterSelectionChange(Sender: TObject; {%H-}User: boolean);
procedure LBScripDblClick(Sender: TObject);
procedure LBVerseSelectionChange(Sender: TObject; {%H-}User: boolean);
procedure RBVertChange(Sender: TObject);
procedure SBBlankClick(Sender: TObject);
procedure SBDelScripClick(Sender: TObject);
procedure SBScripDownClick(Sender: TObject);
procedure SBScripUpClick(Sender: TObject);
procedure ScriptureShowClick(Sender: TObject);
procedure TBSplitChange(Sender: TObject);
procedure PopulateBibleList();
procedure PopulateBookList();
private
public
end;
var
ScriptureForm: TScriptureForm;
implementation
uses
Control;
{$R *.lfm}
{ TScriptureForm }
procedure TScriptureForm.FormShow(Sender: TObject);
begin
ScriptureForm.Top := ControlForm.Top + 10;
ScriptureForm.Left := ControlForm.Left + 10;
PopulateBookList();
If ControlForm.TertiaryBibleId > 0 then
begin
RBVert.Checked:=True;
RBVert.Enabled:=False;
RBHoriz.Enabled:=False;
end
else
begin
RBVert.Enabled:=True;
RBHoriz.Enabled:=True;
end;
end;
procedure TScriptureForm.FormCreate(Sender: TObject);
begin
LBBook.Clear;
PopulateBibleList;
TBSplit.Position:=ControlForm.BiblePrimarySplit;
if ControlForm.SplitDir = 'V' then
RBVert.Checked:=true
else
RBHoriz.Checked:=true;
CBVerseNL.Checked:=ControlForm.NewLinePerVerse;
EGap.Text := IntToStr(ControlForm.HorizSplitGap);
end;
procedure TScriptureForm.PopulateBibleList();
var
itemNo : integer;
begin
CBPrimaryBible.Clear;
CBSecondaryBible.Clear;
CBSecondaryBible.Items.Add('');
CBSecondaryBible.ItemIndex := 0;
CBTertiaryBible.Clear;
CBTertiaryBible.Items.Add('');
CBTertiaryBible.ItemIndex := 0;
ControlForm.SQLMainQuery.SQL.Text := 'SELECT `bibleId`, `bibleName` FROM `bibles` ORDER BY `bibleName`';
ControlForm.SQLMainQuery.Open;
itemNo := 0;
while not(ControlForm.SQLMainQuery.EOF) do
begin
CBPrimaryBible.Items.Add(ControlForm.SQLMainQuery.FieldByName('bibleName').AsString);
CBSecondaryBible.Items.Add(ControlForm.SQLMainQuery.FieldByName('bibleName').AsString);
CBTertiaryBible.Items.Add(ControlForm.SQLMainQuery.FieldByName('bibleName').AsString);
if (ControlForm.DefaultBibleId = 0) then // Set a default bible is there is none set
ControlForm.DefaultBibleId := ControlForm.SQLMainQuery.FieldByName('bibleId').AsInteger;
if (ControlForm.DefaultBibleId = ControlForm.SQLMainQuery.FieldByName('bibleId').AsInteger) then
CBPrimaryBible.ItemIndex:=itemNo;
if (ControlForm.SecondaryBibleId = ControlForm.SQLMainQuery.FieldByName('bibleId').AsInteger) then
CBSecondaryBible.ItemIndex := itemNo + 1; //Secondary bible has an extra blank entry at the start
if (ControlForm.TertiaryBibleId = ControlForm.SQLMainQuery.FieldByName('bibleId').AsInteger) then
CBTertiaryBible.ItemIndex := itemNo + 1; //Tertiary bible has an extra blank entry at the start
itemNo := itemNo + 1;
ControlForm.SQLMainQuery.Next;
end;
ControlForm.SQLMainQuery.Close;
PopulateBookList();
end;
procedure TScriptureForm.PopulateBookList();
var
LastBookId : integer;
LastChapter, LastChapter2, LastVerse, LastVerse2 : integer;
begin
LastBookId := LBBook.ItemIndex;
LastChapter := LBChapter.ItemIndex;
LastChapter2 := LBChapter2.ItemIndex;
LastVerse := LBVerse.ItemIndex;
LastVerse2 := LBVerse2.ItemIndex;
LBBook.Clear;
LBChapter.Clear;
LBChapter2.Clear;
LBVerse.Clear;
LBVerse2.Clear;
ControlForm.SQLMainQuery.SQL.Text := 'SELECT bookName FROM bibleBooks WHERE bibleId = :BIBLEID ORDER BY bookId';
ControlForm.SQLMainQuery.ParamByName('BIBLEID').AsInteger := ControlForm.DefaultBibleId;
ControlForm.SQLMainQuery.Open;
while not ControlForm.SQLMainQuery.EOF do
begin
LBBook.Items.Add(ControlForm.SQLMainQuery.FieldByName('bookName').AsString);
ControlForm.SQLMainQuery.Next;
end;
ControlForm.SQLMainQuery.Close;
If LBBook.Count >= LastBookId then
begin
LBBook.ItemIndex := LastBookId;
LBChapter.ItemIndex:=LastChapter;
LBChapter2.ItemIndex:=LastChapter2;
LBVerse.ItemIndex:=LastVerse;
LBVerse2.ItemIndex:=LastVerse2;
end;
end;
procedure TScriptureForm.AddScripClick(Sender: TObject);
var
SelEnd : String;
begin
if LBVerse.ItemIndex >= 0 then
begin
SelEnd := '';
If (LBVerse2.ItemIndex >= 0) then
begin
If (LBChapter2.ItemIndex <> LBChapter.ItemIndex) then
SelEnd := '-' + LBChapter2.Items.Strings[LBChapter2.ItemIndex] + ':' + LBVerse2.Items.Strings[LBVerse2.ItemIndex]
else
If (LBVerse2.ItemIndex <> LBVerse.ItemIndex) then
SelEnd := '-' + LBVerse2.Items.Strings[LBVerse2.ItemIndex];
end;
LBScrip.Items.Add(LBBook.Items.Strings[LBBook.ItemIndex] + '|' + LBChapter.Items.Strings[LBChapter.ItemIndex] + ':' + LBVerse.Items.Strings[LBVerse.ItemIndex] + SelEnd + '|' + CBPrimaryBible.Items.Strings[CBPrimaryBible.ItemIndex]);
end;
end;
procedure TScriptureForm.BScripLoadClick(Sender: TObject);
var
SCFile : TextFile;
Line : string;
begin
ControlForm.OpenDialog1.DefaultExt := '.scrip';
ControlForm.OpenDialog1.Title := 'Open Scripture List';
ControlForm.OpenDialog1.Filter := 'Scripture List|*.scrip';
if (ControlForm.OpenDialog1.Execute) then
begin
AssignFile(SCFile, ControlForm.OpenDialog1.FileName);
Reset(SCFile);
LBScrip.Clear;
while not EOF(SCFile) do
begin
Readln(SCFile, Line);
if (Length(Line) > 0) then
LBScrip.Items.Add(Line);
end;
CloseFile(SCFile);
if (LBScrip.Items.Count > 0) then
LBScrip.ItemIndex := 0;
end;
end;
procedure TScriptureForm.BScripSaveClick(Sender: TObject);
var
SCFile: TextFile;
i: integer;
begin
ControlForm.SaveDialog1.DefaultExt := '.scrip';
ControlForm.SaveDialog1.Title := 'Save Scripture List';
ControlForm.SaveDialog1.Filter := 'Scripture List|*.scrip';
if (ControlForm.SaveDialog1.Execute) then
begin
AssignFile(SCFile, ControlForm.SaveDialog1.FileName);
Rewrite(SCFile);
for i := 0 to LBScrip.Items.Count - 1 do
WriteLn(SCFile, LBScrip.Items[i]);
CloseFile(SCFile);
end;
end;
procedure TScriptureForm.BShowAllClick(Sender: TObject);
var
i : integer;
ScriptureFile : TextFile;
begin
if (LBScrip.Count > 0) then
begin
ControlForm.SongFileName := ControlForm.SongDirectory + 'Local' + PathDelim + 'QuickScripture.txt';
AssignFile(ScriptureFile, ControlForm.SongFileName);
Rewrite(ScriptureFile);
for i := 0 to (LBScrip.Count - 1) do
begin
if LBScrip.Items.Strings[i] = 'BLANK' then
begin
Writeln(ScriptureFile, '<TEXT', (i + 1), '>');
Writeln(ScriptureFile, '');
Writeln(ScriptureFile, '</TEXT>');
end
else
begin
Writeln(ScriptureFile, '<SCRIP', (i + 1), '>');
Writeln(ScriptureFile, LBScrip.Items.Strings[i]);
Writeln(ScriptureFile, '</SCRIP>');
end;
end;
CloseFile(ScriptureFile);
ControlForm.LoadSong(Sender, false);
if (ControlForm.ShowButton.Enabled) and (ControlForm.ShowButton.Caption = 'S&how') then
ControlForm.ShowButton.Click;
end;
end;
procedure TScriptureForm.CBPrimaryBibleChange(Sender: TObject);
begin
if (CBPrimaryBible.ItemIndex >= 0) then
begin
ControlForm.SQLMainQuery.SQL.Text := 'SELECT `bibleId` FROM `bibles` WHERE `bibleName` = :BIBLENAME';
ControlForm.SQLMainQuery.ParamByName('BIBLENAME').AsString := CBPrimaryBible.Items.Strings[CBPrimaryBible.ItemIndex];
ControlForm.SQLMainQuery.Open;
If not(ControlForm.SQLMainQuery.EOF) then
ControlForm.DefaultBibleId := ControlForm.SQLMainQuery.FieldByName('bibleId').AsInteger;
ControlForm.SQLMainQuery.Close;
PopulateBookList();
end;
end;
procedure TScriptureForm.CBSecondaryBibleChange(Sender: TObject);
begin
if (CBSecondaryBible.ItemIndex >= 0) then
begin
ControlForm.SQLMainQuery.SQL.Text := 'SELECT `bibleId` FROM `bibles` WHERE `bibleName` = :BIBLENAME';
ControlForm.SQLMainQuery.ParamByName('BIBLENAME').AsString := CBSecondaryBible.Items.Strings[CBSecondaryBible.ItemIndex];
ControlForm.SQLMainQuery.Open;
If not(ControlForm.SQLMainQuery.EOF) then
ControlForm.SecondaryBibleId:= ControlForm.SQLMainQuery.FieldByName('bibleId').AsInteger
else
begin
ControlForm.SecondaryBibleId := 0;
CBTertiaryBible.ItemIndex := 0;
CBTertiaryBibleChange(Sender);
end;
ControlForm.SQLMainQuery.Close;
end
else
begin
ControlForm.SecondaryBibleId := 0;
CBTertiaryBible.ItemIndex := 0;
CBTertiaryBibleChange(Sender);
end;
end;
procedure TScriptureForm.CBTertiaryBibleChange(Sender: TObject);
begin
if (CBTertiaryBible.ItemIndex >= 0) then
begin
ControlForm.SQLMainQuery.SQL.Text := 'SELECT `bibleId` FROM `bibles` WHERE `bibleName` = :BIBLENAME';
ControlForm.SQLMainQuery.ParamByName('BIBLENAME').AsString := CBTertiaryBible.Items.Strings[CBTertiaryBible.ItemIndex];
ControlForm.SQLMainQuery.Open;
If not(ControlForm.SQLMainQuery.EOF) then
begin
ControlForm.TertiaryBibleId:= ControlForm.SQLMainQuery.FieldByName('bibleId').AsInteger;
RBVert.Checked := True; // Three way is only vertical split
RBVert.Enabled := False;
RBHoriz.Enabled := False;
end
else
begin
ControlForm.TertiaryBibleId := 0;
RBVert.Enabled := True;
RBHoriz.Enabled := True;
end;
ControlForm.SQLMainQuery.Close;
end
else
begin
ControlForm.TertiaryBibleId := 0;
RBVert.Enabled := True;
RBHoriz.Enabled := True;
end;
end;
procedure TScriptureForm.CBVerseNLChange(Sender: TObject);
begin
ControlForm.NewLinePerVerse:=CBVerseNL.Checked
end;
procedure TScriptureForm.EGapChange(Sender: TObject);
begin
If (Length(EGap.Text) > 0) and (IsNumber(WideString(EGap.Text), 1)) then
ControlForm.HorizSplitGap:=StrToInt(EGap.Text);
end;
procedure TScriptureForm.LBBookSelectionChange(Sender: TObject; User: boolean);
begin
LBChapter.Clear;
LBChapter2.Clear;
LBVerse.Clear;
LBVerse2.Clear;
ControlForm.SQLMainQuery.SQL.Text := 'SELECT chapter FROM bibleVerse JOIN bibleBooks ON bibleVerse.bibleId = bibleBooks.bibleId AND bibleVerse.bookId = bibleBooks.bookId WHERE bibleBooks.bibleId = :BIBLEID AND bookName = :BOOKNAME GROUP BY chapter';
ControlForm.SQLMainQuery.ParamByName('BIBLEID').AsInteger := ControlForm.DefaultBibleId;
ControlForm.SQLMainQuery.ParamByName('BOOKNAME').AsString := LBBook.Items.Strings[LBBook.ItemIndex];
ControlForm.SQLMainQuery.Open;
while not ControlForm.SQLMainQuery.EOF do
begin
LBChapter.Items.Add(ControlForm.SQLMainQuery.FieldByName('chapter').AsString);
LBChapter2.Items.Add(ControlForm.SQLMainQuery.FieldByName('chapter').AsString);
ControlForm.SQLMainQuery.Next;
end;
ControlForm.SQLMainQuery.Close;
end;
procedure TScriptureForm.LBChapter2SelectionChange(Sender: TObject;
User: boolean);
begin
LBVerse2.Clear;
If (LBChapter2.ItemIndex >= 0) then
begin
ControlForm.SQLMainQuery.SQL.Text := 'SELECT verse FROM bibleVerse JOIN bibleBooks ON bibleVerse.bibleId = bibleBooks.bibleId AND bibleVerse.bookId = bibleBooks.bookId WHERE bibleBooks.bibleId = :BIBLEID AND bookName = :BOOKNAME AND chapter = :CHAPTER ORDER BY verse';
ControlForm.SQLMainQuery.ParamByName('BIBLEID').AsInteger := ControlForm.DefaultBibleId;
ControlForm.SQLMainQuery.ParamByName('BOOKNAME').AsString := LBBook.Items.Strings[LBBook.ItemIndex];
ControlForm.SQLMainQuery.ParamByName('CHAPTER').AsInteger := StrToInt(LBChapter2.Items.Strings[LBChapter2.ItemIndex]);
ControlForm.SQLMainQuery.Open;
while not ControlForm.SQLMainQuery.EOF do
begin
LBVerse2.Items.Add(ControlForm.SQLMainQuery.FieldByName('verse').AsString);
ControlForm.SQLMainQuery.Next;
end;
ControlForm.SQLMainQuery.Close;
end;
end;
procedure TScriptureForm.LBChapterSelectionChange(Sender: TObject; User: boolean
);
var
inc2 : boolean;
begin
LBVerse.Clear;
If (LBChapter.ItemIndex >= 0) then
begin
If (LBChapter2.ItemIndex < LBChapter.ItemIndex) then
begin
LBChapter2.ItemIndex := LBChapter.ItemIndex;
LBVerse2.Clear;
inc2 := true
end
else
inc2 := false;
ControlForm.SQLMainQuery.SQL.Text := 'SELECT verse FROM bibleVerse JOIN bibleBooks ON bibleVerse.bibleId = bibleBooks.bibleId AND bibleVerse.bookId = bibleBooks.bookId WHERE bibleBooks.bibleId = :BIBLEID AND bookName = :BOOKNAME AND chapter = :CHAPTER ORDER BY verse';
ControlForm.SQLMainQuery.ParamByName('BIBLEID').AsInteger := ControlForm.DefaultBibleId;
ControlForm.SQLMainQuery.ParamByName('BOOKNAME').AsString := LBBook.Items.Strings[LBBook.ItemIndex];
ControlForm.SQLMainQuery.ParamByName('CHAPTER').AsInteger := StrToInt(LBChapter.Items.Strings[LBChapter.ItemIndex]);
ControlForm.SQLMainQuery.Open;
while not ControlForm.SQLMainQuery.EOF do
begin
LBVerse.Items.Add(ControlForm.SQLMainQuery.FieldByName('verse').AsString);
If (inc2 = true) then
LBVerse2.Items.Add(ControlForm.SQLMainQuery.FieldByName('verse').AsString);
ControlForm.SQLMainQuery.Next;
end;
ControlForm.SQLMainQuery.Close;
end;
end;
procedure TScriptureForm.LBScripDblClick(Sender: TObject);
var
ScriptureFile : TextFile;
begin
If (LBScrip.ItemIndex >= 0) then
begin
ControlForm.SongFileName := ControlForm.SongDirectory + 'Local' + PathDelim + 'QuickScripture.txt';
AssignFile(ScriptureFile, ControlForm.SongFileName);
Rewrite(ScriptureFile);
Writeln(ScriptureFile, '<SCRIP>');
Writeln(ScriptureFile, LBScrip.Items.Strings[LBScrip.ItemIndex]);
Writeln(ScriptureFile, '</SCRIP>');
CloseFile(ScriptureFile);
ControlForm.LoadSong(Sender, false);
if (ControlForm.ShowButton.Enabled) and (ControlForm.ShowButton.Caption = 'S&how') then
ControlForm.ShowButton.Click;
end;
end;
procedure TScriptureForm.LBVerseSelectionChange(Sender: TObject; User: boolean);
begin
If ((LBChapter.ItemIndex = LBChapter2.ItemIndex) and (LBVerse2.ItemIndex < LBVerse.ItemIndex)) then
LBVerse2.ItemIndex := -1;
end;
procedure TScriptureForm.RBVertChange(Sender: TObject);
begin
if RBVert.Checked then
ControlForm.SplitDir := 'V'
else
ControlForm.SplitDir := 'H';
end;
procedure TScriptureForm.SBBlankClick(Sender: TObject);
begin
LBScrip.Items.Add('BLANK');
end;
procedure TScriptureForm.SBDelScripClick(Sender: TObject);
var
Reply, OldIndex: integer;
begin
if LBScrip.ItemIndex > -1 then
begin
Reply := Application.MessageBox('Delete from scripture list?',
'Confirm Delete', MB_ICONQUESTION + MB_YESNO);
if Reply = idYes then
begin
OldIndex := LBScrip.ItemIndex;
LBScrip.Items.Delete(LBScrip.ItemIndex);
if LBScrip.Items.Count > OldIndex then
LBScrip.ItemIndex := OldIndex
else
LBScrip.ItemIndex := LBScrip.Items.Count - 1;
end;
end;
end;
procedure TScriptureForm.SBScripDownClick(Sender: TObject);
var
Item: string;
begin
if (LBScrip.ItemIndex >= 0) and (LBScrip.ItemIndex < (LBScrip.Items.Count - 1)) then
begin
Item := LBScrip.Items[LBScrip.ItemIndex];
LBScrip.Items[LBScrip.ItemIndex] := LBScrip.Items[LBScrip.ItemIndex + 1];
LBScrip.Items[LBScrip.ItemIndex + 1] := Item;
LBScrip.ItemIndex := LBScrip.ItemIndex + 1;
end;
end;
procedure TScriptureForm.SBScripUpClick(Sender: TObject);
var
Item: string;
begin
if LBScrip.ItemIndex > 0 then
begin
Item := LBScrip.Items[LBScrip.ItemIndex];
LBScrip.Items[LBScrip.ItemIndex] := LBScrip.Items[LBScrip.ItemIndex - 1];
LBScrip.Items[LBScrip.ItemIndex - 1] := Item;
LBScrip.ItemIndex := LBScrip.ItemIndex - 1;
end;
end;
procedure TScriptureForm.ScriptureShowClick(Sender: TObject);
var
SelEnd : String;
ScriptureFile : TextFile;
begin
if LBVerse.ItemIndex >= 0 then
begin
SelEnd := '';
If (LBVerse2.ItemIndex >= 0) then
begin
If (LBChapter2.ItemIndex <> LBChapter.ItemIndex) then
SelEnd := '-' + LBChapter2.Items.Strings[LBChapter2.ItemIndex] + ':' + LBVerse2.Items.Strings[LBVerse2.ItemIndex]
else
If (LBVerse2.ItemIndex <> LBVerse.ItemIndex) then
SelEnd := '-' + LBVerse2.Items.Strings[LBVerse2.ItemIndex];
end;
ControlForm.SongFileName := ControlForm.SongDirectory + 'Local' + PathDelim + 'QuickScripture.txt';
AssignFile(ScriptureFile, ControlForm.SongFileName);
Rewrite(ScriptureFile);
Writeln(ScriptureFile, '<SCRIP>');
Writeln(ScriptureFile, LBBook.Items.Strings[LBBook.ItemIndex] + '|' + LBChapter.Items.Strings[LBChapter.ItemIndex] + ':' + LBVerse.Items.Strings[LBVerse.ItemIndex] + SelEnd);
Writeln(ScriptureFile, '</SCRIP>');
CloseFile(ScriptureFile);
ControlForm.LoadSong(Sender, false);
if (ControlForm.ShowButton.Enabled) and (ControlForm.ShowButton.Caption = 'S&how') then
ControlForm.ShowButton.Click;
ScriptureForm.Hide;
end;
end;
procedure TScriptureForm.TBSplitChange(Sender: TObject);
begin
ControlForm.BiblePrimarySplit:=TBSplit.Position;
end;
end.