summaryrefslogtreecommitdiff
path: root/examples/windoze/delphi20/svertf
diff options
context:
space:
mode:
Diffstat (limited to 'examples/windoze/delphi20/svertf')
-rw-r--r--examples/windoze/delphi20/svertf/LogoMain.dfmbin0 -> 6567 bytes
-rw-r--r--examples/windoze/delphi20/svertf/LogoMain.pas170
-rw-r--r--examples/windoze/delphi20/svertf/Multimod.dpr17
-rw-r--r--examples/windoze/delphi20/svertf/Searchdlg.dfmbin0 -> 651 bytes
-rw-r--r--examples/windoze/delphi20/svertf/Searchdlg.pas59
-rw-r--r--examples/windoze/delphi20/svertf/about.dfmbin0 -> 1811 bytes
-rw-r--r--examples/windoze/delphi20/svertf/about.pas31
7 files changed, 277 insertions, 0 deletions
diff --git a/examples/windoze/delphi20/svertf/LogoMain.dfm b/examples/windoze/delphi20/svertf/LogoMain.dfm
new file mode 100644
index 0000000..4cc49ef
--- /dev/null
+++ b/examples/windoze/delphi20/svertf/LogoMain.dfm
Binary files differ
diff --git a/examples/windoze/delphi20/svertf/LogoMain.pas b/examples/windoze/delphi20/svertf/LogoMain.pas
new file mode 100644
index 0000000..78ec426
--- /dev/null
+++ b/examples/windoze/delphi20/svertf/LogoMain.pas
@@ -0,0 +1,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.
+
diff --git a/examples/windoze/delphi20/svertf/Multimod.dpr b/examples/windoze/delphi20/svertf/Multimod.dpr
new file mode 100644
index 0000000..d4986dc
--- /dev/null
+++ b/examples/windoze/delphi20/svertf/Multimod.dpr
@@ -0,0 +1,17 @@
+program MultiMod;
+
+uses
+ Forms,
+ LogoMain in 'LogoMain.pas' {SwordAppForm},
+ About in 'ABOUT.PAS' {AboutBox},
+ Searchdlg in 'Searchdlg.pas' {SearchForm};
+
+{$R *.RES}
+
+begin
+ Application.Title := 'The SWORD Project';
+ Application.CreateForm(TSwordAppForm, SwordAppForm);
+ Application.CreateForm(TAboutBox, AboutBox);
+ Application.CreateForm(TSearchForm, SearchForm);
+ Application.Run;
+end.
diff --git a/examples/windoze/delphi20/svertf/Searchdlg.dfm b/examples/windoze/delphi20/svertf/Searchdlg.dfm
new file mode 100644
index 0000000..a46702e
--- /dev/null
+++ b/examples/windoze/delphi20/svertf/Searchdlg.dfm
Binary files differ
diff --git a/examples/windoze/delphi20/svertf/Searchdlg.pas b/examples/windoze/delphi20/svertf/Searchdlg.pas
new file mode 100644
index 0000000..0e8475f
--- /dev/null
+++ b/examples/windoze/delphi20/svertf/Searchdlg.pas
@@ -0,0 +1,59 @@
+unit searchdlg;
+
+interface
+
+uses
+ SWKey, Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
+ StdCtrls;
+
+type
+ TSearchForm = class(TForm)
+ Edit1: TEdit;
+ Button1: TButton;
+ Button2: TButton;
+ ListBox1: TListBox;
+ Label1: TLabel;
+ procedure Button2Click(Sender: TObject);
+ procedure Button1Click(Sender: TObject);
+ procedure ListBox1DblClick(Sender: TObject);
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ SearchForm: TSearchForm;
+
+implementation
+
+uses LogoMain;
+
+{$R *.DFM}
+
+procedure TSearchForm.Button2Click(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TSearchForm.Button1Click(Sender: TObject);
+var
+ results:TSWKey;
+begin
+ results := SwordAppForm.mrtWebster.Search(PChar(Edit1.Text));
+ while (results.Error = 0) do
+ begin
+ ListBox1.Items.Add(results.text);
+ results.Inc;
+ end;
+end;
+
+procedure TSearchForm.ListBox1DblClick(Sender: TObject);
+begin
+ SwordAppForm.vkcommonkey.text := ListBox1.items[listbox1.itemindex];
+ SwordAppForm.lblTextKeyText.Caption := SwordAppForm.vkCommonKey.Text;
+ SwordAppForm.edTextBox.Display;
+ SwordAppForm.edCommentBox.Text := SwordAppForm.mrcMHC.Text;
+end;
+
+end.
diff --git a/examples/windoze/delphi20/svertf/about.dfm b/examples/windoze/delphi20/svertf/about.dfm
new file mode 100644
index 0000000..16013ec
--- /dev/null
+++ b/examples/windoze/delphi20/svertf/about.dfm
Binary files differ
diff --git a/examples/windoze/delphi20/svertf/about.pas b/examples/windoze/delphi20/svertf/about.pas
new file mode 100644
index 0000000..44a8a55
--- /dev/null
+++ b/examples/windoze/delphi20/svertf/about.pas
@@ -0,0 +1,31 @@
+unit About;
+
+interface
+
+uses Windows, Classes, Graphics, Forms, Controls, StdCtrls,
+ Buttons, ExtCtrls;
+
+type
+ TAboutBox = class(TForm)
+ Panel1: TPanel;
+ OKButton: TButton;
+ ProgramIcon: TImage;
+ ProductName: TLabel;
+ Version: TLabel;
+ Copyright: TLabel;
+ Comments: TLabel;
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ AboutBox: TAboutBox;
+
+implementation
+
+{$R *.DFM}
+
+end.
+