summaryrefslogtreecommitdiff
path: root/examples/windoze/delphi20/svertf/LogoMain.pas
blob: 78ec426bb3f101c53449ecbdbc92390bd3ac8384 (plain)
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
unit LogoMain;

interface

uses Windows, Classes, Graphics, Forms, Controls, Menus,
  Dialogs, StdCtrls, Buttons, ExtCtrls, ComCtrls, Grids, DBGrids, swmodule,
  swkey, swvskey, swtxtdsp;

type
    TSwordAppForm = class(TForm)
        MainMenu: TMainMenu;
        FileMenu: TMenuItem;
        FileExitItem: TMenuItem;
        Help1: TMenuItem;
        AboutItem: TMenuItem;
    pnlToolbar: TPanel;
        StatusBar: TStatusBar;
        BookCB: TComboBox;
        CHBox: TEdit;
        VSBox: TEdit;
        Label1: TLabel;
    btnLookup: TSpeedButton;
    lblTextKeyText: TLabel;
    PopupMenu1: TPopupMenu;
    EastonsBibleDictionary1: TMenuItem;
    VinesBibleDictionary1: TMenuItem;
    mrtWebster: TSWModule;
    mrcMHC: TSWModule;
    mrldEastons: TSWModule;
    mrldVines: TSWModule;
    vkCommonKey: TSWVerseKey;
    DblClkWordRtClkMouse1: TMenuItem;
    Search1: TMenuItem;
    NewSearchWindow1: TMenuItem;
    Bevel1: TBevel;
    pnlMain: TPanel;
    pnlText: TPanel;
    lblTextTitle: TLabel;
    pnlCommentary: TPanel;
    lblCommentTitle: TLabel;
    edCommentBox: TRichEdit;
    pnlVSplitter: TPanel;
    pnlHSplitter: TPanel;
    pnlDictionary: TPanel;
    edLDBox: TRichEdit;
    pnlDcitionaryTitle: TPanel;
    Label2: TLabel;
    lblLDTitle: TLabel;
    btnPreviousVerse: TButton;
    btnNextVerse: TButton;
    lblLDKeyText: TLabel;
    edTextBox: TSWTextDisp;
        procedure FormCreate(Sender: TObject);
        procedure FileExit(Sender: TObject);
        procedure Lookup(Sender: TObject);
        procedure About(Sender: TObject);
        procedure ShowHint(Sender: TObject);
    procedure EastonsBibleDictionary1Click(Sender: TObject);
    procedure edTextBoxEnter(Sender: TObject);
    procedure VinesBibleDictionary1Click(Sender: TObject);
    procedure btnPreviousVerseClick(Sender: TObject);
    procedure btnNextVerseClick(Sender: TObject);
    procedure NewSearchWindow1Click(Sender: TObject);
    private
        curedit: TRichEdit;
  public
    { Public declarations }
  end;

var
  SwordAppForm: TSwordAppForm;

implementation

uses SysUtils, Mapi, About, searchdlg;

{$R *.DFM}
procedure TSwordAppForm.FormCreate(Sender: TObject);
var
	s1: string;
begin
  Application.OnHint := ShowHint;

	vkCommonKey.Text := 'Genesis 1:1';
	while (vkCommonKey.Error = 0) do
	begin
		s1 := vkCommonKey.Text;
		SetLength(s1, (Length(s1) - 4));
		BookCB.Items.Add(s1);
    vkCommonKey.Book := vkCommonKey.Book + 1;
  end;
end;


procedure TSwordAppForm.FileExit(Sender: TObject);
begin
  Close;
end;

procedure TSwordAppForm.Lookup(Sender: TObject);
var
  Buffer: PChar;
  s1: AnsiString;
  hkey: integer;
begin
	if ((StrToInt(CHBox.Text) = 0) or (StrToInt(VSBox.Text) = 0)) then
		vkCommonKey.AutoNormalize := false;

	vkCommonKey.Text       := BookCB.Text + ' ' + CHBox.Text + ':' + VSBox.Text;
        lblTextKeyText.Caption := vkCommonKey.Text;
	edTextBox.Display;
	edCommentBox.Text      := mrcMHC.Text;

        vkCommonKey.AutoNormalize := true;
end;

procedure TSwordAppForm.About(Sender: TObject);
begin
  AboutBox.ShowModal;
end;

procedure TSwordAppForm.ShowHint(Sender: TObject);
begin
  StatusBar.SimpleText := Application.Hint;
end;

procedure TSwordAppForm.EastonsBibleDictionary1Click(Sender: TObject);
begin
		 mrldEastons.KeyText := Trim(curedit.SelText); { we use .KeyText instead of Key.Text because we don't care about accessing the actual key in Eastons (in fact, it may even not be allocated yet).  We just want to set Eastons with the text and let Eastons worry about allocating keys.}
		 edLDBox.Text := mrldEastons.Text;
		 lblLDKeyText.Caption := mrldEastons.KeyText;
		 lblLDTitle.Caption := mrldEastons.Description;
end;

procedure TSwordAppForm.edTextBoxEnter(Sender: TObject);
begin
		 curedit := TRichEdit(Sender);
end;

procedure TSwordAppForm.VinesBibleDictionary1Click(Sender: TObject);
begin
		 mrldVines.KeyText := Trim(curedit.SelText); { we use .KeyText instead of Key.Text because we don't care about accessing the actual key in Vines (in fact, it may even not be allocated yet).  We just want to set Vines with the text and let Vines worry about allocating keys.}
		 edLDBox.Text := mrldVines.Text;
		 lblLDKeyText.Caption := mrldVines.KeyText;
		 lblLDTitle.Caption := mrldVines.Description;
end;

procedure TSwordAppForm.btnPreviousVerseClick(Sender: TObject);
begin
  vkCommonKey.Dec;
	lblTextKeyText.Caption := vkCommonKey.Text;
	edTextBox.Display;
	edCommentBox.Text     := mrcMHC.Text;
end;

procedure TSwordAppForm.btnNextVerseClick(Sender: TObject);
begin
	vkCommonKey.Inc;
	lblTextKeyText.Caption := vkCommonKey.Text;
	edTextBox.Display;
	edCommentBox.Text     := mrcMHC.Text;
end;

procedure TSwordAppForm.NewSearchWindow1Click(Sender: TObject);
begin
	SearchForm.Show;
end;

end.