aboutsummaryrefslogtreecommitdiffstats
path: root/apps/windoze
diff options
context:
space:
mode:
authordanglassey <danglassey>2002-08-14 09:57:17 +0000
committerdanglassey <danglassey>2002-08-14 09:57:17 +0000
commitdaa67ff1f728c07f2a116ee9a9f4505479ca6808 (patch)
treec224a537d30480002ae0560cc9104b543b4d1b5e /apps/windoze
parent6d6973e035aac5ec1676efccd5b8ada70c40b639 (diff)
downloadsword-sf-cvs-daa67ff1f728c07f2a116ee9a9f4505479ca6808.tar.gz
Initial import from crosswire CVS for syncingimport-1.1.1
Diffstat (limited to 'apps/windoze')
-rw-r--r--apps/windoze/CBuilder1/mainform.cpp31
-rw-r--r--apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp48
-rw-r--r--apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.cpp122
-rw-r--r--apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm161
-rw-r--r--apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp37
-rw-r--r--apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm383
-rw-r--r--apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h33
-rw-r--r--apps/windoze/CBuilder5/BibleCS/ModVisFrm.cpp50
-rw-r--r--apps/windoze/CBuilder5/BibleCS/ModVisFrm.h37
-rw-r--r--apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp441
-rw-r--r--apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm565
-rw-r--r--apps/windoze/CBuilder5/BibleCS/PrintFrm.h117
-rw-r--r--apps/windoze/CBuilder5/BibleCS/RangeMaintFrm.h64
-rw-r--r--apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp860
-rw-r--r--apps/windoze/CBuilder5/BibleCS/RxRichEditX.h100
-rw-r--r--apps/windoze/CBuilder5/BibleCS/TModuleFonts.cpp138
-rw-r--r--apps/windoze/CBuilder5/BibleCS/TModuleFonts.dfm156
-rw-r--r--apps/windoze/CBuilder5/BibleCS/TModuleFonts.h56
-rw-r--r--apps/windoze/CBuilder5/BibleCS/biblecsmgr.cpp130
-rw-r--r--apps/windoze/CBuilder5/BibleCS/biblecsmgr.h34
-rw-r--r--apps/windoze/CBuilder5/BibleCS/bookmarkfrm.cpp221
-rw-r--r--apps/windoze/CBuilder5/BibleCS/bookmarkfrm.h48
-rw-r--r--apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.bpr113
-rw-r--r--apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.resbin0 -> 1896 bytes
-rw-r--r--apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.cpp70
-rw-r--r--apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.dfmbin0 -> 488359 bytes
-rw-r--r--apps/windoze/CBuilder5/BibleCS/editentryfrm.cpp352
-rw-r--r--apps/windoze/CBuilder5/BibleCS/mainfrm.cpp2821
-rw-r--r--apps/windoze/CBuilder5/BibleCS/mainfrm.dfm738
-rw-r--r--apps/windoze/CBuilder5/BibleCS/mainfrm.h418
-rw-r--r--apps/windoze/CBuilder5/BibleCS/optionfrm.cpp644
-rw-r--r--apps/windoze/CBuilder5/BibleCS/optionfrm.dfm681
-rw-r--r--apps/windoze/CBuilder5/BibleCS/optionfrm.h146
-rw-r--r--apps/windoze/CBuilder5/BibleCS/rtfhintfrm.cpp48
-rw-r--r--apps/windoze/CBuilder5/BibleCS/searchfrm.cpp414
-rw-r--r--apps/windoze/CBuilder5/BibleCS/searchfrm.dfm393
-rw-r--r--apps/windoze/CBuilder5/BibleCS/searchfrm.h107
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/colors/Default.sch20
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/colors/Light Blues.sch24
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/colors/Lighten Up.sch24
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/colors/Midnight.sch24
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/colors/Navy Blues.sch24
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/colors/Parchment.sch24
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/de.conf180
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/hu.conf172
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/id.conf179
-rw-r--r--apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/sl.conf178
-rw-r--r--apps/windoze/CBuilder5/BibleCS/sword.bpr166
-rw-r--r--apps/windoze/CBuilder5/BibleCS/sword.cpp160
-rw-r--r--apps/windoze/CBuilder5/BibleCS/sword.h1
-rw-r--r--apps/windoze/CBuilder5/BibleCS/sword.resbin0 -> 1980 bytes
-rw-r--r--apps/windoze/CBuilder5/BibleCS/swordlib.bpr203
-rw-r--r--apps/windoze/CBuilder5/BibleCS/swordlib.cpp121
-rw-r--r--apps/windoze/CBuilder5/BibleCS/swordprj.bpg32
-rw-r--r--apps/windoze/CBuilder5/BibleCS/versesel.cpp22
-rw-r--r--apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp49
-rw-r--r--apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm40
-rw-r--r--apps/windoze/CBuilder5/BibleCS/vrslstfrm.h29
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg31
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr136
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp36
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/InstallMgr.resbin0 -> 1852 bytes
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/MainFrm.cpp1110
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/MainFrm.h146
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.cpp160
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.h52
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/StatusFrm.cpp273
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfmbin0 -> 1093 bytes
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/StatusFrm.h89
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp67
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/installmgr.conf8
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/zlib.bpr126
-rw-r--r--apps/windoze/CBuilder5/prototype/CommentPanel.cpp222
-rw-r--r--apps/windoze/CBuilder5/prototype/biblecsmgr.cpp88
-rw-r--r--apps/windoze/CBuilder5/prototype/editentryfrm.cpp332
-rw-r--r--apps/windoze/CBuilder5/prototype/mainfrm.cpp825
-rw-r--r--apps/windoze/CBuilder5/prototype/mainfrm.h238
-rw-r--r--apps/windoze/CBuilder5/prototype/sword.bpr124
-rw-r--r--apps/windoze/CBuilder5/prototype/sword.cpp47
-rw-r--r--apps/windoze/CBuilder5/prototype/swordlib.bpr168
-rw-r--r--apps/windoze/CBuilder5/prototype/swordlib.cpp61
-rw-r--r--apps/windoze/CBuilder5/prototype/swordprj.bpg23
-rw-r--r--apps/windoze/CBuilder6/BibleCS/sword.bpr221
-rw-r--r--apps/windoze/CBuilder6/BibleCS/sword.cpp133
-rw-r--r--apps/windoze/swdisprtf.cpp113
-rw-r--r--apps/windoze/swdisprtfchap.cpp143
-rw-r--r--apps/windoze/swwinlog.cpp74
-rw-r--r--apps/windoze/tbdisp.cpp55
88 files changed, 17550 insertions, 0 deletions
diff --git a/apps/windoze/CBuilder1/mainform.cpp b/apps/windoze/CBuilder1/mainform.cpp
new file mode 100644
index 0000000..0118d7b
--- /dev/null
+++ b/apps/windoze/CBuilder1/mainform.cpp
@@ -0,0 +1,31 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "mainform.h"
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TForm1 *Form1;
+//---------------------------------------------------------------------------
+__fastcall TForm1::TForm1(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Button1Click(TObject *Sender)
+{
+ webster->SetKey(Edit1->Text.c_str());
+ Memo1->Text = webster->operator char*();
+
+}
+//---------------------------------------------------------------------
+void __fastcall TForm1::FormCreate(TObject *Sender)
+{
+ webster = new RawText("../../../modules/texts/rawtext/orthjbc/", "Webster", "Webster Text");
+}
+//---------------------------------------------------------------------
+void __fastcall TForm1::FormDestroy(TObject *Sender)
+{
+ delete webster;
+}
+//--------------------------------------------------------------------- \ No newline at end of file
diff --git a/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp b/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp
new file mode 100644
index 0000000..0528c7f
--- /dev/null
+++ b/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp
@@ -0,0 +1,48 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "vrslstfrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TVerseListFrm *VerseListFrm;
+//---------------------------------------------------------------------------
+__fastcall TVerseListFrm::TVerseListFrm(TComponent* Owner, ListKey &iVerseList)
+ : TForm(Owner), verseList(iVerseList) {
+ pvrtf = new SWDispRTF(this);
+
+ pvrtf->Parent = plPreview;
+ pvrtf->Align = alClient;
+ pvrtf->ScrollBars = ssVertical;
+ pvrtf->ReadOnly = true;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TVerseListFrm::ListBox1Click(TObject *Sender) {
+ ModMap::iterator target;
+ target = Form1->mainmgr->Modules.find(Form1->PageControl1->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ SWKey *savekey = *(*target).second;
+ (*target).second->SetKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str());
+ pvrtf->Display(*(*target).second);
+ (*target).second->SetKey(*savekey);
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TVerseListFrm::ListBox1DblClick(TObject *Sender)
+{
+ Form1->DefaultVSKey = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str();
+ Form1->TextKeyChanged();
+}
+//---------------------------------------------------------------------------
+void __fastcall TVerseListFrm::FormShow(TObject *Sender)
+{
+ for (verseList = TOP; (!verseList.Error()); verseList++)
+ ListBox1->Items->Add((const char *)verseList);
+}
+//---------------------------------------------------------------------------
+
+
+
diff --git a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.cpp b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.cpp
new file mode 100644
index 0000000..b76b9b1
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.cpp
@@ -0,0 +1,122 @@
+//---------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "AboutBoxfrm.h"
+#include "mainfrm.h"
+//---------------------------------------------------------------------
+#pragma resource "*.dfm"
+TAboutBox *AboutBox;
+//---------------------------------------------------------------------
+__fastcall TAboutBox::TAboutBox(TComponent* AOwner) : TForm(AOwner) {
+}
+
+
+//---------------------------------------------------------------------
+void __fastcall TAboutBox::FormShow(TObject *Sender) {
+ int i;
+ static char *modtypes[] = {"Biblical Texts", "Commentaries", "Lexicons / Dictionaries", "Generic Books"};
+
+ string newtext, tmptext;
+ ModMap::iterator it;
+ SectionMap::iterator it2;
+ ConfigEntMap::iterator it3;
+ TMemoryStream *RTFStream = new TMemoryStream();
+
+ newtext = "{\\rtf1\\ansi{\\fonttbl{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;}";
+ newtext += "\\pard\\qc\\cf2\\nowidctlpar{\\fs30\\b Installed Modules } \\par \\pard \\nowidctlpar \\cf0 ";
+
+ for (i = 0; i < 4; i++) {
+ newtext += "\\par {\\fs28\\b ";
+ newtext += modtypes[i];
+ newtext += " }\\par \\par ";
+ for (it = Form1->mainmgr->Modules.begin(); it != Form1->mainmgr->Modules.end(); it++) {
+ if (!strcmp((*it).second->Type(), modtypes[i])) {
+ it2 = Form1->mainmgr->config->Sections.find((*it).second->Name());
+ if (it2 != Form1->mainmgr->config->Sections.end()) {
+ newtext = newtext + "{\\fs24\\cf1\\b " + (*it).second->Name() + " }\t";
+ newtext = newtext + "{\\fs24\\i " + (*it).second->Description() + " } \\par ";
+ it3 = (*it2).second.find("About");
+ if (it3 != (*it2).second.end())
+ newtext = newtext + "{\\fs20\\cf0 " + (*it3).second.c_str() + " }\\par \\par";
+ }
+ }
+ }
+ }
+ newtext += "{\\fs24 \\par }}";
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.length());
+ RTFStream->Position = 0;
+ ModulesAbout->Lines->LoadFromStream(RTFStream);
+
+ newtext = "{\\rtf1\\ansi{\\fonttbl{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;}";
+ newtext += "\\fs20 Thanx to God for His GREAT MERCY and LOVE: Never did anyone have so much, give it up so completely, to humble Himself and die such a death, all for such an ENEMY as me. -Philippians 2:6-8; Romans 5:6-10 \\par\\par ";
+ newtext += "For the latest updates and info, visit us on the net at: \\par ";
+ newtext += "http://www.crosswire.org \\par\\par ";
+ newtext += "Send us feedback, bug reports, or patches/additions: \\par ";
+ newtext += "sword-feedback@crosswire.org \\par ";
+ newtext += "sword-bugs@crosswire.org \\par ";
+ newtext += "sword-patches@crosswire.org (please include unified diffs if possible (diff -u)) \\par\\par ";
+ newtext += "To be on our mailing list: \\par ";
+ newtext += "sword-list-info@crosswire.org \\par\\par ";
+ newtext += "This software is provided free for the study of God and His Word. You DO NOT NEED TO license or pay for this software. Please: copy it freely and distribute it to athiests in Russia :), post it on your favorite FTP site, write your own modules and features for it, include it on your lastest freeware CDROM, incorporate all the cool utility classes into a product of your own, write a tract module for the program and sneak it onto all of your co-workers' computers and blame it on a virus, make fun of your pastor for spending $400 dollars on a similar package, give it to your pastor who can't figure out how to use his $400 dollar package :) \\par\\par ";
+ newtext += "OK, if you still feel the need, you can help our organization out at: \\par\\par ";
+ newtext += "CrossWire Software & Bible Society \\par ";
+ newtext += "P. O. Box 2528 \\par ";
+ newtext += "Tempe, AZ 85280-2528 \\par\\par ";
+ newtext += "... but I must warn you, your contributions will probably just go toward paying my way through college, or to give me a little more time to spend on the project :) \\par\\par ";
+ newtext += "\tMay the peace of GOD consume your heart, \\par ";
+ newtext += "\t\tThe SWORD Project Development Team \\par ";
+ newtext += "_________________________________________ \\par ";
+ newtext += "Thanks be to God for all the wonderful people who have contributed in so many ways to make this project possible. These are just a few (I could not possibly name them all) who have directly contributed an abundance of their time and talents: \\par\\par ";
+ newtext += "Chris Little (the module-making machine!); All the people at The Source in Scottsdale for testing and suggestions; ";
+ newtext += "The Bible Foundation: Jerry Kingery, Jerry Hastings; Geoffrey W. Hastings; ";
+ newtext += "William Dicks; Everyone on b-greek@franklin.oit.unc.edu; Michael Paul Johnson; ";
+ newtext += "Roland Nygren; Bayu Gunawan; Bill Kincaid; Mark Fuller; Larry Pierce; Franklin Bratcher; ";
+ newtext += "Gregory Hall; Luis Cortes; Steve Hiner; Kristof Petr; Paul Gear and OpenBible; Chris Bitmead (go Scheme!); ";
+ newtext += "Brook Humphrey; Torsten Uhlmann, Joachim Ansorg, Darwin Gregory, Martin Gruner and the BibleTime Team; ";
+ newtext += "Darren DeMeulenaere; Terry Biggs and the GnomeSword Team; Daniel Glassey; David Trotz Jr.; Karl-Heinz Troyer and BibleWorkshop";
+ newtext += "\\par\\par ";
+ newtext += "{\\i And the list goes on...} \\par \\par ";
+ newtext += "{\\fs24 \\par }}";
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.length());
+ RTFStream->Position = 0;
+ CreditAbout->Lines->LoadFromStream(RTFStream);
+ delete RTFStream;
+}
+//---------------------------------------------------------------------------
+
+
+
+
+void __fastcall TAboutBox::ProgramIconMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{
+ if ((Shift.Contains(ssCtrl)) && (!Shift.Contains(ssAlt)) && (Button == mbRight)) {
+ TMemoryStream *RTFStream = new TMemoryStream();
+ string newtext = "{\\rtf1\\ansi{\\fonttbl{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;}";
+ newtext += "\\fs20 mainmgr->config: \\par\\par ";
+
+ SectionMap::iterator section;
+ ConfigEntMap::iterator entry;
+
+ for (section = Form1->mainmgr->config->Sections.begin(); section != Form1->mainmgr->config->Sections.end(); section++) {
+ newtext += "["; newtext += section->first.c_str(); newtext += "] \\par ";
+ for (entry = (*section).second.begin(); entry != (*section).second.end(); entry++) {
+ newtext += entry->first.c_str(); newtext += "="; newtext += entry->second.c_str(); newtext += "\\par ";
+ }
+ newtext += "\\par ";
+ }
+
+
+ newtext += "{\\fs24 \\par }}";
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.length());
+ RTFStream->Position = 0;
+ CreditAbout->Lines->LoadFromStream(RTFStream);
+ delete RTFStream;
+ }
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm
new file mode 100644
index 0000000..07cecd8
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm
@@ -0,0 +1,161 @@
+object AboutBox: TAboutBox
+ Left = 291
+ Top = 107
+ BorderStyle = bsDialog
+ Caption = 'About The SWORD Project'
+ ClientHeight = 448
+ ClientWidth = 417
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Icon.Data = {
+ 0000010001002020100000000000E80200001600000028000000200000004000
+ 0000010004000000000080020000000000000000000000000000000000000000
+ 000000008000008000000080800080000000800080008080000080808000C0C0
+ C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF006666
+ 6666666666666666666666666666688888888888888888088888888888866888
+ 8888888888888880888888888886688888888888888888808888888888866888
+ 8008888088008880800080008800688888088880880808808080808088006888
+ 8808888088080880800880888806688888008880080808880080808088066888
+ 8808080080800800080088008000688888080888888888888888888888066888
+ 8000088888888888888888888806688888888888888888880888888888866008
+ 8808880888877777777878888F86088088088808887888877788888888F60880
+ 800888078788888878878888888F6800808080878788888878878888888F6088
+ 808087878788888877788888888F0888088087887788888878888888888F0808
+ 0888788878788887788888F888F600000087778777877777777888FFFF866888
+ 8880888888888888888888888886688888880888888888888888888888866800
+ 8880808800088888888888888886688088808808080888888888888888866880
+ 8880080800888888888888888886688088800008080888888888888888866880
+ 8880880880088888888888888886088080808888888888888888888888860000
+ 0080888888888888888888888886688888808888888888888888888888866888
+ 8888088888888888888888888886666666660666666666666666666666660000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000000000000000000000000000}
+ OldCreateOrder = True
+ Position = poScreenCenter
+ Scaled = False
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 417
+ Height = 407
+ Align = alClient
+ BevelInner = bvRaised
+ BevelOuter = bvLowered
+ ParentColor = True
+ TabOrder = 0
+ object ProgramIcon: TImage
+ Left = 8
+ Top = 8
+ Width = 33
+ Height = 33
+ Picture.Data = {
+ 055449636F6E0000010001002020100000000000E80200001600000028000000
+ 2000000040000000010004000000000080020000000000000000000000000000
+ 0000000000000000000080000080000000808000800000008000800080800000
+ 80808000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000
+ FFFFFF0066666666666666666666666666666666688888888888888888088888
+ 8888888668888888888888888880888888888886688888888888888888808888
+ 8888888668888008888088008880800080008800688888088880880808808080
+ 8080880068888808888088080880800880888806688888008880080808880080
+ 8080880668888808080080800800080088008000688888080888888888888888
+ 8888880668888000088888888888888888888806688888888888888888880888
+ 8888888660088808880888877777777878888F86088088088808887888877788
+ 888888F60880800888078788888878878888888F680080808087878888887887
+ 8888888F6088808087878788888877788888888F088808808788778888887888
+ 8888888F08080888788878788887788888F888F6000000877787778777777778
+ 88FFFF8668888880888888888888888888888886688888880888888888888888
+ 8888888668008880808800088888888888888886688088808808080888888888
+ 8888888668808880080800888888888888888886688088800008080888888888
+ 8888888668808880880880088888888888888886088080808888888888888888
+ 8888888600000080888888888888888888888886688888808888888888888888
+ 8888888668888888088888888888888888888886666666660666666666666666
+ 6666666600000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 00000000}
+ Stretch = True
+ OnMouseDown = ProgramIconMouseDown
+ IsControl = True
+ end
+ object ProductName: TLabel
+ Left = 52
+ Top = 8
+ Width = 285
+ Height = 17
+ AutoSize = False
+ Caption = 'The SWORD Project'
+ IsControl = True
+ end
+ object Version: TLabel
+ Left = 52
+ Top = 24
+ Width = 213
+ Height = 21
+ AutoSize = False
+ Caption = 'v1.5.4betaX'
+ IsControl = True
+ end
+ object Copyright: TLabel
+ Left = 8
+ Top = 48
+ Width = 398
+ Height = 17
+ Anchors = [akLeft, akTop, akRight]
+ AutoSize = False
+ Caption = '(c) 2002; GNU GPL Copyleft, CrossWire Bible Society'
+ WordWrap = True
+ IsControl = True
+ end
+ object CreditAbout: TRichEdit
+ Left = 8
+ Top = 245
+ Width = 401
+ Height = 155
+ Anchors = [akLeft, akTop, akRight, akBottom]
+ Color = clBtnFace
+ ReadOnly = True
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object ModulesAbout: TRichEdit
+ Left = 8
+ Top = 68
+ Width = 401
+ Height = 169
+ Anchors = [akLeft, akTop, akRight]
+ Color = clBtnFace
+ ReadOnly = True
+ ScrollBars = ssVertical
+ TabOrder = 1
+ end
+ end
+ object Panel2: TPanel
+ Left = 0
+ Top = 407
+ Width = 417
+ Height = 41
+ Align = alBottom
+ TabOrder = 1
+ object OKButton: TButton
+ Left = 318
+ Top = 8
+ Width = 93
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = 'OK'
+ Default = True
+ ModalResult = 1
+ TabOrder = 0
+ end
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp
new file mode 100644
index 0000000..d336056
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp
@@ -0,0 +1,37 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include "DevOfTheDay.h"
+#include "mainfrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TDevOfTheDay2 *DevOfTheDay2;
+//---------------------------------------------------------------------------
+__fastcall TDevOfTheDay2::TDevOfTheDay2(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TDevOfTheDay2::btnOKClick(TObject *Sender)
+{
+ DevOfTheDay2->Hide();
+ ConfigEntMap emap;
+ SWConfig * optionsconf;
+ optionsconf = dynamic_cast<TForm1*>(Application->MainForm)->optionsconf;
+ if(optionsconf)
+ {
+ emap = optionsconf->Sections["General"];
+ emap.erase("TipOfTheDay");
+ emap.insert(ConfigEntMap::value_type("TipOfTheDay", (DevOfTheDay2->ckShowTip->Checked) ? "Devotional" : ""));
+ optionsconf->Sections["General"] = emap;
+ optionsconf->Save();
+ }
+
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm
new file mode 100644
index 0000000..9c3f8b9
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm
@@ -0,0 +1,383 @@
+object DevOfTheDay2: TDevOfTheDay2
+ Left = 405
+ Top = 100
+ Width = 427
+ Height = 368
+ BiDiMode = bdLeftToRight
+ Caption = 'Devotion for Today'
+ Color = clBtnFace
+ Constraints.MinHeight = 277
+ Constraints.MinWidth = 362
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ FormStyle = fsStayOnTop
+ OldCreateOrder = False
+ ParentBiDiMode = False
+ Position = poScreenCenter
+ Scaled = False
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Panel1: TPanel
+ Left = 0
+ Top = 69
+ Width = 419
+ Height = 231
+ Align = alClient
+ AutoSize = True
+ BevelOuter = bvNone
+ Caption = 'Panel1'
+ TabOrder = 0
+ object RichTip: TRichEdit
+ Left = 0
+ Top = 0
+ Width = 419
+ Height = 231
+ Align = alClient
+ BorderStyle = bsNone
+ PlainText = True
+ ReadOnly = True
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ end
+ object Panel3: TPanel
+ Left = 0
+ Top = 300
+ Width = 419
+ Height = 41
+ Align = alBottom
+ TabOrder = 1
+ object ckShowTip: TCheckBox
+ Left = 8
+ Top = 12
+ Width = 152
+ Height = 17
+ Anchors = [akLeft, akBottom]
+ Caption = 'Show Devotional at Startup'
+ TabOrder = 0
+ end
+ object btnOK: TButton
+ Left = 338
+ Top = 9
+ Width = 73
+ Height = 24
+ Anchors = [akRight, akBottom]
+ Caption = '&Close'
+ TabOrder = 1
+ OnClick = btnOKClick
+ end
+ end
+ object Panel4: TPanel
+ Left = 0
+ Top = 0
+ Width = 419
+ Height = 69
+ Align = alTop
+ BevelOuter = bvNone
+ Caption = 'Panel4'
+ Color = clWindow
+ TabOrder = 2
+ object bmpDev: TImage
+ Left = 0
+ Top = 0
+ Width = 52
+ Height = 69
+ Align = alLeft
+ Enabled = False
+ Picture.Data = {
+ 07544269746D61700E220000424D0E2200000000000076000000280000005601
+ 0000320000000100040000000000982100000000000000000000100000000000
+ 0000000000000000800000800000008080008000000080008000808000008080
+ 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
+ FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF00000000000000000000
+ 000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF
+ FFFF01100000000000077000000000000110FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF00FFFFFFFF01077777777770000000777777777010FFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF010777000000
+ 07700077000000777010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF00FFFFFFFF01000088877777000807777888000010FFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0088888887770070088007788888
+ 8800FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0088
+ 8888800077080888800088888800FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00F
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFF00FFFFFFFF00888800088777080888888800088800FFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF00800088888770880888
+ 8888FFF00000FFFFFFFFFFFFFFFFFF000FFFFFFF000FFFFFF00000FFFF00FFFF
+ FF0000F00FFFF00000FFFFFFFFFFFF00FFFFFFFF00000FFFFFFFFFF00000000F
+ F00FFFFF0FFFFFFF00000FFFFFFFFFF00000000FFFFFFF00FFFFF00FFF00FFF0
+ 0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF
+ FFFF0080FF888887708808888888FFFFF000FFFFFFFFFFFFFFFFFF000FFFFFFF
+ 000FFFFF0000000FFF00FFFFF00000000FFF0000000FFFFFFFFFFF00FFFFFFF0
+ 000000FFFFFFFFF00000000FF00FFFF000FFFFF0000000FFFFFFFFF000000000
+ FFFFFF00FFFFF00FFF00FFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF00FFFFFFFF0080FF888887088808888888FFFFF000FFFF
+ FFFFFFFFFFFFF00F00FFFFF00F00FFF000FFF000FF00FFFF000FFF000FF00FFF
+ F00FFFFFFFFFFF00FFFFFF000FFF000FFFFFFFF00FFFFFFFF00FFFF000FFFF00
+ 0FFFF00FFFFFFFF00FFFFF000FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0080FF888880
+ 888808888888FFFFF000FFFFFFFFFFFFFFFFF00F00FFFFF00F00FFF00FFFFF00
+ FF00FFFF00FFFFF00FFFFFFF000FFFFFFFFFFF00FFFFFF00FFFFF00FFFFFFFF0
+ 0FFFFFFFF00FFF00F00FFF00FFFFFFFFFFFFFFF00FFFFFF00FFFF0000FFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF00FFFFFFFF0080FF888808888808888888FFFFF000FFFFFFFFFFFFFFFFF00F
+ 00FFFFF00F00FFF00FFFFF00FF00FFFF00FFFFF00FFFFF0000FFFFFFFFFFFF00
+ FFFFFF00FFFFF00FFFFFFFF00FFFFFFFF00FFF00F00FFF000000000FFFFFFFF0
+ 0FFFFFF00FFF00F00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0080FF8000F8888808888888FFFF
+ F000FFFFFFFFFFFFFFFFF00FF00FFF00FF00FFF00FFFFF00FF00FFFF00FFFFF0
+ 0FFF0000FFFFFFFFFFFFFF00FFFFFF00FFFFF00FFFFFFFF00FFFFFFFF00FF00F
+ FF00FF000000000FFFFFFFF00FFFFF00FFFF00FF00FFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0080
+ FF80FFF8888808888888FFFFF000FFFFFFFFFFFFFFFFF00FF00FFF00FF00FFF0
+ 0FFFFF00FF00FFFF00FFFFF00FF000FFFFFFFFFFFFFFFF00FFFFFF00FFFFF00F
+ FFFFFFF00FFFFFFFF00FF00FFF00FF00FFFFF00FFFFFFFF00000000FFFF00FFF
+ 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFF00FFFFFFFF0080FF80FFF8888808888888FFFFF000FFFFFFFFFFFF
+ FFFF00FFF00FFF00FFF00FF000FFF000FF000FFF000FFF000FF00FFFF00FFFFF
+ FFFFFF00FFFFFF000FFF000FFFFFFFF00FFFFFFFF00FF00FFF00FF000FFF00FF
+ FFFFFFF00000000FFFF00FFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF00880F80FFF888880888
+ 8888FFFF0F00FFFFFFFFFFFFFFFF00FFF00FFF00FFF00FFF0000000FFF00000F
+ F00000000FF0000000FFFFFFFFFFFF00FFFFFFF0000000FFFFFFFFF00FFFFFFF
+ F00F00FFFFF00FF0000000FFFFFFFFF00FFFF000FF00FFFFF00FFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF
+ FFFF00880F80FFF8888808888888FFFF0F00FFFFFFFFFFFFFFFF00FFFF00F00F
+ FFF00FFFF00000FFFF00F00FFF0000F00FFF00000FFFFFFFFFFFFF00FFFFFFFF
+ 00000FFFFFFFFFF00FFFFFFFF00F00FFFFF00FFF00000FFFFFFFFFF00FFFFF00
+ FF00FFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF00FFFFFFFF00880F80FFF8888000088888FFFF0F00FFFF
+ FFFFFFFFFFFF00FFFF00F00FFFF00FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFF
+ FFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFF00FFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF00880F80FFF8
+ 880088008888FFFF0F00FFFFFFFFFFFFFFFF00FFFF00F00FFFF00FFFFFFFFFFF
+ FFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFF0
+ 0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF000FFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF00FFFFFFFF00880F80FFF8880777708888FFFF0F00FFFFFFFFFFFFFFF00FFF
+ FFF000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFF000000
+ 0000FFFFFFFFFFFFFFFFFFF00FFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF0
+ 0000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFF0880F80FFF8880888808888FFFF
+ 0F0FFFFFFFFFFFFFFFF00FFFFFF000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFF0
+ 0FFFFFFFFFFFFFFFFF0000000000FFFFFFFFFFFFFFFFFFF00FFFFFFFF00FFFFF
+ FFFFFFFFFFFFFFFFFFFFFFF0000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFF088
+ 0F80FFF8880777708888FFFF0F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFF00FFFFFFFFF0880F880FF8880BBBB08888FFFF0F0FFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFF0000F880FF880BBBBBB
+ 0888FFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF
+ FFFFFFFF0F880FF80BBB00BBB088FFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF0F880FF0BBBB00BBBB08FFF0FFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF0F880F0B
+ BBBBBBBBBBB00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF00FFFFFFFFFFFF00000F0BBBBB00BBBBBB0FFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFF00BBBBBB00BBBBBB0FFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFB
+ FBFB00BBBBBB00BBBBBB0FBFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFF00FFFFFFFFFFF8887000BBBBBB00BBBBBB0F07888FFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFBFBFBF0BBBBBB00BB
+ BBBB0FBFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF
+ FFFFFFFFFFFFF0BBBBBB00BBBBBB0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFF0FF0BBBBB00BBBBB0FF0FFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFF0
+ BBBBBBBBBB0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF00FFFFFFFFFFFFFFFFFFFF00BBBBBB00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFB0FFFF000000FFFF0BFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF
+ FFFF7BFFFFFFFFFFFFFFB7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFF00FFFFFFFFFFFFFFB8FFFF0FFB0BFF0FFFFF8BFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFF8BFFFFFFFF7FFF
+ FFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF
+ FFFFFFFFFFFFFFFFFFFB7BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFF8FFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFF
+ FFFB8BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+ FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00}
+ Transparent = True
+ end
+ object Label1: TLabel
+ Left = 52
+ Top = 0
+ Width = 367
+ Height = 69
+ Align = alClient
+ Caption = 'Words To Live By...'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -21
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentColor = False
+ ParentFont = False
+ Layout = tlCenter
+ end
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h
new file mode 100644
index 0000000..267330a
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h
@@ -0,0 +1,33 @@
+//---------------------------------------------------------------------------
+
+#ifndef DevOfTheDayH
+#define DevOfTheDayH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ComCtrls.hpp>
+#include <ExtCtrls.hpp>
+#include <Graphics.hpp>
+//---------------------------------------------------------------------------
+class TDevOfTheDay2 : public TForm
+{
+__published: // IDE-managed Components
+ TRichEdit *RichTip;
+ TPanel *Panel1;
+ TPanel *Panel3;
+ TCheckBox *ckShowTip;
+ TButton *btnOK;
+ TPanel *Panel4;
+ TImage *bmpDev;
+ TLabel *Label1;
+ void __fastcall btnOKClick(TObject *Sender);
+private: // User declarations
+public: // User declarations
+ __fastcall TDevOfTheDay2(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TDevOfTheDay2 *DevOfTheDay2;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/BibleCS/ModVisFrm.cpp b/apps/windoze/CBuilder5/BibleCS/ModVisFrm.cpp
new file mode 100644
index 0000000..64f791e
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/ModVisFrm.cpp
@@ -0,0 +1,50 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include "ModVisFrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TModVisForm *ModVisForm;
+//---------------------------------------------------------------------------
+__fastcall TModVisForm::TModVisForm(TComponent* Owner)
+ : TForm(Owner)
+{
+ section = 0; // set this before calling Show...
+ mgr = 0; // set this before calling Show...
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TModVisForm::FormShow(TObject *Sender)
+{
+ ConfigEntMap::iterator it;
+ ModMap::iterator mit;
+ TListItem *item;
+ modList->Items->Clear();
+ for (it = section->begin(); it != section->end(); it++) {
+ mit = mgr->Modules.find(it->first);
+ SWModule *module = (mit != mgr->Modules.end()) ? mit->second : 0;
+ if (module) {
+ item = modList->Items->Add();
+ item->Caption = it->first.c_str();
+ item->SubItems->Add(module->Description());
+ item->Checked = (it->second == "true");
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TModVisForm::FormClose(TObject *Sender,
+ TCloseAction &Action)
+{
+ if (this->ModalResult == mrOk) {
+ for (int i = 0; i < modList->Items->Count; i++) {
+ string name = modList->Items->Item[i]->Caption.c_str();
+ (*section)[name] = (modList->Items->Item[i]->Checked) ? "true" : "false";
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/BibleCS/ModVisFrm.h b/apps/windoze/CBuilder5/BibleCS/ModVisFrm.h
new file mode 100644
index 0000000..d3fa99d
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/ModVisFrm.h
@@ -0,0 +1,37 @@
+//---------------------------------------------------------------------------
+
+#ifndef ModVisFrmH
+#define ModVisFrmH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <CheckLst.hpp>
+#include <ExtCtrls.hpp>
+#include <swconfig.h>
+#include <swmgr.h>
+#include <ComCtrls.hpp>
+//---------------------------------------------------------------------------
+class TModVisForm : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *Panel2;
+ TPanel *Panel1;
+ TBitBtn *OkBtn;
+ TBitBtn *CancelBtn;
+ TListView *modList;
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
+private: // User declarations
+public: // User declarations
+ ConfigEntMap *section;
+ SWMgr *mgr;
+
+ __fastcall TModVisForm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TModVisForm *ModVisForm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp b/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp
new file mode 100644
index 0000000..9d6b85f
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp
@@ -0,0 +1,441 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include "PrintFrm.h"
+#include "mainfrm.h"
+#include <Printers.hpp>
+#include <Math.hpp>
+#include <localemgr.h>
+#include "PreviewForm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma link "RxCombos"
+#pragma resource "*.dfm"
+TPrintForm *PrintForm;
+
+//---------------------------------------------------------------------------
+__fastcall TPrintForm::TPrintForm(TComponent* Owner)
+ : TForm(Owner)
+{
+ rtfPrint = new TRxRichEditX(this);
+ rtfPrint->Parent = this;
+ rtfPrint->Visible = false;
+ rtfPrint->Font->Name = "Arial";
+
+ // Put in the RXLib Font combobox component
+ cmbFont = new TFontComboBox(this);
+ cmbFont->Parent = pnlFontComboBox;
+ cmbFont->Align = alClient;
+ cmbFont->Font->Size = 12;
+ cmbFont->ParentFont = true;
+ cmbFont->UseFonts = true;
+ cmbFont->ItemIndex = cmbFont->Items->IndexOf("Arial");
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::FormShow(TObject *Sender)
+{
+
+ if(Form1->optionsconf->Sections["Printing"]["Notice"] != "1"){
+ Application->MessageBox("This release of The Sword Printer is preliminary and is not yet fully functional, therefore some of the features here have been disabled. Please be sure to take a look at the formatting options to be able to fully take control of how your page will look. Also be sure to use the \"Print Preview\" feature to preview how your page(s) will look on paper before printing. Enjoy! From, The Sword Project Development Team!", "The Sword Printer", MB_ICONINFORMATION | MB_OK);
+ Form1->optionsconf->Sections["Printing"]["Notice"] = "1";
+ Form1->optionsconf->Save();
+ }
+ ConfigEntMap::iterator eit;
+ AnsiString fontName;
+ BibleCSMGR *manager = Form1->mainmgr;
+ ModMap::iterator mods;
+ TPageControl* pc;
+
+ if ((Form1->ActiveControl == Form1->CommentaryPageControl) || (IsChild(Form1->CommentaryPageControl->Handle, Form1->ActiveControl->Handle))){
+ pc = Form1->CommentaryPageControl;
+ radComm->Checked = true;
+ staticRange->Caption = "Verse Range or List";
+ editStart->Text = Form1->DefaultVSKey->getText();
+ }
+ else if ((Form1->ActiveControl == Form1->LexDictPageControl) || (IsChild(Form1->LexDictPageControl->Handle, Form1->ActiveControl->Handle))){
+ pc = Form1->LexDictPageControl;
+ radLD->Checked = true;
+ staticRange->Caption = "Lookup Range";
+ editStart->Text = Form1->DictKeyEdit->Text;
+ }
+ else{
+ pc = Form1->TextPageControl;
+ radText->Checked = true;
+ staticRange->Caption = "Verse Range or List";
+ editStart->Text = Form1->DefaultVSKey->getText();
+ }
+ FillModuleCombo();
+
+ AnsiString temp;
+ for(int count = 0; count < cmbModule->Items->Count; count++){
+ temp = cmbModule->Items->Strings[count].SubString(2, cmbModule->Items->Strings[count].Pos("]") - 2);
+ if(temp == pc->ActivePage->Caption)
+ cmbModule->ItemIndex = count;
+ }
+ SetHint();
+ fontName = ((eit = Form1->optionsconf->Sections["PrintPrefs"].find("PrintFontName")) != Form1->optionsconf->Sections["PrintPrefs"].end())? (*eit).second.c_str() : "Times New Roman";
+ cmbFont->ItemIndex = cmbFont->Items->IndexOf(fontName);
+ PageControl1->ActivePage = shtSelection;
+
+ SetDefaultOps();
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::btnCloseClick(TObject *Sender)
+{
+ Close();
+}
+//---------------------------------------------------------------------------
+
+
+void TPrintForm::FillModuleCombo()
+{
+ TStringList *moduleNames = new TStringList;
+ BibleCSMGR *manager = Form1->mainmgr;
+ ModMap::iterator mods;
+ AnsiString modName;
+
+ for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) {
+ modName = "[" + (AnsiString)mods->second->Name() + "] " + (AnsiString)mods->second->Description();
+ if(!strncmp(mods->second->Type(), "Bibl", 4) && radText->Checked){
+ moduleNames->Add(modName);
+ }else if(!strncmp(mods->second->Type(), "Comm", 4) && radComm->Checked){
+ moduleNames->Add(modName);
+ }else if(!strncmp(mods->second->Type(), "Lexi", 4) && radLD->Checked){
+ moduleNames->Add(modName);
+ }
+ }
+ cmbModule->Items = moduleNames;
+ cmbModule->ItemIndex = 0;
+}
+
+void __fastcall TPrintForm::radTextClick(TObject *Sender)
+{
+ cmbModule->Enabled = true;
+ staticRange->Caption = _tr("Verse Range or List");
+ SetHint();
+ FillModuleCombo();
+ SetDefaultOps();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::radCommClick(TObject *Sender)
+{
+ staticRange->Caption = _tr("Verse Range or List");
+ SetHint();
+ FillModuleCombo();
+ SetDefaultOps();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::radLDClick(TObject *Sender)
+{
+ cmbModule->Enabled = true;
+ staticRange->Caption = _tr("Lookup Entry");
+ SetHint();
+ FillModuleCombo();
+ SetDefaultOps();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::spinLeftClick(TObject *Sender,
+ TUDBtnType Button)
+{
+ if(Button == Comctrls::btNext)
+ editLeft->Text = FloatToStr(StrToFloat(editLeft->Text) + .05);
+ else
+ editLeft->Text = FloatToStr(StrToFloat(editLeft->Text) - .05);
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::spinRightClick(TObject *Sender,
+ TUDBtnType Button)
+{
+ if(Button == Comctrls::btNext)
+ editRight->Text = FloatToStr(StrToFloat(editRight->Text) + .05);
+ else
+ editRight->Text = FloatToStr(StrToFloat(editRight->Text) - .05);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::spinBottomClick(TObject *Sender,
+ TUDBtnType Button)
+{
+ if(Button == Comctrls::btNext)
+ editBottom->Text = FloatToStr(StrToFloat(editBottom->Text) + .05);
+ else
+ editBottom->Text = FloatToStr(StrToFloat(editBottom->Text) - .05);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::spinTopClick(TObject *Sender,
+ TUDBtnType Button)
+{
+ if(Button == Comctrls::btNext)
+ editTop->Text = FloatToStr(StrToFloat(editTop->Text) + .05);
+ else
+ editTop->Text = FloatToStr(StrToFloat(editTop->Text) - .05);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::btnPrintClick(TObject *Sender)
+{
+ if(cmbModule->Text.data() != NULL && editStart->Text.data() != NULL){
+ PrepareRTF();
+ OnPrint(rtfPrint);
+ }
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::OnPrint(TRxRichEdit* rtfPrint)
+{
+/* TODO 2 -oDavid -cPrinting : Add Printing of Headers and Footers */
+ float leftMargin = StrToFloat(editLeft->Text),
+ rightMargin = StrToFloat(editRight->Text),
+ topMargin = StrToFloat(editTop->Text),
+ bottomMargin = StrToFloat(editBottom->Text);
+
+ // Sets the font we will use for the headers and footers
+ Printer()->Canvas->Font->Name = "Arial";
+ Printer()->Canvas->Font->Size = -8;
+ Printer()->Canvas->Font->Color = clBlack;
+
+ int wPage = ::GetDeviceCaps(Printer()->Handle, PHYSICALWIDTH);
+ int hPage = ::GetDeviceCaps(Printer()->Handle, PHYSICALHEIGHT);
+
+ int xPPI = ::GetDeviceCaps(Printer()->Handle, LOGPIXELSX);
+ int yPPI = ::GetDeviceCaps(Printer()->Handle, LOGPIXELSY);
+
+ int wTwips = ::MulDiv(wPage, 1440, xPPI);
+ int hTwips = ::MulDiv(hPage, 1440, yPPI);
+ /*
+ // Adjust for the headers and footers if needed
+ if(ckHeader->Checked){
+ int headerCoord = hTwips;
+ hTwips -= (Printer()->Canvas->Font->Height + (.25 * Printer()->Canvas->Font->Height));
+ }
+ if(ckFooter->Checked){
+ int footerCoord = hTwips;
+ hTwips -= (Printer()->Canvas->Font->Height + (.25 * Printer()->Canvas->Font->Height));
+ }
+ */
+
+ RECT pageRect;
+ pageRect.left = pageRect.top = 0;
+ pageRect.right = wTwips;
+ pageRect.bottom = hTwips;
+
+ RECT rendRect;
+ rendRect.left = rendRect.top = 0;
+ rendRect.right = pageRect.right - 1440 * (leftMargin + rightMargin);
+ rendRect.bottom = pageRect.bottom - 1440 * (topMargin + bottomMargin);
+
+ std::vector<TPageOffsets> FPageOffsets;
+
+ TPageOffsets po;
+ po.Start = 0;
+
+ TFormatRange fr;
+ fr.hdc = Printer()->Handle;
+ fr.hdcTarget = Printer()->Handle;
+ fr.chrg.cpMin = po.Start;
+ fr.chrg.cpMax = -1;
+
+ int lastOffset = ::SendMessage(rtfPrint->Handle, WM_GETTEXTLENGTH, 0, 0);
+
+ ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE, (WPARAM) 0, (LPARAM) 0);
+
+ ::SaveDC(fr.hdc);
+ ::SetMapMode(fr.hdc, MM_TEXT);
+ int xOffset = -::GetDeviceCaps(Printer()->Handle, PHYSICALOFFSETX);
+ int yOffset = -::GetDeviceCaps(Printer()->Handle, PHYSICALOFFSETY);
+ xOffset += ::MulDiv((leftMargin * 1440), xPPI, 1440);
+ yOffset += ::MulDiv((topMargin * 1440), yPPI, 1440);
+ ::SetViewportOrgEx(fr.hdc, xOffset, yOffset, NULL);
+
+ do {
+ fr.rc = rendRect;
+ fr.rcPage = pageRect;
+ po.Start = fr.chrg.cpMin;
+ fr.chrg.cpMin = ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE,(WPARAM) 0, (LPARAM) &fr);
+ // I don't know why I need to do this, but there is an apparent bug in the TRXRichEdit control
+ // and it doesn't handle the last page properly if there are more than 3 pages of text.
+ if(fr.chrg.cpMin == po.End)
+ fr.chrg.cpMin = lastOffset;
+ po.End = fr.chrg.cpMin - 1;
+ po.rendRect = fr.rc;
+ if(fr.chrg.cpMin < lastOffset)
+ FPageOffsets.push_back(po);
+ } while (fr.chrg.cpMin != -1 && fr.chrg.cpMin < lastOffset);
+
+ int pageCount = FPageOffsets.size();
+ ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE, (WPARAM) 0, (LPARAM) 0);
+ ::RestoreDC(fr.hdc, -1);
+
+ Printer()->BeginDoc();
+ fr.hdc = Printer()->Handle;
+ fr.hdcTarget = Printer()->Handle;
+ ::SaveDC(fr.hdc);
+ /*
+ if(ckHeader->Checked == true){
+ Printer()->Canvas->TextOut(100,100,"This is my test");
+ }
+ */
+
+ bool firstPage = true;
+ int currPage = 0;
+
+ do {
+ if (firstPage) firstPage = false;
+ else Printer()->NewPage();
+ ::SetViewportOrgEx(fr.hdc, xOffset, yOffset, NULL);
+ fr.rc = FPageOffsets[currPage].rendRect;
+ fr.rcPage = pageRect;
+ fr.chrg.cpMin = FPageOffsets[currPage].Start;
+ fr.chrg.cpMax = FPageOffsets[currPage].End;
+ fr.chrg.cpMin = ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE, (WPARAM) 1, (LPARAM) &fr);
+ } while (++currPage < pageCount);
+
+ ::RestoreDC(fr.hdc, -1);
+ Printer()->EndDoc();
+
+ ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE, (WPARAM) 0, (LPARAM) 0);
+ FPageOffsets.erase(FPageOffsets.begin(), FPageOffsets.end());
+}
+
+void TPrintForm::SetHint()
+{
+ TStringList* strList = new TStringList;
+ if(radText->Checked || radComm->Checked){
+ strList->Add("Examples:");
+ strList->Add("John 1:1 Prints John chapter 1 verse 1");
+ strList->Add("John 1 Prints the entire first chapter of John");
+ strList->Add("John 1,2 Prints chapters 1 and 2 of John");
+ strList->Add("John 3:16;Rom 3:23 Prints John 3:16 and Romans 3:23");
+ }else{
+ strList->Add("Examples:");
+ /* TODO 2 -oDavid -cPrinting : Make printing ranges of dictionaries work */
+ // The ranges don't work yet.
+ //strList->Add("Aaron - David Prints dictionary entries from Aaron to David");
+ strList->Add("Jesus Prints dictionary entry for Jesus");
+ //strList->Add("0051 - 0054 Prints dictionary entry for range 0051 to 0054");
+ strList->Add("0051 Prints dictionary entry for 0051");
+ }
+ editStart->Hint = strList->Text;
+ delete strList;
+}
+
+void __fastcall TPrintForm::btnSetupClick(TObject *Sender)
+{
+ PrinterSetupDialog->Execute();
+}
+//---------------------------------------------------------------------------
+void __fastcall TPrintForm::BitBtn5Click(TObject *Sender)
+{
+ //To do
+}
+//---------------------------------------------------------------------------
+
+void TPrintForm::PrepareRTF()
+{
+ BibleCSMGR* manager = Form1->mainmgr;
+ RTF_FORMAT format;
+ AnsiString newtext = "";
+ AnsiString moduleName = cmbModule->Text.SubString(2,cmbModule->Text.Pos("]") - 2);
+ SWModule *module = manager->Modules[moduleName.c_str()];
+ ListKey lstKey;
+ StrKey testKey;
+
+ format.bkFontHeadSize = 2 * editHeading->Text.ToInt();
+ format.bodyFontSize = 2 * editBody->Text.ToInt();
+ format.vsNumFontSize = 2 * editNumbers->Text.ToInt();
+ format.chFontHeadSize = 2 * editHeading->Text.ToInt();
+ format.fontFace = cmbFont->Text;
+ format.paragraph = ckParagraph->Checked;
+ format.prBookHeadings = ckBookHead->Checked;
+ format.prChHeadings = ckChHead->Checked;
+ format.prPreFix = ckPrefix->Checked;
+ format.prPostFix = ckPostfix->Checked;
+ format.prVerseNum = ckVSNum->Checked;
+ format.superVSNum = ckSuperVS->Checked;
+
+ lstKey.Persist(1);
+ if(!radLD->Checked){
+ lstKey = VerseKey().ParseVerseList(editStart->Text.c_str(),*(Form1->DefaultVSKey), true);
+ module->SetKey(&lstKey);
+ rtfPrint->RenderModule(module, format);
+ module->SetKey(Form1->DefaultVSKey);
+ }
+ else{
+ testKey.setText(WideStringToUTF8(editStart->Text).c_str());
+ lstKey << testKey;
+ module->SetKey(&lstKey);
+ rtfPrint->RenderModule(module, format);
+ module->SetKey(Form1->DefaultStrKey);
+ }
+}
+
+void __fastcall TPrintForm::btnPreviewClick(TObject *Sender)
+{
+ if(cmbModule->Text.data() != NULL && editStart->Text.data() != NULL){
+ PrepareRTF();
+ PreviewForm->currPage = 0;
+ if(PreviewForm->ShowModal() == mrOk)
+ OnPrint(rtfPrint);
+ }
+}
+void __fastcall TPrintForm::ckHeaderClick(TObject *Sender)
+{
+ editHeader->Enabled = ckHeader->Checked;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::ckFooterClick(TObject *Sender)
+{
+ editFooter->Enabled = ckFooter->Checked;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TPrintForm::ckVSNumClick(TObject *Sender)
+{
+ ckSuperVS->Enabled = ckVSNum->Checked;
+}
+//---------------------------------------------------------------------------
+
+
+void TPrintForm::SetDefaultOps()
+{
+ if(radText->Checked){
+ ckBookHead->Checked = true;
+ ckChHead->Checked = true;
+ ckParagraph->Checked = true;
+ ckVSNum->Checked = true;
+ ckSuperVS->Checked = true;
+ ckPrefix->Checked = false;
+ ckPostfix->Checked = false;
+ }else if(radComm->Checked){
+ ckBookHead->Checked = false;
+ ckChHead->Checked = false;
+ ckParagraph->Checked = false;
+ ckVSNum->Checked = false;
+ ckSuperVS->Checked = false;
+ ckPrefix->Checked = false;
+ ckPostfix->Checked = true;
+ }else if(radLD->Checked){
+ ckBookHead->Checked = false;
+ ckChHead->Checked = false;
+ ckParagraph->Checked = false;
+ ckVSNum->Checked = false;
+ ckSuperVS->Checked = false;
+ ckPrefix->Checked = false;
+ ckPostfix->Checked = false;
+ }
+
+}
+
diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm b/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm
new file mode 100644
index 0000000..2385ae1
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm
@@ -0,0 +1,565 @@
+object PrintForm: TPrintForm
+ Left = 384
+ Top = 205
+ Width = 550
+ Height = 310
+ AutoSize = True
+ Caption = 'The Sword Printer'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ OldCreateOrder = False
+ Position = poMainFormCenter
+ Scaled = False
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Panel1: TPanel
+ Left = 450
+ Top = 0
+ Width = 92
+ Height = 283
+ Align = alRight
+ BevelOuter = bvNone
+ TabOrder = 0
+ object btnPrint: TBitBtn
+ Left = 6
+ Top = 21
+ Width = 80
+ Height = 25
+ Caption = '&Print'
+ TabOrder = 0
+ OnClick = btnPrintClick
+ Glyph.Data = {
+ 66010000424D6601000000000000760000002800000014000000140000000100
+ 040000000000F000000000000000000000001000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00666666666666
+ 6666666600006666666666666666666600006666666666666666666600006666
+ 0000000000066666000066608888888880806666000066000000000000080666
+ 0000660888888BBB880006660000660888888777880806660000660000000000
+ 0008806600006608888888888080806600006660000000000808006600006666
+ 0FFFFFFFF08080660000666660F00000F00006660000666660FFFFFFFF066666
+ 00006666660F00000F06666600006666660FFFFFFFF066660000666666600000
+ 0000666600006666666666666666666600006666666666666666666600006666
+ 66666666666666660000}
+ Margin = 2
+ end
+ object btnSetup: TBitBtn
+ Left = 7
+ Top = 90
+ Width = 80
+ Height = 25
+ Caption = 'Printer&s...'
+ TabOrder = 1
+ OnClick = btnSetupClick
+ Glyph.Data = {
+ 66010000424D6601000000000000760000002800000014000000140000000100
+ 040000000000F000000000000000000000001000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF
+ FFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFF00FFFFF0000FFFF
+ FFFFFFFF4EC0FFFF0000FFFF00000004ECC0FFFF0000FFF08888884ECC80FFFF
+ 0000FF00000000ECC0080FFF0000FF08870078CC88000FFF0000FF0878E80777
+ 88080FFF0000FF07FE8E8000000880FF0000FF07EFE8E088808080FF0000FFF7
+ FEFE8000080800FF0000FFFF7FEF0FFFF08080FF0000FFFFF770F000F0000FFF
+ 0000FFFFF0FFFFFFFF0FFFFF0000FFFFFF0F00000F0FFFFF0000FFFFFF0FFFFF
+ FFF0FFFF0000FFFFFFF000000000FFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF
+ FFFFFFFFFFFFFFFF0000}
+ Margin = 2
+ end
+ object btnPreview: TBitBtn
+ Left = 7
+ Top = 55
+ Width = 80
+ Height = 25
+ Caption = 'P&review...'
+ TabOrder = 2
+ OnClick = btnPreviewClick
+ Glyph.Data = {
+ 66010000424D6601000000000000760000002800000014000000140000000100
+ 040000000000F000000000000000000000001000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00666666666666
+ 6666666600006666666666666666666600006666666666666666600600006600
+ 00000000006607060000660FFFFFFFFFF06070660000660FFFFFFF0000070666
+ 0000660FFFFFF078870066660000660FFFFF0788E77066660000660FFFFF0888
+ 878066660000660FFFFF08E8878066660000660FFFFF07EE877066660000660F
+ FFFFF078870666660000660FFFFFFF00006666660000660FFFFFFFFFF0666666
+ 0000660FFFFFFF00006666660000660FFFFFFF7F066666660000660FFFFFFF70
+ 6666666600006600000000066666666600006666666666666666666600006666
+ 66666666666666660000}
+ Margin = 2
+ end
+ object btnClose: TBitBtn
+ Left = 7
+ Top = 125
+ Width = 80
+ Height = 25
+ Caption = '&Close'
+ TabOrder = 3
+ OnClick = btnCloseClick
+ Glyph.Data = {
+ 66010000424D6601000000000000760000002800000014000000140000000100
+ 040000000000F000000000000000000000001000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF
+ FFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF
+ F0FFFFFFFFFF0FFF0000FFFF000FFFFFFFFFFFFF0000FFFF0000FFFFFFF0FFFF
+ 0000FFFFF000FFFFFF0FFFFF0000FFFFFF000FFFF00FFFFF0000FFFFFFF000FF
+ 00FFFFFF0000FFFFFFFF00000FFFFFFF0000FFFFFFFFF000FFFFFFFF0000FFFF
+ FFFF00000FFFFFFF0000FFFFFFF000FF00FFFFFF0000FFFFF0000FFFF00FFFFF
+ 0000FFFF0000FFFFFF00FFFF0000FFFF000FFFFFFFFF0FFF0000FFFFFFFFFFFF
+ FFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF
+ FFFFFFFFFFFFFFFF0000}
+ Margin = 2
+ end
+ end
+ object PageControl1: TPageControl
+ Left = 0
+ Top = 0
+ Width = 450
+ Height = 283
+ ActivePage = shtSelection
+ Align = alClient
+ TabOrder = 1
+ object shtSelection: TTabSheet
+ Caption = 'Print Selection'
+ object GroupBox1: TGroupBox
+ Left = 10
+ Top = 14
+ Width = 420
+ Height = 123
+ Caption = 'Print Source'
+ TabOrder = 0
+ object lblModName: TLabel
+ Left = 9
+ Top = 75
+ Width = 66
+ Height = 13
+ Caption = 'Module Name'
+ end
+ object radText: TRadioButton
+ Left = 8
+ Top = 17
+ Width = 105
+ Height = 17
+ Caption = 'Bible Text'
+ Checked = True
+ TabOrder = 0
+ TabStop = True
+ OnClick = radTextClick
+ end
+ object radComm: TRadioButton
+ Left = 8
+ Top = 35
+ Width = 105
+ Height = 17
+ Caption = 'Commentary Text'
+ TabOrder = 1
+ OnClick = radCommClick
+ end
+ object radLD: TRadioButton
+ Left = 8
+ Top = 54
+ Width = 137
+ Height = 17
+ Caption = 'Lexicon/Dictionary Text'
+ TabOrder = 2
+ OnClick = radLDClick
+ end
+ object cmbModule: TComboBox
+ Left = 8
+ Top = 91
+ Width = 264
+ Height = 21
+ ItemHeight = 13
+ TabOrder = 3
+ end
+ end
+ object GroupBox2: TGroupBox
+ Left = 10
+ Top = 152
+ Width = 420
+ Height = 71
+ Caption = 'Print Range'
+ TabOrder = 1
+ object staticRange: TLabel
+ Left = 8
+ Top = 16
+ Width = 46
+ Height = 13
+ Caption = 'Verse List'
+ end
+ object editStart: TEdit
+ Left = 8
+ Top = 31
+ Width = 264
+ Height = 21
+ Hint =
+ 'Examples:'#13#10'John 1:1 Prints John ' +
+ 'chapter 1 verse 1'#13#10'John 1 Pri' +
+ 'nts the entire first chapter of John'#13#10'John 1,2 ' +
+ ' Prints chapters 1 and 2 of John'#13#10'John 3:16;Rom 3:' +
+ '23 Prints John 3:16 and Romans 3:23'
+ ParentShowHint = False
+ ShowHint = True
+ TabOrder = 0
+ end
+ end
+ end
+ object shtSetup: TTabSheet
+ Caption = 'Page Setup'
+ ImageIndex = 1
+ object GroupBox4: TGroupBox
+ Left = 8
+ Top = 8
+ Width = 204
+ Height = 153
+ Caption = 'Margins (Inches)'
+ TabOrder = 0
+ object labelLeft: TLabel
+ Left = 15
+ Top = 38
+ Width = 21
+ Height = 13
+ Caption = 'Left:'
+ end
+ object labelBot: TLabel
+ Left = 122
+ Top = 91
+ Width = 36
+ Height = 13
+ Caption = 'Bottom:'
+ end
+ object labelRight: TLabel
+ Left = 123
+ Top = 40
+ Width = 28
+ Height = 13
+ Caption = 'Right:'
+ end
+ object labelTop: TLabel
+ Left = 15
+ Top = 88
+ Width = 22
+ Height = 13
+ Caption = 'Top:'
+ end
+ object editLeft: TEdit
+ Left = 15
+ Top = 53
+ Width = 44
+ Height = 21
+ TabOrder = 0
+ Text = '0.50'
+ end
+ object spinLeft: TUpDown
+ Left = 59
+ Top = 53
+ Width = 17
+ Height = 21
+ Min = 0
+ Position = 50
+ TabOrder = 1
+ Thousands = False
+ Wrap = False
+ OnClick = spinLeftClick
+ end
+ object editBottom: TEdit
+ Left = 122
+ Top = 105
+ Width = 44
+ Height = 21
+ TabOrder = 2
+ Text = '0.75'
+ end
+ object spinBottom: TUpDown
+ Left = 166
+ Top = 105
+ Width = 17
+ Height = 21
+ Min = 0
+ Position = 50
+ TabOrder = 3
+ Wrap = False
+ OnClick = spinBottomClick
+ end
+ object spinRight: TUpDown
+ Left = 166
+ Top = 55
+ Width = 17
+ Height = 21
+ Min = 0
+ Position = 50
+ TabOrder = 4
+ Wrap = False
+ OnClick = spinRightClick
+ end
+ object editRight: TEdit
+ Left = 122
+ Top = 55
+ Width = 44
+ Height = 21
+ TabOrder = 5
+ Text = '0.50'
+ end
+ object spinTop: TUpDown
+ Left = 59
+ Top = 103
+ Width = 17
+ Height = 21
+ Min = 0
+ Position = 50
+ TabOrder = 6
+ Wrap = False
+ OnClick = spinTopClick
+ end
+ object editTop: TEdit
+ Left = 15
+ Top = 103
+ Width = 44
+ Height = 21
+ TabOrder = 7
+ Text = '0.50'
+ end
+ end
+ object GroupBox5: TGroupBox
+ Left = 221
+ Top = 8
+ Width = 209
+ Height = 153
+ Caption = 'Header/Foooter'
+ TabOrder = 1
+ object labelHeader: TLabel
+ Left = 10
+ Top = 39
+ Width = 59
+ Height = 13
+ Caption = 'Header Text'
+ Enabled = False
+ end
+ object labelFooter: TLabel
+ Left = 10
+ Top = 104
+ Width = 54
+ Height = 13
+ Caption = 'Footer Text'
+ Enabled = False
+ end
+ object editHeader: TEdit
+ Left = 10
+ Top = 54
+ Width = 183
+ Height = 21
+ Enabled = False
+ TabOrder = 0
+ Text = '&d'
+ end
+ object editFooter: TEdit
+ Left = 10
+ Top = 120
+ Width = 183
+ Height = 21
+ Enabled = False
+ TabOrder = 1
+ Text = 'Page &p of &t'
+ end
+ object ckHeader: TCheckBox
+ Left = 10
+ Top = 19
+ Width = 97
+ Height = 17
+ Caption = 'Print Header'
+ Enabled = False
+ TabOrder = 2
+ OnClick = ckHeaderClick
+ end
+ object ckFooter: TCheckBox
+ Left = 10
+ Top = 84
+ Width = 97
+ Height = 17
+ Caption = 'Print Footer'
+ Enabled = False
+ TabOrder = 3
+ OnClick = ckFooterClick
+ end
+ end
+ end
+ object shtFormat: TTabSheet
+ Caption = 'Formatting Options'
+ ImageIndex = 2
+ object GroupBox3: TGroupBox
+ Left = 8
+ Top = 8
+ Width = 425
+ Height = 201
+ Caption = 'Font and Size'
+ TabOrder = 0
+ object Label10: TLabel
+ Left = 8
+ Top = 20
+ Width = 83
+ Height = 13
+ Caption = 'Chapter Heading:'
+ end
+ object Label11: TLabel
+ Left = 8
+ Top = 46
+ Width = 51
+ Height = 13
+ Caption = 'Body Text:'
+ end
+ object Label12: TLabel
+ Left = 8
+ Top = 73
+ Width = 75
+ Height = 13
+ Caption = 'Verse Numbers:'
+ end
+ object labelFont: TLabel
+ Left = 173
+ Top = 18
+ Width = 43
+ Height = 13
+ Caption = 'labelFont'
+ end
+ object UpDown5: TUpDown
+ Left = 147
+ Top = 16
+ Width = 16
+ Height = 21
+ Associate = editHeading
+ Min = 10
+ Max = 24
+ Position = 16
+ TabOrder = 0
+ Wrap = False
+ end
+ object editHeading: TEdit
+ Left = 103
+ Top = 16
+ Width = 44
+ Height = 21
+ TabOrder = 1
+ Text = '16'
+ end
+ object UpDown6: TUpDown
+ Left = 147
+ Top = 42
+ Width = 16
+ Height = 21
+ Associate = editBody
+ Min = 8
+ Max = 20
+ Position = 12
+ TabOrder = 2
+ Wrap = False
+ end
+ object editBody: TEdit
+ Left = 103
+ Top = 42
+ Width = 44
+ Height = 21
+ TabOrder = 3
+ Text = '12'
+ end
+ object UpDown7: TUpDown
+ Left = 147
+ Top = 69
+ Width = 16
+ Height = 21
+ Associate = editNumbers
+ Min = 6
+ Max = 20
+ Position = 10
+ TabOrder = 4
+ Wrap = False
+ end
+ object editNumbers: TEdit
+ Left = 103
+ Top = 69
+ Width = 44
+ Height = 21
+ TabOrder = 5
+ Text = '10'
+ end
+ object pnlFontComboBox: TPanel
+ Left = 173
+ Top = 34
+ Width = 148
+ Height = 29
+ BevelOuter = bvNone
+ Caption = 'Font ComboBox'
+ TabOrder = 6
+ end
+ object ckChHead: TCheckBox
+ Left = 8
+ Top = 125
+ Width = 105
+ Height = 17
+ Caption = 'Chapter Headings'
+ TabOrder = 7
+ end
+ object ckPrefix: TCheckBox
+ Left = 144
+ Top = 146
+ Width = 161
+ Height = 17
+ Caption = 'Prefixed (John 1:1 KJV)...'
+ TabOrder = 8
+ end
+ object ckParagraph: TCheckBox
+ Left = 8
+ Top = 146
+ Width = 113
+ Height = 17
+ Caption = 'Paragraph Format'
+ TabOrder = 9
+ end
+ object ckPostfix: TCheckBox
+ Left = 144
+ Top = 168
+ Width = 161
+ Height = 17
+ Caption = 'Postfixed ...(John 1:1 KJV)'
+ TabOrder = 10
+ end
+ object ckVSNum: TCheckBox
+ Left = 144
+ Top = 104
+ Width = 105
+ Height = 17
+ Caption = 'Verse Numbers'
+ TabOrder = 11
+ OnClick = ckVSNumClick
+ end
+ object ckSuperVS: TCheckBox
+ Left = 168
+ Top = 125
+ Width = 97
+ Height = 17
+ Caption = 'Superscripted'
+ Enabled = False
+ TabOrder = 12
+ end
+ object ckBookHead: TCheckBox
+ Left = 8
+ Top = 104
+ Width = 81
+ Height = 17
+ Caption = 'Book Name'
+ TabOrder = 13
+ end
+ end
+ end
+ end
+ object PrinterSetupDialog: TPrinterSetupDialog
+ Left = 496
+ Top = 160
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.h b/apps/windoze/CBuilder5/BibleCS/PrintFrm.h
new file mode 100644
index 0000000..d358e9b
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.h
@@ -0,0 +1,117 @@
+//---------------------------------------------------------------------------
+
+#ifndef PrintFrmH
+#define PrintFrmH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <ComCtrls.hpp>
+#include <ExtCtrls.hpp>
+#include <Menus.hpp>
+#include "RxRichEditX.h"
+#include <Dialogs.hpp>
+#include "RxCombos.hpp"
+#include <swmodule.h>
+
+typedef struct tagTPageOffset {
+ long int Start;
+ long int End;
+ RECT rendRect;
+} TPageOffsets;
+
+//---------------------------------------------------------------------------
+class TPrintForm : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TPageControl *PageControl1;
+ TTabSheet *shtSelection;
+ TTabSheet *shtSetup;
+ TBitBtn *btnPrint;
+ TBitBtn *btnSetup;
+ TBitBtn *btnPreview;
+ TBitBtn *btnClose;
+ TGroupBox *GroupBox1;
+ TRadioButton *radText;
+ TRadioButton *radComm;
+ TRadioButton *radLD;
+ TGroupBox *GroupBox2;
+ TEdit *editStart;
+ TLabel *staticRange;
+ TComboBox *cmbModule;
+ TLabel *lblModName;
+ TGroupBox *GroupBox3;
+ TGroupBox *GroupBox4;
+ TGroupBox *GroupBox5;
+ TLabel *labelLeft;
+ TLabel *labelBot;
+ TLabel *labelRight;
+ TLabel *labelTop;
+ TEdit *editLeft;
+ TUpDown *spinLeft;
+ TEdit *editBottom;
+ TUpDown *spinBottom;
+ TEdit *editTop;
+ TUpDown *spinTop;
+ TEdit *editRight;
+ TUpDown *spinRight;
+ TLabel *labelHeader;
+ TLabel *labelFooter;
+ TEdit *editHeader;
+ TEdit *editFooter;
+ TLabel *Label10;
+ TLabel *Label11;
+ TLabel *Label12;
+ TUpDown *UpDown5;
+ TEdit *editHeading;
+ TUpDown *UpDown6;
+ TEdit *editBody;
+ TUpDown *UpDown7;
+ TEdit *editNumbers;
+ TPrinterSetupDialog *PrinterSetupDialog;
+ TLabel *labelFont;
+ TPanel *pnlFontComboBox;
+ TCheckBox *ckChHead;
+ TCheckBox *ckPrefix;
+ TCheckBox *ckParagraph;
+ TCheckBox *ckPostfix;
+ TCheckBox *ckVSNum;
+ TCheckBox *ckSuperVS;
+ TTabSheet *shtFormat;
+ TCheckBox *ckBookHead;
+ TCheckBox *ckHeader;
+ TCheckBox *ckFooter;
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall btnCloseClick(TObject *Sender);
+ void __fastcall radTextClick(TObject *Sender);
+ void __fastcall radCommClick(TObject *Sender);
+ void __fastcall radLDClick(TObject *Sender);
+ void __fastcall spinLeftClick(TObject *Sender, TUDBtnType Button);
+ void __fastcall spinRightClick(TObject *Sender, TUDBtnType Button);
+ void __fastcall spinBottomClick(TObject *Sender, TUDBtnType Button);
+ void __fastcall spinTopClick(TObject *Sender, TUDBtnType Button);
+ void __fastcall btnPrintClick(TObject *Sender);
+ void __fastcall OnPrint(TRxRichEdit* rtfPrint);
+ void __fastcall btnSetupClick(TObject *Sender);
+ void __fastcall BitBtn5Click(TObject *Sender);
+ void __fastcall btnPreviewClick(TObject *Sender);
+ void __fastcall ckHeaderClick(TObject *Sender);
+ void __fastcall ckFooterClick(TObject *Sender);
+ void __fastcall ckVSNumClick(TObject *Sender);
+private: // User declarations
+public: // User declarations
+ TFontComboBox *cmbFont;
+ TRxRichEditX* rtfPrint;
+ __fastcall TPrintForm(TComponent* Owner);
+ void FillModuleCombo();
+ void SetHint();
+ void PrepareRTF();
+ void SetDefaultOps();
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TPrintForm *PrintForm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/BibleCS/RangeMaintFrm.h b/apps/windoze/CBuilder5/BibleCS/RangeMaintFrm.h
new file mode 100644
index 0000000..e279783
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/RangeMaintFrm.h
@@ -0,0 +1,64 @@
+//---------------------------------------------------------------------------
+
+#ifndef RangeMaintFrmH
+#define RangeMaintFrmH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <ExtCtrls.hpp>
+#include <swconfig.h>
+//---------------------------------------------------------------------------
+class TRangeMaintForm : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *Panel4;
+ TSpeedButton *SpeedButton3;
+ TSpeedButton *SpeedButton4;
+ TPanel *Panel2;
+ TPanel *Panel1;
+ TPanel *Panel3;
+ TSpeedButton *SpeedButton1;
+ TSpeedButton *SpeedButton2;
+ TListBox *ListBox1;
+ TPanel *Panel5;
+ TLabel *Label1;
+ TLabel *Label2;
+ TEdit *NameEdit;
+ TEdit *TextEdit;
+ TPanel *Panel6;
+ TListBox *ListBox2;
+ TLabel *Label3;
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
+ void __fastcall SpeedButton4Click(TObject *Sender);
+ void __fastcall ListBox1Click(TObject *Sender);
+ void __fastcall NameEditChange(TObject *Sender);
+ void __fastcall TextEditChange(TObject *Sender);
+ void __fastcall SpeedButton2Click(TObject *Sender);
+ void __fastcall SpeedButton1Click(TObject *Sender);
+ void __fastcall SpeedButton3Click(TObject *Sender);
+ void __fastcall Button1Click(TObject *Sender);
+private: // User declarations
+ SWConfig *config;
+public: // User declarations
+ __fastcall TRangeMaintForm(TComponent* Owner);
+};
+
+class TCustomRange : public TObject {
+public:
+ string name;
+ string text;
+ TCustomRange(const char *name, const char *text) {
+ this->name = name;
+ this->text = text;
+ }
+};
+
+
+//---------------------------------------------------------------------------
+extern PACKAGE TRangeMaintForm *RangeMaintForm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
new file mode 100644
index 0000000..52876ab
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
@@ -0,0 +1,860 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include "RxRichEditX.h"
+#include <clipbrd.hpp>
+#include <swdisprtf.h>
+#include <swdisprtfchap.h>
+#include "mainfrm.h"
+#include <localemgr.h>
+#include <unicodertf.h>
+
+char TRxRichEditX::platformID = 0;
+
+TRxRichEditX::TRxRichEditX(TWinControl *parent) : TRxRichEdit(parent)
+{
+ OSVERSIONINFO osvi;
+ memset(&osvi, 0, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osvi);
+ platformID = osvi.dwPlatformId;
+ type = "Default";
+}
+
+void TRxRichEditX::RenderModule(SWModule* module, RTF_FORMAT format)
+{
+ format_ops = format;
+
+ TMemoryStream* RTFStream = new TMemoryStream();
+ AnsiString rtfText = "{\\rtf1\\ansi{\\fonttbl{\\f0\\fdecor\\fprq2 ";
+ rtfText += format_ops.fontFace;
+ rtfText += ";}}{\\colortbl;\\red0\\green0\\blue0;}";
+ rtfText += "{\\fs8\\cf1\\par\\pard} ";
+
+ //if(!strcmp(module->Type(), "Biblical Texts"))
+ rtfText += GetFormattedBible(module);
+ /*
+ else if(!strcmp(module->Type(), "Commentaries"))
+ rtfText += GetFormattedComm(module);
+ else if(!strcmp(module->Type(), "Lexicons / Dictionaries"))
+ rtfText += GetFormattedLD(module);
+ else
+ rtfText += GetFormattedBook(module);
+ */
+ rtfText += "{ \\par }}";
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(rtfText.c_str(), rtfText.Length());
+ RTFStream->Position = 0;
+ Lines->LoadFromStream(RTFStream);
+ delete RTFStream;
+
+ // clear HTML link tags
+ while (true) {
+ int start, len, foundAt, endAt;
+
+ start = (SelLength) ? SelStart + SelLength : 0;
+ len = Text.Length() - start;
+ foundAt = this->SearchText("<a href=\"\">", start, len, TRichSearchTypes());
+ if (foundAt == -1)
+ break;
+
+ SelStart = foundAt;
+ SelLength = 11;
+ this->SelText = "";
+ endAt = this->SearchText("</a>", foundAt, len, TRichSearchTypes());
+ if (foundAt == -1)
+ break;
+ SelStart = endAt;
+ SelLength = 4;
+ this->SelText = "";
+ SelStart = foundAt;
+ SelLength = endAt - foundAt;
+ //this->SelAttributes->Link = true;
+ }
+ SelLength = 0;
+}
+
+AnsiString TRxRichEditX::GetFormattedBible(SWModule* module)
+{
+ AnsiString rtfText = "";
+ VerseKey key;
+ int lastChap, lastBook;
+ AnsiString bookName;
+
+ key = (VerseKey)module->Key();
+ lastChap = key.Chapter();
+ lastBook = key.Book();
+ bookName = (AnsiString)key.getText();
+ bookName = bookName.SubString(0,bookName.Pos(lastChap) - 2);
+
+ if(format_ops.prBookHeadings)
+ rtfText += BookHeading(module, bookName);
+
+ if(format_ops.prChHeadings)
+ rtfText += ChapterHeading(module, lastChap);
+
+ for ((*module) = TOP; !module->Error(); (*module)++){
+ key = (VerseKey)module->Key();
+ if(key.Book() != lastBook){
+ rtfText += "\\par\\par";
+ bookName = (AnsiString)key.getText();
+ bookName = bookName.SubString(0,bookName.Pos(key.Chapter()) - 2);
+ if(format_ops.prBookHeadings)
+ rtfText += BookHeading(module, bookName);
+ lastBook = key.Book();
+ lastChap = -1; // Reset the last Chapter since we could jump from Jude 1 to Revelation 1
+ }
+ if(key.Chapter() != lastChap){
+ rtfText += "\\par";
+ if(format_ops.prChHeadings)
+ rtfText += ChapterHeading(module, key.Chapter());
+ lastChap = key.Chapter();
+ }
+ rtfText += PrintEntry(module, key.Verse());
+ }
+
+ return rtfText;
+}
+/*
+AnsiString TRxRichEditX::GetFormattedComm(SWModule* module)
+{
+ AnsiString rtfText = "";
+ VerseKey key;
+ int lastChap;
+ AnsiString lastBook;
+
+ key = (VerseKey)module->Key();
+ lastChap = key.Chapter();
+ lastBook = (AnsiString)key.Book();
+
+ if(format_ops.prBookHeadings)
+ rtfText += BookHeading(module, lastBook);
+
+ if(format_ops.prChHeadings)
+ rtfText += ChapterHeading(module, lastChap);
+
+ for ((*module) = TOP; !module->Error(); (*module)++){
+ key = (VerseKey)module->Key();
+ if((AnsiString)key.Book() == lastBook){
+ if(format_ops.prBookHeadings)
+ rtfText += BookHeading(module, lastBook);
+ lastBook = key.Book();
+ }
+ if(key.Chapter() != lastChap){
+ rtfText += "\\par\\par";
+ if(format_ops.prChHeadings)
+ rtfText += ChapterHeading(module, key.Chapter());
+ lastChap = key.Chapter();
+ }
+ rtfText += PrintEntry(module, key.Verse());
+ }
+
+ return rtfText;
+}
+
+AnsiString TRxRichEditX::GetFormattedLD(SWModule* module)
+{
+ AnsiString rtfText = "";
+ VerseKey key;
+ int lastChap;
+ AnsiString lastBook;
+
+ key = (VerseKey)module->Key();
+ lastChap = key.Chapter();
+ lastBook = (AnsiString)key.Book();
+
+ if(format_ops.prBookHeadings)
+ rtfText += BookHeading(module, lastBook);
+
+ if(format_ops.prChHeadings)
+ rtfText += ChapterHeading(module, lastChap);
+
+ for ((*module) = TOP; !module->Error(); (*module)++){
+ key = (VerseKey)module->Key();
+ if((AnsiString)key.Book() == lastBook){
+ if(format_ops.prBookHeadings)
+ rtfText += BookHeading(module, lastBook);
+ lastBook = key.Book();
+ }
+ if(key.Chapter() != lastChap){
+ rtfText += "\\par\\par";
+ if(format_ops.prChHeadings)
+ rtfText += ChapterHeading(module, key.Chapter());
+ lastChap = key.Chapter();
+ }
+ rtfText += PrintEntry(module, key.Verse());
+ }
+
+ return rtfText;
+}
+
+AnsiString TRxRichEditX::GetFormattedBook(SWModule* module)
+{
+ AnsiString rtfText = "";
+ VerseKey key;
+ int lastChap;
+ AnsiString lastBook;
+
+ key = (VerseKey)module->Key();
+ lastChap = key.Chapter();
+ lastBook = (AnsiString)key.Book();
+
+ if(format_ops.prBookHeadings)
+ rtfText += BookHeading(module, lastBook);
+
+ if(format_ops.prChHeadings)
+ rtfText += ChapterHeading(module, lastChap);
+
+ for ((*module) = TOP; !module->Error(); (*module)++){
+ key = (VerseKey)module->Key();
+ if((AnsiString)key.Book() == lastBook){
+ rtfText += "\\par\\par";
+ if(format_ops.prBookHeadings)
+ rtfText += BookHeading(module, lastBook);
+ lastBook = key.Book();
+ }
+ if(key.Chapter() != lastChap){
+ rtfText += "\\par\\par";
+ if(format_ops.prChHeadings)
+ rtfText += ChapterHeading(module, key.Chapter());
+ lastChap = key.Chapter();
+ }
+ rtfText += PrintEntry(module, key.Verse());
+ }
+
+ return rtfText;
+}
+*/
+AnsiString TRxRichEditX::PrintEntry(SWModule* module, int nVerse)
+{
+ AnsiString rtfText = "";
+ if (module->Direction() == DIRECTION_RTL) {
+ rtfText += "\\qr ";
+ }else
+ rtfText += "\\ql ";
+ if (module->Direction() == DIRECTION_RTL && (platformID == WINNT && (!strnicmp(module->Lang(), "he", 2) || !strnicmp(module->Lang(), "ar", 2)))) {
+ rtfText = rtfText + "\\rtlpar ";
+ }
+
+ if(!format_ops.paragraph)
+ rtfText += "\\par";
+ if(format_ops.prPreFix)
+ rtfText += PrintFix(module) + (AnsiString)" ";
+
+ if(format_ops.prVerseNum){
+ rtfText += (AnsiString)"{\\fs" + format_ops.vsNumFontSize;
+ if(format_ops.superVSNum)
+ rtfText += "\\super ";
+ else rtfText += " ";
+ rtfText += IntToStr(nVerse);
+ rtfText += " }";
+ }
+ rtfText += (AnsiString)"{\\fs" + format_ops.bodyFontSize + (AnsiString)" ";
+ rtfText += module->RenderText();
+ rtfText += " }";
+ if(format_ops.prPostFix)
+ rtfText += (AnsiString)" " + PrintFix(module);
+
+ return rtfText;
+}
+
+AnsiString TRxRichEditX::ChapterHeading(SWModule* module, int nChapter)
+{
+ AnsiString rtfText = "";
+ rtfText += (AnsiString)" \\qc{\\f1\\cf7\\fs" + format_ops.bkFontHeadSize + (AnsiString)"\\b ";
+ rtfText += _tr("Chapter");
+ rtfText += " ";
+ rtfText += IntToStr(nChapter);
+ rtfText += "\\par\\par}";
+ return rtfText;
+}
+
+AnsiString TRxRichEditX::BookHeading(SWModule* module, AnsiString name)
+{
+ AnsiString rtfText = "";
+ rtfText += (AnsiString)" \\qc{\\f1\\cf7\\fs" + format_ops.bkFontHeadSize + (AnsiString)"\\b\\ul ";
+ rtfText += name;
+ rtfText += "\\par\\par}";
+ return rtfText;
+}
+
+
+AnsiString TRxRichEditX::PrintFix(SWModule* module)
+{
+ AnsiString rtfText = "";
+ rtfText += (AnsiString)"{\\fs" + format_ops.vsNumFontSize;
+ rtfText += (AnsiString)"(" + (AnsiString)module->KeyText() + (AnsiString)" " + (AnsiString)module->Name() + (AnsiString)")}";
+ return rtfText;
+}
+
+
+int TRxRichEditX::paintTo(HDC hdc, TRect *size, int margin) {
+ TFormatRange Range;
+ int LastChar, MaxLen, LogX, LogY, OldMap;
+ TRect SaveRect;
+ TGetTextLengthEx TextLenEx;
+ bool calcBestSize = (size) ? IsRectEmpty(size): true;
+ TRect trySizeRect[] = {
+ TRect(0, 0, 200, 50),
+ TRect(0, 0, 200, 100),
+ TRect(0, 0, 250, 100),
+ TRect(0, 0, 300, 50),
+ TRect(0, 0, 300, 100),
+ TRect(0, 0, 350, 100),
+ TRect(0, 0, 400, 50),
+ TRect(0, 0, 400, 100),
+ TRect(0, 0, 400, 150),
+ TRect(0, 0, 400, 200),
+ TRect(0, 0, 500, 100),
+ TRect(0, 0, 500, 150),
+ TRect(0, 0, 500, 200),
+ TRect(0, 0, 500, 250),
+ TRect(0, 0, 550, 300),
+ TRect(0, 0, 550, 350),
+ TRect(0, 0, 0, 0)
+ };
+ int trySize = 0;
+ TRect *dispSize = size;
+
+ LogX = GetDeviceCaps(hdc, LOGPIXELSX);
+ LogY = GetDeviceCaps(hdc, LOGPIXELSY);
+
+ do {
+
+ if (calcBestSize) {
+ dispSize = &trySizeRect[trySize++];
+ if (IsRectEmpty(dispSize)) {
+ dispSize = &trySizeRect[trySize-2];
+ break;
+ }
+ }
+
+ memset(&Range, 0, sizeof(TFormatRange));
+ // with Printer, Range do begin
+ Range.hdc = hdc;
+ Range.hdcTarget = Range.hdc;
+// if (IsRectEmpty(&PageRect)) {
+// Range.rc.right = dispSize->Right * 1440 / LogX;
+// Range.rc.bottom = dispSize->Bottom * 1440 / LogY;
+// }
+// else {
+ Range.rc.left = (dispSize->Left + margin) * 1440 / LogX;
+ Range.rc.top = (dispSize->Top + margin) * 1440 / LogY;
+ Range.rc.right = dispSize->Right * 1440 / LogX;
+ Range.rc.bottom = (dispSize->Bottom)* 1440 / LogY;
+// }
+ Range.rcPage = Range.rc;
+ SaveRect = Range.rc;
+// Range.rcPage.top = Range.rcPage.top + (5 * 1440) / LogY;
+// Range.rcPage.bottom = Range.rcPage.bottom + (5 * 1440) / LogY;
+ LastChar = 0;
+ if (RichEditVersion >= 2) {
+ // with TextLenEx do begin
+ TextLenEx.flags = GTL_DEFAULT;
+ TextLenEx.codepage = CP_ACP;
+ MaxLen = Perform(EM_GETTEXTLENGTHEX, (WPARAM)&TextLenEx, 0);
+ }
+ else MaxLen = GetTextLen();
+ Range.chrg.cpMax = -1;
+ // { ensure printer DC is in text map mode }
+ OldMap = SetMapMode(hdc, MM_TEXT);
+ SendMessage(Handle, EM_FORMATRANGE, 0, 0); // { flush buffer }
+ try {
+ Range.rc = SaveRect;
+ Range.chrg.cpMin = LastChar;
+ LastChar = SendMessage(Handle, EM_FORMATRANGE, 1, Longint(&Range));
+// if ((LastChar < MaxLen) && (LastChar != -1)) ;//NewPage();
+ // } while ((LastChar >= MaxLen) || (LastChar = -1));
+ }
+ __finally {
+ SendMessage(Handle, EM_FORMATRANGE, 0, 0);// { flush buffer }
+ SetMapMode(hdc, OldMap); // { restore previous map mode }
+ }
+ LastChar = (LastChar < 0) ? 0: MaxLen - LastChar;
+ LastChar = (LastChar < 0) ? 0: LastChar;
+ } while (LastChar && calcBestSize);
+
+ if (calcBestSize && size)
+ *size = *dispSize;
+
+ return LastChar;
+}
+
+
+void TRxRichEditX::fillWithRTFString(SWModule *module, const char *text, const char *type) {
+
+ TMemoryStream *RTFStream = new TMemoryStream();
+ System::AnsiString newtext, tmptext;
+
+ this->module = module;
+ this->type = type;
+ recalcAppearance();
+
+ newtext = RTFHeader;
+ newtext += RTFHeadMargin;
+ newtext += "\\pard \\nowidctlpar \\cf7\\f0 ";
+
+ newtext += "{";
+
+ tmptext = "";
+ for (const char *loop = text; *loop; loop++) {
+ if (*loop == '\n') {
+ tmptext += "\\par ";
+ }
+ else tmptext += *loop;
+ }
+ newtext += RTFVersePre + tmptext + RTFVersePost;
+ newtext += "}";
+
+ newtext += RTFTrailer;
+
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
+ RTFStream->Position = 0;
+ Lines->LoadFromStream(RTFStream);
+ Repaint();
+
+ delete RTFStream;
+}
+
+
+void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool heading, bool verseNum, const char *type, bool stripNewlines) {
+ string fontname;
+ TMemoryStream *RTFStream = new TMemoryStream();
+ System::AnsiString newtext, tmptext;
+
+ this->module = module;
+ this->type = type;
+ recalcAppearance();
+
+ newtext = RTFHeader;
+
+ newtext += RTFHeadMargin;
+// newtext += "\\pard\\nowidctlpar\\cf7\\f0 ";
+
+ if (module->Direction() == DIRECTION_RTL) {
+ newtext += "\\qr ";
+ }
+ if (module->Direction() == DIRECTION_RTL && (platformID == WINNT && (!strnicmp(module->Lang(), "he", 2) || !strnicmp(module->Lang(), "ar", 2)))) {
+ newtext += "\\rtlpar ";
+ }
+
+ verses->Persist(1);
+ SWKey *saveKey = (*module);
+ if (!saveKey->Persist())
+ saveKey = 0;
+ module->SetKey(verses);
+
+ SWKey *lastKey = 0;
+ bool first = true;
+ while (!module->Error() && newtext.Length() < 10000 ) {
+ SWKey *testKey = verses->GetElement();
+ VerseKey *element = SWDYNAMIC_CAST(VerseKey, testKey);
+ if (heading) {
+ if (element) {
+ if (lastKey != element) {
+ if (!first)
+ newtext += "\\par\\par ";
+ newtext += RTFHeadingPre;
+ newtext += ((string(element->LowerBound()) + " - " + string(element->UpperBound())).c_str());
+ newtext += ":";
+ newtext += RTFHeadingPost;
+ newtext += "\\par ";
+ }
+ }
+ else {
+ if (!first)
+ newtext += "\\par\\par ";
+ newtext += RTFHeadingPre;
+ newtext += module->KeyText();
+ newtext += ":";
+ newtext += RTFHeadingPost;
+ newtext += "\\par ";
+ }
+// newtext += RTFHeadingPost;
+ }
+ else { // hack to make searchlist entries fit in box better
+ newtext += "";
+ }
+ lastKey = element;
+ first = false;
+
+ newtext = newtext + "{";
+
+ tmptext = "";
+ for (const char *loop = (const char *)*module; *loop; loop++) {
+ if (stripNewlines) {
+ if (!strnicmp(loop, "\\par", 4)) {
+ loop += (loop[4] == 'd') ? 4 : 3;
+ continue;
+ }
+ }
+ if (*loop == '\n') {
+ if (!stripNewlines)
+ tmptext += "\\par ";
+ }
+ else tmptext += *loop;
+
+ }
+
+ if (tmptext.Length() > 3) { // make sure we have an entry
+ if (module->Direction() == DIRECTION_RTL && (SWDispRTFChap::platformID == WIN9X || (module->Lang() && strnicmp(module->Lang(), "he", 2) && strnicmp(module->Lang(), "ar", 2)))) {
+ newtext = newtext + RTFVersePre + tmptext + RTFVersePost;
+ if (verseNum)
+ newtext = newtext + RTFVerseMarkPre + IntToStr(VerseKey(module->KeyText()).Verse()) + RTFVerseMarkPost;
+ newtext = newtext + "\\par ";
+ }
+ else {
+ if (verseNum)
+ newtext = newtext + RTFVerseMarkPre + IntToStr(VerseKey(module->KeyText()).Verse()) + RTFVerseMarkPost;
+ newtext = newtext + RTFVersePre + tmptext + RTFVersePost;
+ }
+ }
+ newtext = newtext + "}";
+ (*module)++;
+ }
+
+ if (saveKey)
+ module->SetKey(saveKey);
+
+ newtext += RTFTrailer;
+
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
+ RTFStream->Position = 0;
+ Lines->LoadFromStream(RTFStream);
+ Repaint();
+
+ delete RTFStream;
+}
+
+
+
+void TRxRichEditX::getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module /*, const char *type*/) {
+
+
+ string keyBackColor = (string)getType().c_str() + "BackColor";
+ string backColor = Form1->optionsconf->Sections["Appearance"][keyBackColor];
+ // This portion of the code sets the default values (If needed) of the background
+ // for either typical windows or for popup windows
+ if (backColor == "") {
+ if (getType() == "Popup") {
+ attribs->backColor = 14680063;
+ }
+ else attribs->backColor = clWindow;
+ }
+ else attribs->backColor = StrToInt((AnsiString)backColor.c_str());
+
+ string keyFontColor = (string)getType().c_str() + "FontColor";
+ string fontColor = Form1->optionsconf->Sections["Appearance"][keyFontColor];
+ // This portion of the code sets the default values (If needed) of the background
+ // for either typical windows or for popup windows
+ if (backColor == "") {
+ attribs->fontColor = clBlack;
+ }
+ else attribs->fontColor = StrToInt((AnsiString)fontColor.c_str());
+
+ // If the module uses it's own font load that else we will try the config file else we will use the default
+ ConfigEntMap::const_iterator eit = module->getConfig().find("Font");
+ if (eit != module->getConfig().end())
+ attribs->fontName = (*eit).second.c_str();
+ else {
+ string keyFontName = (string)getType().c_str() + "FontName";
+ attribs->fontName = (AnsiString)Form1->optionsconf->Sections["Appearance"][keyFontName].c_str();
+ }
+ // If we still have no name we will set it to a default value
+ if (attribs->fontName == "")
+ attribs->fontName = "MS Sans Serif";
+
+ string keyFontSize = (string)getType().c_str() + "FontSize";
+ string fontSize = Form1->optionsconf->Sections["Appearance"][keyFontSize];
+ if (fontSize == "")
+ attribs->fontSize = 10;
+ else attribs->fontSize = StrToInt((AnsiString)fontSize.c_str());
+
+ string entryColor = Form1->optionsconf->Sections["Appearance"]["CurrentVSColor"];
+ if (entryColor == "")
+ attribs->entryKeyColor = clBlue;
+ else attribs->entryKeyColor = StrToInt((AnsiString)entryColor.c_str());
+
+ string morphColor = Form1->optionsconf->Sections["Appearance"]["MorphColor"];
+ if (morphColor == "")
+ attribs->morphColor = clBlue;
+ else attribs->morphColor = StrToInt((AnsiString)morphColor.c_str());
+
+ string strongColor = Form1->optionsconf->Sections["Appearance"]["StrongsColor"];
+ if (strongColor == "")
+ attribs->strongsColor = clBlue;
+ else attribs->strongsColor = StrToInt((AnsiString)strongColor.c_str());
+
+ string fieldColor = Form1->optionsconf->Sections["Appearance"]["FieldColor"];
+ if (fieldColor == "")
+ attribs->lookupFieldColor = clBlue;
+ else attribs->lookupFieldColor = StrToInt((AnsiString)fieldColor.c_str());
+
+ string autoVSColor = Form1->optionsconf->Sections["Appearance"]["AutoVSColor"];
+ if (autoVSColor == "")
+ attribs->markCurrentVerse = true;
+ else attribs->markCurrentVerse = (atoi(autoVSColor.c_str())) ? true : false;
+}
+
+
+void TRxRichEditX::recalcAppearance() {
+
+ char buf[4096];
+
+ getDisplayPrefs(&dispAttribs, module /*, type.c_str()*/);
+
+ Color = dispAttribs.backColor;
+ Font->Name = dispAttribs.fontName;
+ Font->Size = dispAttribs.fontSize;
+
+ RTFHeadMargin = "{\\cf1\\pard}";
+ RTFVerseMarkPost = "}";
+ RTFVersePost = " }";
+
+ buildRTFHeader();
+
+ // build headers with proportional font sizes to single user selected
+ // font size.
+ double fontBase = dispAttribs.fontSize;
+ fontBase /= 4.0;
+
+ sprintf(buf,
+ "{\\fs%d \\par }}",
+ (int)(fontBase * 8));
+ RTFTrailer = buf;
+
+ const char *chap = _tr("Chapter");
+ sprintf(buf,
+ "\\pard \\qc\\nowidctlpar{\\f1\\cf7\\fs%d\\b %s ",
+ (int)(fontBase * 10), chap);
+ RTFChapterMarkPre = buf;
+
+ sprintf(buf,
+ "\\par\\fs%d\\par}",
+ (int)(fontBase * 4));
+ RTFChapterMarkPost = buf;
+
+ sprintf(buf,
+ "{\\fs%d\\cf1\\b ",
+ (int)(fontBase * 7));
+ RTFHeadingPre = buf;
+ RTFHeadingPost = "}";
+ sprintf(buf,
+ "{\\fs%d\\cf1\\super ",
+ (int)(fontBase * 7));
+ RTFVerseMarkPre = buf;
+
+ sprintf(buf,
+ "{\\fs%d\\cf7 ",
+ (int)(fontBase * 8));
+ RTFVersePre = buf;
+}
+
+
+void TRxRichEditX::TColorToRGB(const TColor& color, int& red, int& green, int& blue) {
+ red = (color & 0xFF);
+ green = ((color >> 8) & 0xFF);
+ blue =((color >> 16) & 0xFF);
+}
+
+void TRxRichEditX::buildRTFHeader() {
+ char buf1[1024], buf2[1024];
+ SectionMap::iterator sit;
+ string value;
+ ConfigEntMap::iterator entry;
+ int CurrVSRed, CurrVSGreen, CurrVSBlue, BodyRed, BodyGreen, BodyBlue,
+ VSNumRed, VSNumGreen, VSNumBlue, MorphRed, MorphGreen, MorphBlue,
+ StrongsRed, StrongsGreen, StrongsBlue;
+ TColor CurrVSColor, VSNumColor, BodyColor, MorphColor, StrongsColor;
+
+ sprintf(buf1, "{\\rtf1\\ansi");
+ if (dispAttribs.fontName.Length()) {
+ // Font Table
+ // 0: Text Body
+ sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 %s;}" , dispAttribs.fontName.c_str());
+ strcat(buf1, buf2);
+ // 1: Chapter Heading
+ sprintf(buf2, "{\\f1\\froman\\fcharset0\\fprq2 %s;}", dispAttribs.fontName.c_str());
+ strcat(buf1, buf2);
+ // 2: Unknown
+ sprintf(buf2, "{\\f2\\froman\\fcharset0\\fprq2 %s;}", dispAttribs.fontName.c_str());
+ strcat(buf1, buf2);
+ // 3: Unknown
+ sprintf(buf2, "{\\f3\\froman\\fcharset0\\fprq2 %s;}", dispAttribs.fontName.c_str());
+ strcat(buf1, buf2);
+ // 4: Unknown
+ sprintf(buf2, "{\\f4\\froman\\fcharset0\\fprq2 %s;}", dispAttribs.fontName.c_str());
+ strcat(buf1, buf2);
+ // 7, 8: Unknown
+ strcat(buf1, "{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}");
+ }
+ else {
+ sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}");
+ strcat(buf1, buf2);
+ }
+
+ if ((sit = Form1->optionsconf->Sections.find("Appearance")) != Form1->optionsconf->Sections.end()) {
+ ConfigEntMap &section = (*sit).second;
+
+ CurrVSColor = TColor((((entry = section.find("CurrentVSColor")) != section.end()) ? atoi((*entry).second.c_str()) : 16711680));
+ TColorToRGB(CurrVSColor, CurrVSRed, CurrVSGreen, CurrVSBlue);
+
+ VSNumColor = TColor((((entry = section.find("VSNumberColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0));
+ TColorToRGB(VSNumColor, VSNumRed, VSNumGreen, VSNumBlue);
+
+ StrongsColor = TColor((((entry = section.find("StrongsColor")) != section.end()) ? atoi((*entry).second.c_str()) : 16711935));
+ TColorToRGB(StrongsColor, StrongsRed, StrongsGreen, StrongsBlue);
+
+ MorphColor = TColor((((entry = section.find("MorphColor")) != section.end()) ? atoi((*entry).second.c_str()) : 60534));
+ TColorToRGB(MorphColor, MorphRed, MorphGreen, MorphBlue);
+
+ if (getType() == "Text") {
+ BodyColor = TColor((((entry = section.find("TextFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0));
+ TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue);
+ }
+ else if (getType() == "Comment") {
+ BodyColor = TColor((((entry = section.find("CommentFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0));
+ TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue);
+ }
+ else if (getType()== "LD") {
+ BodyColor = TColor((((entry = section.find("LDFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0));
+ TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue);
+ }
+ else if (getType() == "Popup") {
+ BodyColor = TColor((((entry = section.find("PopupFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0));
+ TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue);
+ }
+ else {
+ BodyRed = 0;
+ BodyGreen = 0;
+ BodyBlue = 0;
+ }
+
+ // Color Table:
+ // 1: Verse Number/ Verse info
+ sprintf(buf2, "{\\colortbl;\\red%d\\green%d\\blue%d;" , VSNumRed, VSNumGreen, VSNumBlue);
+ strcat(buf1, buf2);
+ // 2: Current Verse Color
+ sprintf(buf2, "\\red%d\\green%d\\blue%d;", CurrVSRed, CurrVSGreen, CurrVSBlue);
+ strcat(buf1, buf2);
+ // 3: Strong's Def
+ sprintf(buf2, "\\red%d\\green%d\\blue%d;", StrongsRed, StrongsGreen, StrongsBlue);
+ strcat(buf1, buf2);
+ // 4: Strongs' Tense (Morph)
+ sprintf(buf2, "\\red%d\\green%d\\blue%d;", MorphRed, MorphGreen, MorphBlue);
+ strcat(buf1, buf2);
+ // 5: Unknown
+ strcat(buf1, "\\red0\\green0\\blue255;");
+ // 6: Unknown
+ strcat(buf1, "\\red255\\green0\\blue0;");
+ // 7: Verse/Body Text Color
+ sprintf(buf2, "\\red%d\\green%d\\blue%d;}",BodyRed, BodyGreen, BodyBlue);
+ strcat(buf1, buf2);
+ }
+ else {
+ sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;\\red0\\green\\blue0;\\red0\\green\\blue0;\\red0\\green\\blue0;}");
+ strcat(buf1, buf2);
+ }
+ RTFHeader = buf1;
+}
+
+
+AnsiString TRxRichEditX::getType() {
+ AnsiString retVal;
+ if (!strcmp(type.c_str(), "Default")) {
+ if (!strcmp(module->Type(), "Biblical Texts"))
+ retVal = "Text";
+ if ((!strcmp(module->Type(), "Commentaries")) ||
+ (!strcmp(module->Type(), "Generic Books")))
+ retVal = "Comment";
+ if (!strcmp(module->Type(), "Lexicons / Dictionaries"))
+ retVal = "LD";
+ }
+ else retVal = type;
+
+ return retVal;
+}
+
+
+WideString __fastcall TRxRichEditX::GetText() {
+ int MaxLen;
+
+ if (RichEditVersion >= 2) {
+ TGetTextLengthEx TextLenEx;
+ // with TextLenEx do begin
+ TextLenEx.flags = GTL_DEFAULT;
+ TextLenEx.codepage = 1200;
+ MaxLen = Perform(EM_GETTEXTLENGTHEX, (WPARAM)&TextLenEx, 0);
+ }
+ else MaxLen = GetTextLen();
+ wchar_t *buf = new wchar_t [ MaxLen + 2 ];
+ GETTEXTEX params;
+ params.cb = (MaxLen + 1) * sizeof(wchar_t);
+ params.flags = GT_DEFAULT;
+ params.codepage = 1200; //CP_ACP;
+ params.lpDefaultChar = 0;
+ params.lpUsedDefChar = 0;
+
+ LONG lResult;
+ lResult = SendMessage(Handle, EM_GETTEXTEX, (WPARAM)&params, (LPARAM)buf);
+ WideString Result = buf;
+ delete [] buf;
+ return Result;
+}
+
+
+
+
+WideString __fastcall TRxRichEditX::GetTextRange(int StartPos, int EndPos) {
+
+ WideString Result = GetText();
+
+ Result = Result.SubString(StartPos+1, (EndPos - StartPos));
+ return Result;
+}
+
+
+WideString TRxRichEditX::Trim(WideString &src) {
+ WideString Result = src;
+ int length = Result.Length();
+ int start = 1;
+ while (length) {
+ if (Result[length] != ' ')
+ break;
+ Result.SetLength(--length);
+ }
+ while (start < length) {
+ if (Result[start] != ' ')
+ break;
+ start++;
+ }
+ if (start > 1)
+ Result = Result.SubString(start, length - start);
+ return Result;
+}
+
+
+WideString __fastcall TRxRichEditX::WordAtCursor(void) {
+
+ TCharRange Range;
+ WideString Result = "";
+
+ if (HandleAllocated()) {
+ Range.cpMax = SelStart;
+ if (!Range.cpMax)
+ Range.cpMin = 0;
+ else if (SendMessage(Handle, EM_FINDWORDBREAK, WB_ISDELIMITER, Range.cpMax))
+ Range.cpMin = SendMessage(Handle, EM_FINDWORDBREAK, WB_MOVEWORDLEFT, Range.cpMax);
+ else Range.cpMin = SendMessage(Handle, EM_FINDWORDBREAK, WB_LEFT, Range.cpMax);
+ while (SendMessage(Handle, EM_FINDWORDBREAK, WB_ISDELIMITER, Range.cpMin))
+ Range.cpMin++;
+ Range.cpMax = SendMessage(Handle, EM_FINDWORDBREAK, WB_RIGHTBREAK, Range.cpMax);
+ Result = Trim(GetTextRange(Range.cpMin, Range.cpMax));
+ }
+ return Result;
+}
+
diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.h b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.h
new file mode 100644
index 0000000..9d117fb
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.h
@@ -0,0 +1,100 @@
+#ifndef TRxRichEditX_
+#define TRxRichEditX_
+
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <RxRichEdit.hpp>
+#include <ExtCtrls.hpp>
+#include <swmodule.h>
+#include <listkey.h>
+
+
+struct RTF_FORMAT {
+ AnsiString fontFace; // Font Name
+ int chFontHeadSize; // Chapter Name Heading Size
+ int bkFontHeadSize; // Book Name Heading Size
+ int bodyFontSize; // Body Font Size
+ int vsNumFontSize; // VerseNumbering or Pre/Post-Fix Size
+ bool prChHeadings; // Print Heading
+ bool prBookHeadings; // Print Book Name
+ bool prPreFix; // Print Verse Prefix (James 1:19 KJV)
+ bool prPostFix; // Print Verse Postfix
+ bool prVerseNum; // Print Verse Number
+ bool paragraph; // Print Bible Text as a paragraph rather than seperate lines
+ bool superVSNum; // Verse Numbers superscripted
+};
+
+struct DISP_ATTRIBS {
+ AnsiString fontName; // Font Name (Type Dependant)
+ int fontSize; // Font Size (Type Dependant)
+ bool markCurrentVerse; // whether or not to mark current verse
+ int backColor; // Background Color (Type Dependant)
+ int fontColor; // Foreground Color (Type Dependant)
+ int entryKeyColor; // Verse Number Color (Should be type dependant but isn't yet)
+ int currentVSColor; // Current Verse Color
+ int morphColor; // MorphTags Color
+ int strongsColor; // Strongs Tags Color
+ int lookupFieldColor; // Lookup Key Fields color
+};
+
+/*
+typedef struct {
+ TCharRange chrg;
+ PWideChar lpstrText;
+} TTextRangeW;
+
+*/
+class TRxRichEditX : public TRxRichEdit {
+private:
+ AnsiString GetFormattedBible(SWModule* module);
+ //AnsiString GetFormattedComm(SWModule* module);
+ //AnsiString GetFormattedLD(SWModule* module);
+ //AnsiString GetFormattedBook(SWModule* module);
+ AnsiString ChapterHeading(SWModule* module, int nChapter);
+ AnsiString BookHeading(SWModule* module, AnsiString name);
+ AnsiString PrintEntry(SWModule* module, int nVerse);
+ AnsiString PrintFix(SWModule* module);
+ RTF_FORMAT format_ops;
+ void buildRTFHeader();
+
+public:
+ static char platformID;
+ static void TColorToRGB(const TColor& color, int& red, int& green, int& blue);
+
+ AnsiString RTFHeader;
+ AnsiString RTFHeadMargin;
+ AnsiString RTFTrailer;
+
+ AnsiString RTFChapterMarkPre;
+ AnsiString RTFChapterMarkPost;
+
+ AnsiString RTFHeadingPre;
+ AnsiString RTFHeadingPost;
+
+ AnsiString RTFVerseMarkPre;
+ AnsiString RTFVerseMarkPost;
+
+ AnsiString RTFVersePre;
+ AnsiString RTFVersePost;
+ DISP_ATTRIBS dispAttribs;
+
+ TRxRichEditX(TWinControl *parent);
+ int paintTo(HDC, TRect *size, int margin = 4);
+ void fillWithVerses(SWModule *module, ListKey *verses, bool heading = true, bool verseNum = true, const char* type = "Default", bool stripNewlines = true);
+ void fillWithRTFString(SWModule *module, const char *text, const char *type = "Default");
+ void getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module /*,const char *type = "Default"*/);
+ void drawTo(HDC dc) { PaintControls(dc, 0); }
+ void RenderModule(SWModule* module, RTF_FORMAT format);
+ SWModule *module;
+ AnsiString type;
+ void recalcAppearance();
+ AnsiString getType();
+ static WideString Trim(WideString &src);
+ WideString __fastcall GetText();
+ WideString __fastcall GetTextRange(int StartPos, int EndPos);
+ WideString __fastcall WordAtCursor(void);
+};
+
+#endif // TRxRichEditX_
diff --git a/apps/windoze/CBuilder5/BibleCS/TModuleFonts.cpp b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.cpp
new file mode 100644
index 0000000..03a2e99
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.cpp
@@ -0,0 +1,138 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include "TModuleFonts.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma link "RxCombos"
+#pragma resource "*.dfm"
+
+TModuleFonts *ModuleFonts;
+//---------------------------------------------------------------------------
+__fastcall TModuleFonts::TModuleFonts(TComponent* Owner)
+ : TForm(Owner)
+{
+ // Put in the RXLib Font combobox component
+ cmbFontSel = new TFontComboBox(this);
+ cmbFontSel->Parent = pnlFontComboBox;
+ cmbFontSel->Align = alClient;
+// cmbFontSel->Font->Height = -15;
+ cmbFontSel->ParentFont = true;
+ cmbFontSel->UseFonts = true;
+ cmbFontSel->ItemIndex = cmbFontSel->Items->IndexOf("Arial");
+ cmbFontSel->OnChange = cmbFontSelChange;
+}
+//---------------------------------------------------------------------------
+void __fastcall TModuleFonts::FormShow(TObject *Sender)
+{
+ FillList();
+}
+//---------------------------------------------------------------------------
+void __fastcall TModuleFonts::viewAllClick(TObject *Sender)
+{
+ viewAll->Checked = true;
+ viewUnicode->Checked = false;
+ FillList();
+}
+//---------------------------------------------------------------------------
+void __fastcall TModuleFonts::viewUnicodeClick(TObject *Sender)
+{
+ viewUnicode->Checked = true;
+ viewAll->Checked = false;
+ FillList();
+}
+//---------------------------------------------------------------------------
+
+void TModuleFonts::FillList()
+{
+ BibleCSMGR *manager;
+ ModMap::iterator mods;
+ TTreeNode *node;
+ string nodeName;
+ manager = Form1->mainmgr;
+
+ installTree->Items->Clear();
+
+ if (!manager->configPath)
+ return;
+
+ for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) {
+ for (node = installTree->Items->GetFirstNode(); node; node = node->getNextSibling()) {
+ if (!strcmp(node->Text.c_str(), mods->second->Type())) {
+ break;
+ }
+ }
+ if(mods->second->isUnicode() || viewAll->Checked){
+ if (!node) { // Add Section
+ if (!strncmp(mods->second->Type(), "Bibl", 4)) // If Bibles, put first in list
+ node = installTree->Items->AddChildFirst(0, mods->second->Type());
+ else node = installTree->Items->AddChild(0, mods->second->Type());
+ }
+ nodeName = "[";
+ nodeName += mods->second->Name();
+ nodeName += "] ";
+ nodeName += mods->second->Description();
+ node = installTree->Items->AddChildObject(node, nodeName.c_str(), mods->second->Name());
+ }
+ }
+ //for (node = installTree->Items->GetFirstNode(); node; node = node->getNextSibling())
+ // node->Expand(true);
+ node = installTree->Items->GetFirstNode();
+ if (node)
+ node->MakeVisible();
+
+}
+void __fastcall TModuleFonts::installTreeChange(TObject *Sender,
+ TTreeNode *Node)
+{
+ TTreeNode* currNode = installTree->Selected;
+ BibleCSMGR *manager;
+ AnsiString modName, fontName;
+ ModMap::iterator it;
+ manager = Form1->mainmgr;
+
+ if(!currNode->HasChildren){
+ modName = currNode->Text.SubString(2, currNode->Text.Pos("]") - 2);
+ it = manager->Modules.find(modName.c_str());
+ fontName = (*it).second->getConfigEntry("Font");
+ cmbFontSel->ItemIndex = cmbFontSel->Items->IndexOf(fontName);
+ }
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TModuleFonts::cmbFontSelChange(TObject *Sender)
+{
+ TTreeNode* currNode = installTree->Selected;
+ BibleCSMGR *manager = Form1->mainmgr;
+ manager->applyUserPrefs();
+ AnsiString modName;
+ ModMap::iterator it;
+ if(!currNode->HasChildren){
+ modName = currNode->Text.SubString(2, currNode->Text.Pos("]") - 2);
+ manager->getUserPrefs()[modName.c_str()]["Font"] = cmbFontSel->Items->Strings[cmbFontSel->ItemIndex].c_str();
+ }
+ manager->applyUserPrefs();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TModuleFonts::btnResetClick(TObject *Sender)
+{
+ BibleCSMGR *manager;
+ SectionMap::iterator sit;
+ ModMap::iterator it;
+ manager = Form1->mainmgr;
+
+ sit = manager->getUserPrefs().Sections.begin();
+ while(sit != manager->getUserPrefs().Sections.end())
+ {
+ (*sit).second.erase("Font");
+ sit++;
+ }
+ manager->applyUserPrefs();
+}
+//---------------------------------------------------------------------------
+
+
diff --git a/apps/windoze/CBuilder5/BibleCS/TModuleFonts.dfm b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.dfm
new file mode 100644
index 0000000..ca772c4
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.dfm
@@ -0,0 +1,156 @@
+object ModuleFonts: TModuleFonts
+ Left = 523
+ Top = 262
+ Width = 354
+ Height = 462
+ Caption = 'Select Module Fonts'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ KeyPreview = True
+ Menu = MainMenu1
+ OldCreateOrder = False
+ Position = poScreenCenter
+ Scaled = False
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Panel1: TPanel
+ Left = 0
+ Top = 375
+ Width = 346
+ Height = 41
+ Align = alBottom
+ BevelOuter = bvNone
+ TabOrder = 0
+ object btnReset: TBitBtn
+ Left = 136
+ Top = 8
+ Width = 102
+ Height = 29
+ Anchors = [akRight, akBottom]
+ Caption = '&Reset All'
+ TabOrder = 0
+ OnClick = btnResetClick
+ Glyph.Data = {
+ DE010000424DDE01000000000000760000002800000024000000120000000100
+ 0400000000006801000000000000000000001000000000000000000000000000
+ 80000080000000808000800000008000800080800000C0C0C000808080000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333444444
+ 33333333333F8888883F33330000324334222222443333388F3833333388F333
+ 000032244222222222433338F8833FFFFF338F3300003222222AAAAA22243338
+ F333F88888F338F30000322222A33333A2224338F33F8333338F338F00003222
+ 223333333A224338F33833333338F38F00003222222333333A444338FFFF8F33
+ 3338888300003AAAAAAA33333333333888888833333333330000333333333333
+ 333333333333333333FFFFFF000033333333333344444433FFFF333333888888
+ 00003A444333333A22222438888F333338F3333800003A2243333333A2222438
+ F38F333333833338000033A224333334422224338338FFFFF8833338000033A2
+ 22444442222224338F3388888333FF380000333A2222222222AA243338FF3333
+ 33FF88F800003333AA222222AA33A3333388FFFFFF8833830000333333AAAAAA
+ 3333333333338888883333330000333333333333333333333333333333333333
+ 0000}
+ Margin = 1
+ NumGlyphs = 2
+ end
+ object btnOK: TBitBtn
+ Left = 248
+ Top = 8
+ Width = 94
+ Height = 29
+ Anchors = [akRight, akBottom]
+ TabOrder = 1
+ Kind = bkOK
+ end
+ end
+ object Panel2: TPanel
+ Left = 0
+ Top = 0
+ Width = 346
+ Height = 334
+ Align = alClient
+ BevelOuter = bvNone
+ Caption = 'Panel2'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 1
+ object Panel4: TPanel
+ Left = 0
+ Top = 0
+ Width = 346
+ Height = 32
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Label1: TLabel
+ Left = 3
+ Top = 8
+ Width = 82
+ Height = 13
+ Caption = 'Installed Modules'
+ end
+ end
+ object installTree: TTreeView
+ Left = 0
+ Top = 32
+ Width = 346
+ Height = 302
+ Align = alClient
+ Indent = 19
+ ReadOnly = True
+ TabOrder = 1
+ OnChange = installTreeChange
+ end
+ end
+ object Panel3: TPanel
+ Left = 0
+ Top = 334
+ Width = 346
+ Height = 41
+ Align = alBottom
+ BevelOuter = bvNone
+ TabOrder = 2
+ object Label2: TLabel
+ Left = 7
+ Top = 8
+ Width = 52
+ Height = 13
+ Anchors = [akLeft, akBottom]
+ Caption = 'Font Name'
+ end
+ object pnlFontComboBox: TPanel
+ Left = 85
+ Top = 4
+ Width = 258
+ Height = 25
+ Anchors = [akLeft, akTop, akRight]
+ BevelOuter = bvNone
+ Caption = 'Font ComboBox'
+ TabOrder = 0
+ end
+ end
+ object MainMenu1: TMainMenu
+ Left = 200
+ object menuView: TMenuItem
+ Caption = '&View'
+ Checked = True
+ object viewAll: TMenuItem
+ Caption = 'Show &All Installed'
+ GroupIndex = 1
+ OnClick = viewAllClick
+ end
+ object viewUnicode: TMenuItem
+ Caption = 'Show &Unicode Only'
+ Checked = True
+ GroupIndex = 1
+ OnClick = viewUnicodeClick
+ end
+ end
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/TModuleFonts.h b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.h
new file mode 100644
index 0000000..5579f1c
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.h
@@ -0,0 +1,56 @@
+//---------------------------------------------------------------------------
+
+#ifndef TModuleFontsH
+#define TModuleFontsH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <RxCombos.hpp>
+#include <Buttons.hpp>
+#include <ComCtrls.hpp>
+#include <Menus.hpp>
+#include <dirent.h>
+#include <io.h>
+#include <dir.h>
+// Sword includes
+#include <swmgr.h>
+#include <swconfig.h>
+#include "mainfrm.h"
+#include <ExtCtrls.hpp>
+
+//---------------------------------------------------------------------------
+class TModuleFonts : public TForm
+{
+__published: // IDE-managed Components
+ TMainMenu *MainMenu1;
+ TMenuItem *menuView;
+ TMenuItem *viewAll;
+ TMenuItem *viewUnicode;
+ TPanel *Panel1;
+ TPanel *Panel2;
+ TPanel *Panel3;
+ TBitBtn *btnReset;
+ TBitBtn *btnOK;
+ TLabel *Label2;
+ TPanel *pnlFontComboBox;
+ TPanel *Panel4;
+ TTreeView *installTree;
+ TLabel *Label1;
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall viewAllClick(TObject *Sender);
+ void __fastcall viewUnicodeClick(TObject *Sender);
+ void __fastcall installTreeChange(TObject *Sender, TTreeNode *Node);
+ void __fastcall cmbFontSelChange(TObject *Sender);
+ void __fastcall btnResetClick(TObject *Sender);
+private:
+ void FillList();
+public: // User declarations
+ TFontComboBox *cmbFontSel;
+ __fastcall TModuleFonts(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TModuleFonts *ModuleFonts;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/BibleCS/biblecsmgr.cpp b/apps/windoze/CBuilder5/BibleCS/biblecsmgr.cpp
new file mode 100644
index 0000000..b2e0ba5
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/biblecsmgr.cpp
@@ -0,0 +1,130 @@
+//---------------------------------------------------------------------------
+#include "BibleCSMGR.h"
+#include <swconfig.h>
+#include <markupfiltmgr.h>
+#ifdef _ICU_
+//#include <utf8arshaping.h>
+#include <utf8bidireorder.h>
+#include <utf8transliterator.h>
+#endif
+//---------------------------------------------------------------------------
+BibleCSMGR::BibleCSMGR(TModInstFrm *iModInstFrm) : SWMgr(0, 0, false, new MarkupFilterMgr(FMT_RTF, ENC_RTF))
+{
+#ifdef _ICU_
+// arshaping = new UTF8arShaping();
+ bidireorder = new UTF8BiDiReorder();
+// transliterator = new UTF8Transliterator();
+#endif
+ ModInstFrm = iModInstFrm;
+ userPrefs = 0;
+ Load();
+
+ OSVERSIONINFO osvi;
+ memset(&osvi, 0, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osvi);
+ platformID = osvi.dwPlatformId;
+}
+
+
+BibleCSMGR::~BibleCSMGR()
+{
+#ifdef _ICU_
+// if (arshaping)
+// delete arshaping;
+ if (bidireorder)
+ delete bidireorder;
+// if (transliterator)
+// delete transliterator;
+#endif
+ if (userPrefs) {
+ userPrefs->Save();
+ delete userPrefs;
+ }
+}
+
+
+void BibleCSMGR::AddRenderFilters(SWModule *module, ConfigEntMap &section)
+{
+ string lang;
+ ConfigEntMap::iterator entry;
+
+ lang = ((entry = section.find("Lang")) != section.end()) ? (*entry).second : (string)"en";
+
+ if (module->Direction() == DIRECTION_RTL) {
+#ifdef _ICU_
+// if (!strnicmp(lang.c_str(), "ar", 2)) {
+// module->AddRenderFilter(arshaping);
+// }
+ if (platformID == WIN9X || (strnicmp(lang.c_str(), "he", 2) && strnicmp(lang.c_str(), "ar", 2))) {
+ module->AddRenderFilter(bidireorder);
+
+ }
+#endif
+ }
+ SWMgr::AddRenderFilters(module, section);
+}
+
+
+char BibleCSMGR::AddModToConfig(int conffd, const char *fname)
+{
+ SWConfig modconf(fname);
+ SectionMap::iterator section;
+ AnsiString abouttext = "";
+ int logflag;
+ TMemoryStream *RTFStream = new TMemoryStream();
+ char retval;
+
+ section = modconf.Sections.begin();
+
+ ModInstFrm->ModText->Caption = "";
+ ModInstFrm->ModText->Caption = ModInstFrm->ModText->Caption + "Found new module [ " + (*(*section).second.find("Description")).second.c_str() + " ]. Installing...";
+
+ abouttext = abouttext + "{\\fs20\\cf0 " + (*(*section).second.find("About")).second.c_str() + " }";
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(abouttext.c_str(), abouttext.Length());
+ RTFStream->Position = 0;
+ ModInstFrm->AboutText->Lines->LoadFromStream(RTFStream);
+ delete RTFStream;
+
+ ModInstFrm->ShowModal();
+
+ logflag = SWLog::systemlog->getLogLevel();
+ SWLog::systemlog->setLogLevel(0);
+ retval = SWMgr::AddModToConfig(conffd, fname);
+ SWLog::systemlog->setLogLevel(logflag);
+
+ return retval;
+}
+
+signed char BibleCSMGR::Load () {
+ signed char retval = SWMgr::Load();
+#ifdef _ICU_
+// optionFilters.insert(FilterMap::value_type("UTF8Transliterator", transliterator));
+// options.push_back(transliterator->getOptionName());
+#endif
+ userPrefs = new SWConfig("./userprefs.conf");
+ applyUserPrefs();
+ return retval;
+};
+
+void BibleCSMGR::applyUserPrefs() {
+ (*config) += (*userPrefs);
+}
+
+void BibleCSMGR::AddGlobalOptions (SWModule * module, ConfigEntMap & section,
+ ConfigEntMap::iterator start,
+ ConfigEntMap::iterator end) {
+
+ SWMgr::AddGlobalOptions(module, section, start, end);
+#ifdef _ICU_
+// module->AddOptionFilter(transliterator);
+#endif
+};
+
+/* maybe force a section for each module and set a per module userConfig. "But not like this. Not like this."
+void BibleCSMGR::AddLocalOptions(SWModule *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end)
+{
+ userPrefs[module->Name()]["Font"];
+}
+*/
diff --git a/apps/windoze/CBuilder5/BibleCS/biblecsmgr.h b/apps/windoze/CBuilder5/BibleCS/biblecsmgr.h
new file mode 100644
index 0000000..d9dbc97
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/biblecsmgr.h
@@ -0,0 +1,34 @@
+//---------------------------------------------------------------------------
+#ifndef biblecsmgrH
+#define biblecsmgrH
+#include <swmgr.h>
+#include "ModInstForm.h"
+//---------------------------------------------------------------------------
+
+enum PlatformIDs { WIN32S = 0, WIN9X, WINNT, WINCE };
+
+class BibleCSMGR : public SWMgr {
+ TModInstFrm *ModInstFrm;
+// SWFilter *arshaping;
+ SWFilter *bidireorder;
+ SWFilter *transliterator;
+ char platformID;
+ SWConfig *userPrefs;
+
+protected:
+ virtual char AddModToConfig(int conffd, const char *fname);
+ virtual void AddRenderFilters(SWModule *module, ConfigEntMap &section);
+ virtual signed char Load ();
+ virtual void AddGlobalOptions (SWModule * module, ConfigEntMap & section,
+ ConfigEntMap::iterator start,
+ ConfigEntMap::iterator end);
+
+public:
+ BibleCSMGR(TModInstFrm *iModInstFrm);
+ virtual ~BibleCSMGR();
+ SWConfig &getUserPrefs() { return *userPrefs; }
+ void applyUserPrefs();
+};
+
+#endif
+
diff --git a/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.cpp b/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.cpp
new file mode 100644
index 0000000..4429c5d
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.cpp
@@ -0,0 +1,221 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "bookmarkfrm.h"
+#include <swconfig.h>
+#include <dirent.h>
+#include "mainfrm.h"
+#include "newbmfilefrm.h"
+#include <io.h>
+#include <dir.h>
+
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TbookmarkForm *bookmarkForm;
+//---------------------------------------------------------------------------
+__fastcall TbookmarkForm::TbookmarkForm(TComponent* Owner)
+ : TForm(Owner)
+{
+ SWConfig *bookmarks;
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit;
+ TTreeNode *node;
+
+ DIR *dir;
+ struct dirent *ent;
+ string conffile;
+ bmdir = "";
+
+ bmtree->Items->Clear();
+
+ if ((sit = Form1->optionsconf->Sections.find("Bookmarks")) != Form1->optionsconf->Sections.end())
+ bmdir = ((eit = (*sit).second.find("Directory")) != (*sit).second.end()) ? (*eit).second : (string)"";
+
+// Add Personal Bookmarks first, or if they don't exist, ADD A BLANK BRANCH first in the tree
+// --------------------------------------------------------------------------
+
+ if (bmdir == "")
+ bmdir = "./bookmarks/";
+
+ if (access(bmdir.c_str(), 0)) { // directory does not exist
+ _mkdir(bmdir.c_str());
+ }
+
+ conffile = bmdir + "personal.conf";
+ bookmarks = new SWConfig(conffile.c_str());
+ if ((sit = bookmarks->Sections.find("ROOT")) != bookmarks->Sections.end()) {
+ if ((eit = (*sit).second.begin()) != (*sit).second.end()) {
+ node = bmtree->Items->AddObject(bmtree->Selected, (*eit).second.c_str(), *bmfiles.insert(bmfiles.begin(), new String(conffile.c_str())));
+ AddSection(bookmarks, bmtree, node, (*eit).first.c_str());
+ }
+ }
+ else bmtree->Items->AddObject(bmtree->Selected, "Personal Bookmarks", *bmfiles.insert(bmfiles.begin(), new String(conffile.c_str())));
+ delete bookmarks;
+// --------------------------------------------------------------------------
+
+// Add all other bookmark files ---------------------------------------------
+ if (dir = opendir(bmdir.c_str())) {
+ rewinddir(dir);
+ while ((ent = readdir(dir))) {
+ if ((strcmp(ent->d_name, "personal.conf")) && (strcmp(ent->d_name, "."))&& (strcmp(ent->d_name, ".."))) {
+ conffile = bmdir;
+ conffile += ent->d_name;
+ bookmarks = new SWConfig(conffile.c_str());
+ if ((sit = bookmarks->Sections.find("ROOT")) != bookmarks->Sections.end()) {
+ if ((eit = (*sit).second.begin()) != (*sit).second.end()) { // Currently supports only ONE topsection per file because on save, each topsection designates which file to rewrite
+ node = bmtree->Items->AddObject(bmtree->Selected, (*eit).second.c_str(), *bmfiles.insert(bmfiles.begin(), new String(conffile.c_str())));
+ AddSection(bookmarks, bmtree, node, (*eit).first.c_str());
+ }
+ }
+ delete bookmarks;
+ }
+ }
+ closedir(dir);
+ }
+}
+
+
+__fastcall TbookmarkForm::~TbookmarkForm() {
+ list <String *>::iterator it;
+
+ SaveBookmarks();
+
+ for (it = bmfiles.begin(); it != bmfiles.end(); it++)
+ delete *it;
+}
+
+
+//---------------------------------------------------------------------------
+
+void TbookmarkForm::AddSection(SWConfig *config, TTreeView *tree, TTreeNode *parent, String section)
+{
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit;
+ TTreeNode *node;
+
+ if ((sit = config->Sections.find(section.c_str())) != config->Sections.end()) {
+ for (eit = (*sit).second.begin(); eit != (*sit).second.end(); eit++) {
+ node = tree->Items->AddChild(parent, (*eit).second.c_str());
+ AddSection(config, tree, node, (*eit).first.c_str());
+ }
+ }
+}
+
+
+void __fastcall TbookmarkForm::bmtreeDragDrop(TObject *Sender, TObject *Source,
+ int X, int Y)
+{
+ bmtree->Selected->MoveTo(bmtree->DropTarget, naAddChildFirst);
+}
+//---------------------------------------------------------------------------
+void __fastcall TbookmarkForm::bmtreeDragOver(TObject *Sender, TObject *Source,
+ int X, int Y, TDragState State, bool &Accept)
+{
+ Accept = false;
+
+ if (String(Source->ClassName()) == "TTreeView") {
+ if (Source == bmtree) {
+ if (bmtree->Selected->Data) {
+ if (strcmp((*(String*)(bmtree->Selected->Data)).c_str(),(bmdir + "personal.conf").c_str())) {
+ Accept = true;
+ }
+ }
+ else Accept = true;
+ }
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TbookmarkForm::bmtreeDblClick(TObject *Sender)
+{
+ if (!bmtree->Selected->getFirstChild()) {
+ *(Form1->DefaultVSKey) = bmtree->Selected->Text.c_str();
+ Form1->TextKeyChanged();
+ }
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TbookmarkForm::AddChild1Click(TObject *Sender)
+{
+ bmtree->Selected->Expand(false);
+ bmtree->Items->AddChildFirst(bmtree->Selected, "New Topic")->EditText();
+}
+//---------------------------------------------------------------------------
+void __fastcall TbookmarkForm::Delete1Click(TObject *Sender)
+{
+ if (bmtree->Selected->Data) {
+ if (strcmp((*(String*)(bmtree->Selected->Data)).c_str(),(bmdir + "personal.conf").c_str())) {
+ bmtree->Selected->Delete();
+ }
+ }
+ else bmtree->Selected->Delete();
+}
+//---------------------------------------------------------------------------
+void __fastcall TbookmarkForm::Rename1Click(TObject *Sender)
+{
+ bmtree->Selected->EditText();
+}
+//---------------------------------------------------------------------------
+
+void TbookmarkForm::SaveBookmarks()
+{
+ TTreeNode *tree = 0;
+ SWConfig *bmconf;
+ ConfigEntMap emap;
+ SectionMap::iterator sit;
+ char buf[15];
+ bool personal, other;
+ list <String *>::iterator it;
+ string persfile;
+
+ if (bmtree->Items->Count)
+ tree = bmtree->Items->Item[0];
+
+ if ((sit = Form1->optionsconf->Sections.find("Bookmarks")) != Form1->optionsconf->Sections.end()) {
+ personal = (atoi((*(*sit).second.find("AutoSavePersonal")).second.c_str())) ? true:false;
+ other = (atoi((*(*sit).second.find("AutoSaveOther")).second.c_str())) ? true:false;
+ }
+
+ persfile = bmdir + "personal.conf";
+ for (it = bmfiles.begin(); it != bmfiles.end(); it++) { // delete all bookmark files before saving in case a top level was deleted
+ if (((!strcmp((*it)->c_str(), persfile.c_str())) && personal) || ((strcmp((*it)->c_str(), persfile.c_str())) && other))
+ unlink((*it)->c_str());
+ }
+
+ for (;tree;tree = tree->getNextSibling()) {
+ if (((*((String *)tree->Data) == persfile.c_str()) && personal) || ((*((String *)tree->Data) != persfile.c_str()) && other)) {
+ bmconf = new SWConfig(((String *)tree->Data)->c_str());
+ emap = bmconf->Sections["ROOT"];
+ sprintf(buf, "branch%d", tree->AbsoluteIndex);
+ emap.erase(buf); emap.insert(ConfigEntMap::value_type(buf, tree->Text.c_str()));
+ AddSectionToConf(bmconf, buf, tree);
+ bmconf->Sections["ROOT"] = emap;
+ bmconf->Save();
+ delete bmconf;
+ }
+ }
+}
+
+
+void TbookmarkForm::AddSectionToConf(SWConfig *config, String section, TTreeNode *tree) {
+ ConfigEntMap sit;
+ char buf[15];
+
+ if (tree = tree->getFirstChild()) {
+ sit = config->Sections[section.c_str()];
+ for (; tree; tree = tree->getNextSibling()) {
+ sprintf(buf, "branch%d", tree->AbsoluteIndex);
+ sit.erase(buf); sit.insert(ConfigEntMap::value_type(buf, tree->Text.c_str()));
+ AddSectionToConf(config, buf, tree);
+ }
+ config->Sections[section.c_str()] = sit;
+ }
+}
+
+void __fastcall TbookmarkForm::NewBookmarkFile1Click(TObject *Sender)
+{
+ if (NewBMfrm->ShowModal() == mrOk) {
+ bmtree->Items->AddObject(bmtree->Items->Item[0], NewBMfrm->bmtitle->Text, *bmfiles.insert(bmfiles.begin(), new String(String(bmdir.c_str()) + NewBMfrm->bmfile->Text + String(".conf"))));
+ }
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.h b/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.h
new file mode 100644
index 0000000..41c606a
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.h
@@ -0,0 +1,48 @@
+//---------------------------------------------------------------------------
+#ifndef bookmarkfrmH
+#define bookmarkfrmH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ComCtrls.hpp>
+#include <swconfig.h>
+#include <vcl\Menus.hpp>
+#include <list>
+//---------------------------------------------------------------------------
+class TbookmarkForm : public TForm
+{
+__published: // IDE-managed Components
+ TTreeView *bmtree;
+ TPopupMenu *BMPopup;
+ TMenuItem *Delete1;
+ TMenuItem *AddChild1;
+ TMenuItem *Rename1;
+ TMenuItem *N1;
+ TMenuItem *NewBookmarkFile1;
+ void __fastcall bmtreeDragDrop(TObject *Sender, TObject *Source, int X, int Y);
+ void __fastcall bmtreeDragOver(TObject *Sender, TObject *Source, int X, int Y,
+ TDragState State, bool &Accept);
+ void __fastcall bmtreeDblClick(TObject *Sender);
+ void __fastcall AddChild1Click(TObject *Sender);
+ void __fastcall Delete1Click(TObject *Sender);
+ void __fastcall Rename1Click(TObject *Sender);
+ void __fastcall NewBookmarkFile1Click(TObject *Sender);
+private: // User declarations
+ void AddSection(SWConfig *config, TTreeView *tree, TTreeNode *parent, String section);
+ list <String *> bmfiles; // so we can delete each display we create
+
+
+public: // User declarations
+ string bmdir;
+ __fastcall TbookmarkForm(TComponent* Owner);
+ __fastcall ~TbookmarkForm();
+ void SaveBookmarks();
+ void AddSectionToConf(SWConfig *config, String section, TTreeNode *tree);
+};
+//---------------------------------------------------------------------------
+extern TbookmarkForm *bookmarkForm;
+//---------------------------------------------------------------------------
+#endif
+ \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.bpr b/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.bpr
new file mode 100644
index 0000000..1059c12
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.bpr
@@ -0,0 +1,113 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="cdstartup.exe"/>
+ <OBJFILES value="cdstartup.obj mainfrm.obj"/>
+ <RESFILES value="cdstartup.res"/>
+ <IDLFILES value=""/>
+ <IDLGENFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES) mainfrm.dfm"/>
+ <LIBFILES value=""/>
+ <LIBRARIES value="vcl50.lib"/>
+ <SPARELIBS value="vcl50.lib"/>
+ <PACKAGES value="vclx50.bpi vcl50.bpi vcldb50.bpi vclbde50.bpi vcldbx50.bpi ibsmp50.bpi
+ bcbsmp50.bpi dclocx50.bpi qrpt50.bpi teeui50.bpi vclsmp50.bpi teedb50.bpi
+ tee50.bpi dss50.bpi nmfast50.bpi inetdb50.bpi inet50.bpi vclmid50.bpi"/>
+ <PATHCPP value=".;"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+ <RELEASELIBPATH value="$(BCB)\lib\release"/>
+ <LINKER value="ilink32"/>
+ <USERDEFINES value=""/>
+ <SYSDEFINES value="NO_STRICT"/>
+ <MAINSOURCE value="cdstartup.cpp"/>
+ <INCLUDEPATH value="$(BCB)\include;$(BCB)\include\vcl"/>
+ <LIBPATH value="$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par -w-8027 -w-8026"/>
+ <WARNOPTSTR value=""/>
+ </MACROS>
+ <OPTIONS>
+ <IDLCFLAGS value="-I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa"/>
+ <CFLAG1 value="-O2 -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b-
+ -k- -vi -c -tW -tWM"/>
+ <PFLAGS value="-$YD -v -M -JPHNE"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zn"/>
+ <LFLAGS value="-D&quot;&quot; -aa -Tpe -x"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="c0w32.obj $(OBJFILES)"/>
+ <ALLRES value="$(RESFILES)"/>
+ <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=1
+AutoIncBuild=0
+MajorVer=1
+MinorVer=5
+Release=3
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=CrossWire Software &amp; Bible Society
+FileDescription=The SWORD Project CD Installer
+FileVersion=1.5.3.0
+InternalName=cdstartup
+LegalCopyright=(c) 2002 CrossWire Software under the GNU General Public License
+LegalTrademarks=
+OriginalFilename=
+ProductName=The SWORD Project
+ProductVersion=1.5.3
+Comments=Seek Him and you will find Him
+
+[HistoryLists\hlIncludePath]
+Count=1
+Item0=$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=1
+Item0=$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[CORBA]
+AddServerUnit=1
+AddClientUnit=1
+PrecompiledHeaders=1
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.res b/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.res
new file mode 100644
index 0000000..e6b3991
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.res
Binary files differ
diff --git a/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.cpp b/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.cpp
new file mode 100644
index 0000000..843adef
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.cpp
@@ -0,0 +1,70 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "mainfrm.h"
+#include <shellapi.h>
+#include <dir.h>
+#include <stdio.h>
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TForm1 *Form1;
+//---------------------------------------------------------------------------
+__fastcall TForm1::TForm1(TComponent* Owner)
+ : TForm(Owner)
+{
+ char buf[2048];
+ char buf2[2048];
+
+ sprintf("SWORD_PATH=%s", getcwd(buf2, 2047));
+ putenv(buf);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::BitBtn1Click(TObject *Sender)
+{
+ WinExec(".\\Disk Images\\disk1\\setup.exe", SW_SHOWNORMAL);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::BitBtn2Click(TObject *Sender)
+{
+/*
+ static char *file = ".\\Windows\\sword.exe";
+ static char dir[2048]; // = "\\";
+ SHELLEXECUTEINFO sei;
+ memset(&sei, 0, sizeof(SHELLEXECUTEINFO));
+ sei.cbSize = sizeof(SHELLEXECUTEINFO);
+ sei.fMask = SEE_MASK_NOCLOSEPROCESS;
+ sei.hwnd = this->WindowHandle;
+ sei.lpFile = file;
+ sei.lpDirectory = getcwd(dir, 2047);
+ MessageBox(0, sei.lpDirectory, "cwd", MB_OK);
+ sei.nShow = SW_SHOWNORMAL;
+*/
+ WinExec(".\\Windows\\sword.exe", SW_SHOWNORMAL);
+// ShellExecute(this->Handle, "open", ".\\Windows\\sword.exe", NULL, "\\", SW_SHOWNORMAL);
+// ShellExecuteEx(&sei);
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FormShow(TObject *Sender)
+{
+// AddFontResource("\\sword\\modules\\texts\\rawtext\\nu\\greek.ttf");
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::BitBtn3Click(TObject *Sender)
+{
+ ShellExecute(this->Handle, "open", "http://www.crosswire.org", NULL, NULL, SW_SHOWNORMAL);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::BitBtn4Click(TObject *Sender)
+{
+ ShellExecute(this->Handle, "open", ".\\", NULL, NULL, SW_SHOWNORMAL);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::BitBtn5Click(TObject *Sender)
+{
+ WinExec(".\\fonts\\setup.exe", SW_SHOWNORMAL);
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.dfm b/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.dfm
new file mode 100644
index 0000000..6bb62ad
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/BibleCS/editentryfrm.cpp b/apps/windoze/CBuilder5/BibleCS/editentryfrm.cpp
new file mode 100644
index 0000000..01935e0
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/editentryfrm.cpp
@@ -0,0 +1,352 @@
+#include <vcl.h>
+#pragma hdrstop
+#include <windows.hpp>
+#include <stdlib.h>
+#include <stdio.h>
+#include "editentryfrm.h"
+#include <swdisprtf.h>
+#include "rxricheditx.h"
+
+const float RulerAdj = 4.0/3.0;
+const int GutterWid = 6;
+//----------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TEditEntryForm *EditEntryForm;
+//----------------------------------------------------------------------------
+__fastcall TEditEntryForm::TEditEntryForm(TComponent *Owner) : TForm(Owner) {
+ ResultBuf = 0;
+ RichEdit1 = new TRxRichEditX(this);
+
+ RichEdit1->Parent = pnlRichEdit;
+ RichEdit1->Align = alClient;
+ RichEdit1->ScrollBars = ssVertical;
+}
+
+
+__fastcall TEditEntryForm::~TEditEntryForm() {
+ if (ResultBuf)
+ delete [] ResultBuf;
+}
+
+
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::SelectionChange(TObject */*Sender*/) {
+ char sizebuf[6];
+
+ try {
+ FUpdating = True;
+ FirstInd->Left = int(RichEdit1->Paragraph->FirstIndent*RulerAdj)-
+ 4+GutterWid;
+ LeftInd->Left = int((RichEdit1->Paragraph->LeftIndent+
+ RichEdit1->Paragraph->FirstIndent)*RulerAdj)-
+ 4+GutterWid;
+ RightInd->Left = Ruler->ClientWidth-6-int(
+ (RichEdit1->Paragraph->RightIndent+GutterWid)*RulerAdj);
+
+ BoldButton->Down = RichEdit1->SelAttributes->Style.Contains(fsBold);
+ ItalicButton->Down = RichEdit1->SelAttributes->Style.Contains(fsItalic);
+ UnderlineButton->Down = RichEdit1->SelAttributes->Style.Contains(fsUnderline);
+
+ BulletsButton->Down = bool(RichEdit1->Paragraph->Numbering);
+
+ FontSize->Text = itoa(RichEdit1->SelAttributes->Size, sizebuf, 10);
+
+ switch((int)RichEdit1->Paragraph->Alignment)
+ { case 0: LeftAlign->Down = True; break;
+ case 1: RightAlign->Down = True; break;
+ case 2: CenterAlign->Down = True; break;
+ }
+ }
+ catch (...) {
+ FUpdating = False;
+ }
+ FUpdating = False;
+}
+
+
+//----------------------------------------------------------------------------
+TRxTextAttributes *__fastcall TEditEntryForm::CurrText(void)
+{
+ return RichEdit1->SelAttributes;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::CheckFileSave(void)
+{
+ if ( RichEdit1->Modified ) {
+ switch(MessageBox(Handle, "Save Changes?","Modify Comment",MB_YESNOCANCEL | MB_ICONQUESTION)) {
+ case ID_YES : ExtractRTF(); break;
+ case ID_CANCEL : Abort(); break;
+ default:
+ if (ResultBuf)
+ delete [] ResultBuf;
+ ResultBuf = 0;
+ break;
+ };
+ }
+}
+
+
+void __fastcall TEditEntryForm::SetupRuler(void)
+{ int iCtr = 1;
+ char sTmp[201];
+ while (iCtr < 200) {
+ sTmp[iCtr] = 9;
+ iCtr++;
+ sTmp[iCtr] = '|';
+ iCtr++;
+ }
+ Ruler->Caption = (AnsiString)sTmp;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::SetEditRect(void)
+{ TRect Rct = Rect(GutterWid, 0, RichEdit1->ClientWidth-GutterWid,
+ ClientHeight);
+ SendMessage(RichEdit1->Handle, EM_SETRECT, 0, long(&Rct));
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::FormCreate(TObject* /*Sender*/)
+{ Application->OnHint = &ShowHint;
+ SetupRuler();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::ShowHint(TObject* /*Sender*/)
+{ StatusBar->SimpleText = Application->Hint;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::EditUndoClick(TObject* /*Sender*/)
+{ if ( RichEdit1->HandleAllocated() )
+ SendMessage(RichEdit1->Handle, EM_UNDO, 0, 0);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::EditCutClick(TObject* /*Sender*/)
+{ RichEdit1->CutToClipboard();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::EditCopyClick(TObject* /*Sender*/)
+{ RichEdit1->CopyToClipboard();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::EditPasteClick(TObject* /*Sender*/)
+{ RichEdit1->PasteFromClipboard();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::RulerResize(TObject* /*Sender*/)
+{ RulerLine->Width = (int)Ruler->ClientWidth - (RulerLine->Left*2);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::FormResize(TObject* Sender)
+{ SetEditRect();
+ SelectionChange(Sender);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::FormPaint(TObject* /*Sender*/)
+{ SetEditRect();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::BoldButtonClick(TObject* /*Sender*/)
+{ if ( !FUpdating )
+ { if ( BoldButton->Down )
+ CurrText()->Style = CurrText()->Style << fsBold;
+ else
+ CurrText()->Style = CurrText()->Style >> fsBold;
+ }
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::ItalicButtonClick(TObject* /*Sender*/)
+{ if ( !FUpdating )
+ {
+ if ( ItalicButton->Down )
+ CurrText()->Style = CurrText()->Style << fsItalic;
+ else
+ CurrText()->Style = CurrText()->Style >> fsItalic;
+ }
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::UnderlineButtonClick(TObject* /*Sender*/)
+{
+ if ( !FUpdating ) {
+ if ( UnderlineButton->Down )
+ CurrText()->Style = CurrText()->Style << fsUnderline;
+ else CurrText()->Style = CurrText()->Style >> fsUnderline;
+ }
+}
+
+
+void __fastcall TEditEntryForm::FontSizeChange(TObject* /*Sender*/)
+{
+ int fontsize = atoi(FontSize->Text.c_str());
+
+ if ((!FUpdating) && (fontsize)) {
+ if (fontsize < 1) {
+ ShowMessage("Please Enter a Number betweek 1 and 1638");
+ FontSize->Text = 1;
+ }
+ else if (fontsize > 1638) {
+ ShowMessage("Please Enter a Number betweek 1 and 1638");
+ FontSize->Text = 1638;
+ }
+ CurrText()->Size = atoi(FontSize->Text.c_str());
+ }
+}
+
+
+void __fastcall TEditEntryForm::AlignClick(TObject* Sender)
+{
+ if ( !FUpdating ) {
+ TControl *oAliBtn = (TControl*)(Sender);
+ RichEdit1->Paragraph->Alignment = (TAlignment)oAliBtn->Tag;
+ }
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::BulletsButtonClick(TObject* /*Sender*/)
+{ if ( !FUpdating )
+ RichEdit1->Paragraph->Numbering = (TNumberingStyle)BulletsButton->Down;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::FormCloseQuery(TObject* /*Sender*/,
+ bool & CanClose)
+{ try {
+ CheckFileSave();
+ }
+ catch (...) {
+ CanClose = False;
+ }
+}
+//----------------------------------------------------------------------------
+
+//***************************
+//***Ruler Indent Dragging***
+//***************************
+
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::RulerItemMouseDown(TObject * Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{ TLabel * oTmpLabel = (TLabel *)Sender;
+ FDragOfs = oTmpLabel->Width / 2;
+ oTmpLabel->Left = oTmpLabel->Left+X-FDragOfs;
+ FDragging = True;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::RulerItemMouseMove(TObject *Sender, TShiftState Shift, int X, int /*Y*/) {
+ if (FDragging) {
+ TLabel *oTmpLabel = (TLabel *)Sender;
+ oTmpLabel->Left = oTmpLabel->Left+X-FDragOfs;
+ oTmpLabel->Left -= oTmpLabel->Left % 10;
+ }
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::FirstIndMouseUp(TObject *Sender, TMouseButton
+ Button, TShiftState Shift, int X, int Y)
+{ FDragging = False;
+ RichEdit1->Paragraph->FirstIndent = int((FirstInd->Left+FDragOfs-GutterWid) / RulerAdj);
+ LeftIndMouseUp(Sender, Button, Shift, X, Y);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::LeftIndMouseUp(TObject *Sender, TMouseButton
+ /*Button*/, TShiftState /*Shift*/, int /*X*/, int /*Y*/)
+{ FDragging = False;
+ RichEdit1->Paragraph->LeftIndent = int((LeftInd->Left+FDragOfs-GutterWid)/
+ RulerAdj)-RichEdit1->Paragraph->FirstIndent;
+ SelectionChange(Sender);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::RightIndMouseUp(TObject *Sender, TMouseButton
+ /*Button*/, TShiftState /*Shift*/, int /*X*/, int /*Y*/)
+{ FDragging = False;
+ RichEdit1->Paragraph->RightIndent =
+ int((Ruler->ClientWidth-RightInd->Left+FDragOfs-2) /
+ RulerAdj)-2*GutterWid;
+ SelectionChange(Sender);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntryForm::FormActivate(TObject *Sender)
+{
+ System::AnsiString newtext, tmptext;
+
+ if (Module) {
+ TMemoryStream *RTFStream = new TMemoryStream();
+ newtext = RTFDisplay->RTFHeader;
+ Module->Error(); // clear error;
+ newtext = newtext + "\\pard \\nowidctlpar \\cf0 ";
+ (const char *)*Module; // force key to snap to entry before pulling out the text of the key
+ tmptext = Module->getRawEntry();
+
+ newtext = newtext + RTFDisplay->RTFVersePre + " " + tmptext + RTFDisplay->RTFVersePost;
+ newtext = newtext + RTFDisplay->RTFTrailer;
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
+ RTFStream->Position = 0;
+ RichEdit1->Lines->LoadFromStream(RTFStream);
+ delete RTFStream;
+ }
+ SelectionChange(this);
+ RichEdit1->SetFocus();
+ if (ResultBuf)
+ delete [] ResultBuf;
+ ResultBuf = 0;
+}
+//---------------------------------------------------------------------
+
+void TEditEntryForm::ExtractRTF()
+{
+ System::AnsiString newtext, tmptext;
+ TMemoryStream *RTFStream = new TMemoryStream();
+ char *tmpbuf, *datastart;
+
+ RTFStream->Clear();
+ RichEdit1->Lines->SaveToStream(RTFStream);
+ RTFStream->Position = 0;
+ if (ResultBuf)
+ delete [] ResultBuf;
+ tmpbuf = new char [ RTFStream->Size + 1];
+ RTFStream->ReadBuffer(tmpbuf, RTFStream->Size);
+ tmpbuf[RTFStream->Size] = 0;
+ char *tbl = strstr(tmpbuf, "colortbl");
+ if (!tbl)
+ tbl = strstr(tmpbuf, "fonttbl");
+ if (tbl) {
+ strtok(tbl, "}");
+// strtok(NULL, "}");
+ datastart = strtok(NULL, "");
+ ResultBuf = new char [ strlen(datastart) + 2 ];
+ ResultBuf[0] = '{';
+ strcpy(ResultBuf+1, datastart);
+ delete [] tmpbuf;
+ delete RTFStream;
+ //-------- Change all fonts to \f1
+ for (int i = 0; i < strlen(ResultBuf)-4; i++) {
+ if (ResultBuf[i] == '\\') {
+ if (ResultBuf[i+1] == '\\') { // skip a real '\' character
+ i += 1;
+ continue;
+ }
+ if (ResultBuf[i+1] == 'f') {
+ if (isdigit(ResultBuf[i+2])) {
+ ResultBuf[i+2] = '1';
+ if (isdigit(ResultBuf[i+3])) {
+ memmove(&ResultBuf[i+3], &ResultBuf[i+4], strlen(&ResultBuf[i+3]));
+ }
+ }
+ }
+ if (ResultBuf[i+1] == 'c') {
+ if (ResultBuf[i+2] == 'f') {
+ if (isdigit(ResultBuf[i+3])) {
+ ResultBuf[i+3] = '7';
+ if (isdigit(ResultBuf[i+4])) {
+ memmove(&ResultBuf[i+4], &ResultBuf[i+5], strlen(&ResultBuf[i+4]));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+__fastcall TCharsetObject::TCharsetObject(int FCharset)
+ : TObject()
+{
+ Charset = FCharset;
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
new file mode 100644
index 0000000..3aee541
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
@@ -0,0 +1,2821 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#include <vcl/clipbrd.hpp>
+#pragma hdrstop
+
+#include "mainfrm.h"
+#include "swdisprtfchap.h"
+#include "searchfrm.h"
+#include "swwinlog.h"
+#include "AboutBoxfrm.h"
+#include "ModInstForm.h"
+#include "biblecsmgr.h"
+#include "Greek2Greek.h"
+#include "bookmarkfrm.h"
+#include "optionfrm.h"
+#include "vrslstfrm.h"
+#include <utilstr.h>
+#include <filemgr.h>
+#include <localemgr.h>
+#include "editentryfrm.h"
+#include "versesel.h"
+#include "splashfrm.h"
+#include "ModVisFrm.h"
+#include "DevOfTheDay.h"
+#include "SplashPage.h"
+//#include "nsEmbedAPI.h"
+#include <graphics.hpp>
+#include "sword.h"
+#include "rtfhintfrm.h"
+#include "newbmfilefrm.h"
+#include "RangeMaintFrm.h"
+#include "PrintFrm.h"
+#include "PreviewForm.h"
+//---------------------------------------------------------------------------
+#pragma link "RxRichEd"
+//#pragma link "MOZILLACONTROLLib_OCX"
+//#pragma link "SHDocVw_OCX"
+#pragma resource "*.dfm"
+
+static const char *rtfclasses[] = {"RTFDisp", "SWDisplay", "SWObject", 0};
+SWClass RTFDisp::classdef(rtfclasses);
+
+TForm1 *Form1;
+//---------------------------------------------------------------------------
+
+
+/*
+inline AnsiString& operator=(AnsiString& dest, const string& src) {
+ dest = src.c_str();
+ return dest;
+}
+
+*/
+
+void __fastcall TForm1::AppMessage(tagMSG &Msg, bool &Handled)
+{
+ if (Msg.message == WM_VERSE)
+ {
+ HKEY hkey;
+ LONG result;
+ unsigned long verSize = 32;
+ result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "sword\\OpenVerse", NULL, KEY_READ | KEY_WRITE, &hkey);
+ result = RegQueryValueEx(hkey, NULL, NULL, NULL, NULL, &verSize);
+ char* verStr = new char[verSize];
+ result = RegQueryValueEx(hkey, NULL, NULL, NULL, verStr, &verSize);
+ result = RegCloseKey(hkey);
+ result = RegDeleteKey(HKEY_CLASSES_ROOT, "sword\\OpenVerse");
+ NavigateVerseURL(verStr);
+ Handled = true;
+ }
+}
+
+void TForm1::NavigateVerseURL (char* verStrIN)
+{
+ unsigned long verSize = strlen(verStrIN) + 1;
+ char * verStr = new char[verSize];
+ strcpy (verStr, verStrIN);
+ char * verStr2 = new char[verSize];
+ unsigned long verSize2 = 0;
+ if (*(verStr + verSize - 2) == '\"') {
+ *(verStr + verSize - 2) = 0;
+ }
+ verSize = 0;
+ if (strstr(verStr, "libronix")) {
+ char* bib = strstr(verStr, "bible:");
+ if (bib) {
+ verSize = 6 + (unsigned long)(bib - verStr);
+ }
+ }
+ else if (strstr(verStr, "sword://")) {
+ verSize = 9;
+ }
+ else if (*verStr == '\"') {
+ verSize = 1;
+ }
+
+ while (verStr[verSize] != 0) {
+ verStr2[verSize2] = verStr[verSize];
+ verSize++;
+ verSize2++;
+ }
+ verStr2[verSize2] = 0;
+
+ char * verse = strstr(verStr2, "/");
+ if (verse) {
+ *verse = 0;
+ verse++;
+ }
+ else {
+ verse = verStr2;
+ verStr2 = 0;
+ }
+
+ freeHandLookup->Text = verse;
+ freeHandLookupoldKeyPress(0, '\r');
+
+ delete [] verStr;
+ delete [] verStr2;
+}
+
+__fastcall TForm1::TForm1(TComponent* Owner)
+ : TForm(Owner)
+{
+ optionsconf = new SWConfig("./options.conf");
+
+ // add our ui locale info to sword's system localemgr
+ LocaleMgr::systemLocaleMgr.loadConfigDir("./uilocales.d");
+
+ Lookup->Text = "[ SWORD DDE Lookup ]";
+ Search->Text = "[ SWORD DDE Search ]";
+ modstates.clear();
+ displays.clear();
+ ctrlstates.clear();
+ DefaultVSKey = 0;
+ DefaultStrKey = 0;
+ clickText = "";
+
+ lbDictKeysOld->Visible = false;
+ DictKeyEditOld->Visible = false;
+ lbDictKeys = new TTntListBox(this);
+ lbDictKeys->Parent = Panel2;
+ lbDictKeys->Align = alClient;
+ lbDictKeys->Font->Name = "Code2000";
+ lbDictKeys->OnClick = lbDictKeysOldClick;
+
+ DictKeyEdit = new TTntEdit(this);
+ DictKeyEdit->Parent = Panel2;
+ DictKeyEdit->Align = alTop;
+ DictKeyEdit->Font->Name = "Code2000";
+ DictKeyEdit->OnChange = DictKeyEditOldChange;
+ renderingHint = false;
+ closing = false;
+}
+
+void __fastcall TForm1::DisplayHint(TObject* Sender)
+{
+ StatusBar1->SimpleText = GetLongHint(Application->Hint);
+}
+
+//---------------------------------------------------------------------------
+__fastcall TForm1::~TForm1()
+{
+
+ list <SWDisplay *>::iterator it;
+ int loop;
+
+
+ if (mainmgr)
+ delete mainmgr;
+ for (it = displays.begin(); it != displays.end(); it++)
+ delete *it;
+
+ if (layoutconf)
+ delete layoutconf;
+
+ if (optionsconf)
+ delete optionsconf;
+
+ for (loop = 0; loop < 10; loop++) {
+ if (ctrlstates[loop])
+ delete ctrlstates[loop];
+ }
+
+ if (DefaultVSKey)
+ delete DefaultVSKey;
+ if (DefaultStrKey)
+ delete DefaultStrKey;
+
+ list <ModState *>::iterator mit;
+ for (mit = modstates.begin(); mit != modstates.end(); mit++) {
+ delete (*mit);
+ }
+}
+//---------------------------------------------------------------------------
+
+char TForm1::CreateTextPane(SWModule *mod, char *font) {
+ TTabSheet *newtab = new TTabSheet(this);
+ SWDispRTFChap *newrtf = new SWDispRTFChap(this);
+ char buf[1024];
+ SectionMap::iterator sit;
+
+ newtab->Caption = mod->Name();
+ newtab->Hint = mod->Description();
+ newtab->ParentShowHint = true;
+ newtab->PageControl = TextPageControl;
+ newrtf->Parent = newtab;
+ newrtf->Align = alClient;
+ newrtf->ScrollBars = ssVertical;
+ newrtf->ReadOnly = true;
+ newrtf->PopupMenu = (strcmp(mod->Name(), "N27U4")) ? PopupMenu2 : PopupMenu1;
+ newrtf->OnMouseDown = RTFMouseDown;
+ newrtf->Name = String("TextRTF")+mod->Name();
+
+ newrtf->module = mod;
+ newrtf->recalcAppearance();
+
+ SWDisplay *disp = new RTFDisp(newrtf);
+ mod->Disp(disp);
+ displays.insert(displays.begin(), disp);
+ mod->SetKey(*DefaultVSKey);
+
+ return 0;
+}
+//---------------------------------------------------------------------------
+char TForm1::CreateCommentPane(SWModule *mod, char* font) {
+ TTabSheet *newtab = new TTabSheet(this);
+ TWinControl *newrtf;
+ char buf[1024];
+ SectionMap::iterator sit;
+
+ if ((*mainmgr->config->Sections[mod->Name()].find("ModDrv")).second == "HREFCom") {
+// if (mainmgr->config->Sections[mod->Name()]["External"] == "1") {
+ newrtf = new TPanel(this);
+ ((TPanel *)newrtf)->Caption = "Syncronizing to External Viewer";
+ SWDisplay *disp = new DispExternal();
+ mod->Disp(*displays.insert(displays.begin(), disp));
+/*
+ }
+ else {
+ // newrtf = new THTML(this->Handle);
+ // newrtf = new SWDispRTF(this);
+ newrtf = HTML1;
+ newrtf->Visible = true;
+ mod->Disp(*displays.insert(displays.begin(), new HREFDisp((THTML *)newrtf)));
+ // mod->Disp(*displays.insert(displays.begin(), new RTFDisp((SWDispRTF *)newrtf)));
+ }
+*/
+ }
+ else {
+/* IE Control
+ newrtf = new TCppWebBrowser(this);
+ HREFDisp *disp = new HREFDisp((TCppWebBrowser *)newrtf);
+ newrtf->Visible = true;
+ mod->Disp(*displays.insert(displays.begin(), disp));
+ ((TCppWebBrowser *)newrtf)->OnBeforeNavigate2 = CppWebBrowser1BeforeNavigate2;
+*/
+ newrtf = new SWDispRTF(this);
+
+ SWDisplay *disp = new RTFDisp((SWDispRTF *)newrtf);
+ mod->Disp(*displays.insert(displays.begin(), disp));
+ ((SWDispRTF *)newrtf)->ScrollBars = ssVertical;
+ ((SWDispRTF *)newrtf)->ReadOnly = true;
+ ((SWDispRTF *)newrtf)->Name = String("CommentRTF")+mod->Name();
+
+ if ((*mainmgr->config->Sections[mod->Name()].find("ModDrv")).second == "RawFiles") {
+ ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu3;
+ ((SWDispRTF *)newrtf)->ExpandNewLine = false;
+ }
+ else ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2;
+ ((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown;
+ ((SWDispRTF *)newrtf)->OnURLClick = RTFURLClick;
+ }
+
+ newtab->Caption = mod->Name();
+ newtab->Hint = mod->Description();
+ newtab->ParentShowHint = true;
+ newtab->PageControl = CommentaryPageControl;
+
+ newrtf->Parent = newtab;
+ newrtf->Align = alClient;
+ ((SWDispRTF *)newrtf)->module = mod;
+ ((SWDispRTF *)newrtf)->recalcAppearance();
+
+ mod->SetKey(*DefaultVSKey);
+ return 0;
+}
+//---------------------------------------------------------------------------
+char TForm1::CreateLDPane(SWModule *mod, char* font) {
+ TTabSheet *newtab = new TTabSheet(this);
+ SWDispRTF *newrtf = new SWDispRTF(this);
+ SectionMap::iterator sit;
+ char buf[1024];
+
+ newtab->Caption = mod->Name();
+ newtab->Hint = mod->Description();
+ newtab->ParentShowHint = true;
+ newtab->PageControl = LexDictPageControl;
+
+ newrtf->Parent = newtab;
+ newrtf->Align = alClient;
+ newrtf->ScrollBars = ssVertical;
+ newrtf->ReadOnly = true;
+ newrtf->Name = String("LexDictRTF")+mod->Name();
+ newrtf->PopupMenu = PopupMenu2;
+ newrtf->OnMouseDown = RTFMouseDown;
+ newrtf->OnURLClick = RTFURLClick;
+ newrtf->module = mod;
+ newrtf->recalcAppearance();
+
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) {
+ if ((*sit).second.find("LDBackColor") != (*sit).second.end()) {
+ lbDictKeys->Color = TColor((atoi((*(*sit).second.find("LDBackColor")).second.c_str())));
+ }
+ if ((*sit).second.find("LDFontColor") != (*sit).second.end())
+ lbDictKeys->Font->Color = TColor((atoi((*(*sit).second.find("LDFontColor")).second.c_str())));
+ }
+ SWDisplay *disp = new RTFDisp(newrtf);
+ mod->Disp(*displays.insert(displays.begin(), disp));
+ mod->SetKey(*DefaultStrKey);
+ return 0;
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::BookTOCChange(TObject* Sender, TTreeNode* Node) {
+ ModMap::iterator it;
+
+ if (mainmgr) {
+ it = mainmgr->Modules.find(CommentaryPageControl->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ ((TreeKeyIdx *)(SWKey *)*(it->second))->setOffset((long)Node->Data);
+ (*it).second->Display();
+ if (logmodstate)
+ modstates.insert(modstates.begin(), new ModState(CommentaryPageControl, CommentaryPageControl->ActivePage, (*it).second->KeyText()));
+ }
+ }
+}
+
+
+char TForm1::CreateBookPane(SWModule *mod, char* font) {
+ TTabSheet *newtab = new TTabSheet(this);
+ TWinControl *newrtf;
+ char buf[1024];
+ SectionMap::iterator sit;
+ TTreeView *toc = new TTreeView(this);
+
+ newtab->Caption = mod->Name();
+ newtab->Hint = mod->Description();
+ newtab->ParentShowHint = true;
+ newtab->PageControl = CommentaryPageControl;
+
+ TSplitter *splitter = new TSplitter(this);
+ splitter->Parent = newtab;
+ splitter->Align = alLeft;
+
+ toc->Parent = newtab;
+ toc->Align = alLeft;
+ toc->OnChange = BookTOCChange;
+ toc->Items->Clear();
+
+ newrtf = new SWDispRTF(this);
+ SWDisplay *disp = new RTFBookDisp((SWDispRTF *)newrtf, toc);
+ mod->Disp(*displays.insert(displays.begin(), disp));
+ ((SWDispRTF *)newrtf)->ScrollBars = ssVertical;
+ ((SWDispRTF *)newrtf)->ReadOnly = true;
+
+ if ((*mainmgr->config->Sections[mod->Name()].find("ModDrv")).second == "RawFiles") {
+ ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu3;
+ ((SWDispRTF *)newrtf)->ExpandNewLine = false;
+ }
+ else ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2;
+ ((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown;
+ newrtf->Parent = newtab;
+ newrtf->Align = alClient;
+ ((SWDispRTF *)newrtf)->module = mod;
+ ((SWDispRTF *)newrtf)->recalcAppearance();
+
+
+
+// mod->SetKey(*DefaultVSKey);
+ return 0;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::TextPageControlChange(TObject *Sender)
+{
+ RefreshActiveSheet(TextPageControl);
+ Form1->ActiveControl = TextPageControl;
+}
+//---------------------------------------------------------------------------
+void TForm1::RefreshActiveSheet(TPageControl *pc)
+{
+ ModMap::iterator it;
+
+ if (mainmgr) {
+ it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ SWModule *module = it->second;
+ module->Display();
+ if (logmodstate)
+ modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, module->KeyText()));
+ if (pc == LexDictPageControl)
+ FillDictKeys();
+ }
+ }
+}
+
+
+void TForm1::TextKeyChanged()
+{
+ cbBook->ItemIndex = cbBook->Items->IndexOf(DefaultVSKey->books[DefaultVSKey->Testament()-1][DefaultVSKey->Book()-1].name);
+ CHBox->Text = DefaultVSKey->Chapter();
+ VSBox->Text = DefaultVSKey->Verse();
+ freeHandLookup->Text = (const char *)*DefaultVSKey;
+ RefreshActiveSheet(TextPageControl);
+ logmodstate = false; // only log state once
+ RefreshActiveSheet(CommentaryPageControl);
+ logmodstate = true;
+}
+
+
+void __fastcall TForm1::btnLookupClick(TObject *Sender)
+{
+ if (!(StrToInt(CHBox->Text)) || (!StrToInt(VSBox->Text)))
+ DefaultVSKey->AutoNormalize(0);
+
+ if (StrToInt(CHBox->Text) < 0)
+ CHBox->Text = StrToInt(CHBox->Text) + 1;
+ if (StrToInt(VSBox->Text) < 0)
+ VSBox->Text = StrToInt(VSBox->Text) + 1;
+
+ (*DefaultVSKey) = (cbBook->Text + " " + CHBox->Text + ":" + VSBox->Text).c_str();
+ TextKeyChanged();
+ DefaultVSKey->AutoNormalize(1);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::CommentaryPageControlChange(TObject *Sender)
+{
+ RefreshActiveSheet(CommentaryPageControl);
+ Form1->ActiveControl = CommentaryPageControl;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::DictKeyEditOldChange(TObject *Sender)
+{
+ if (DefaultStrKey) {
+// if (DictKeyEdit->Modified) {
+ *DefaultStrKey = WideStringToUTF8(DictKeyEdit->Text).c_str();
+ RefreshActiveSheet(LexDictPageControl);
+ DictKeyEdit->Modified = false;
+// }
+ }
+}
+
+void TForm1::FillDictKeys() {
+ ModMap::iterator it;
+ int index = 0;
+ SWKey saveKey;
+ ConfigEntMap::const_iterator const_eit;
+ string fontname;
+
+ if (mainmgr) {
+ it = mainmgr->Modules.find(LexDictPageControl->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ SWModule *module = (*it).second;
+ RTFDisp *disp = SWDYNAMIC_CAST(RTFDisp, module->Disp());
+ if (disp) {
+ SWDispRTF *rtfDisp = (SWDispRTF*) disp->editControl();
+ rtfDisp->recalcAppearance();
+ lbDictKeys->Font->Name = rtfDisp->dispAttribs.fontName;
+ lbDictKeys->Font->Size = rtfDisp->dispAttribs.fontSize;
+
+ DictKeyEdit->Font->Name = rtfDisp->dispAttribs.fontName;
+ DictKeyEdit->Font->Size = rtfDisp->dispAttribs.fontSize;
+ }
+
+ module->KeyText(); // snap to entry
+ saveKey = module->KeyText();
+ int count = lbDictKeys->Height / lbDictKeys->ItemHeight;
+ lbDictKeys->Items->Clear();
+ for (int i = 0; i < (count / 2); i++)
+ (*module)++;
+ for (int i = 0; i < count-1; i++)
+ (*module)--;
+ module->Error();
+ for (;!module->Error() && count;count--,(*module)++) {
+ lbDictKeys->Items->Add(UTF8ToWideString(module->KeyText()));
+ if (saveKey == module->Key())
+ index = lbDictKeys->Items->Count-1;
+ }
+ lbDictKeys->ItemIndex = index;
+ }
+ }
+}
+
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::LexDictPageControlChange(TObject *Sender)
+{
+ *DefaultStrKey = WideStringToUTF8(DictKeyEdit->Text).c_str();
+ RefreshActiveSheet(LexDictPageControl);
+ Form1->ActiveControl = LexDictPageControl;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::NewSearchWindow1Click(TObject *Sender) {
+
+ searchForm->Show();
+}
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Exit1Click(TObject *Sender)
+{
+ Close();
+}
+
+void __fastcall TForm1::About1Click(TObject *Sender)
+{
+ AboutBox->ShowModal();
+}
+
+
+WideString TForm1::TrimJunk(WideString src) {
+ bool hasDigit = false;
+ bool hasAlpha = false;
+ WideString retVal = "";
+
+ int len = src.Length();
+ for (int i = 1; i <=len; i++) {
+ if (isdigit(src[i]))
+ hasDigit = true;
+ if (isalpha(src[i]) || (src[i] > 255))
+ hasAlpha = true;
+ }
+ for (int i = 1; i <= len; i++) {
+ if (hasDigit && !hasAlpha) { // number
+ if (isdigit(src[i])) retVal += src[i];
+ }
+ else if (hasAlpha) { // alpha
+ if (isalpha(src[i]) || (src[i] > 255)) retVal += src[i];
+ }
+ else retVal += src[i];
+ }
+ return retVal;
+}
+
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::DictionaryLookup1Click(TObject *Sender)
+{
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ int wordstart;
+ int saveSelStart = rtf->SelStart;
+ String lookupKey;
+ ConfigEntMap::iterator eit;
+ char preChar = 0;
+
+ if (!rtf->SelLength) {
+ preChar = (rtf->WordAtCursor().Length()) ? rtf->WordAtCursor()[1] : 0;
+ lookupKey = TrimJunk(rtf->WordAtCursor());
+ }
+ else {
+ preChar = rtf->Text[(rtf->SelStart)?rtf->SelStart:0];
+ lookupKey = Trim(rtf->SelText);
+ }
+
+ // check if all digits (strongs)
+ int i;
+ for (i = 0; i < strlen(lookupKey.c_str()); i++) {
+ if (!isdigit(lookupKey.c_str()[i]))
+ break;
+ }
+
+ if ((i == strlen(lookupKey.c_str())) && (i)) {
+ String curLex = LexDictPageControl->ActivePage->Caption;
+ String feature = (DefaultVSKey->Testament() == 1)?"Hebrew":"Greek";
+ feature += (preChar == '(')?"Parse":"Def";
+ if (!strncmp(rtf->Name.c_str(), "TextRTFLXX", 10))
+ feature = "GreekDef";
+ if (!hasFeature(mainmgr, curLex.c_str(), feature.c_str())) {
+ string tmpval = ((eit = optionsconf->Sections["ModDefaults"].find(feature.c_str())) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ for (int i = 0; i < LexDictPageControl->PageCount; i++) {
+ if (!stricmp(LexDictPageControl->Pages[i]->Caption.c_str(), tmpval.c_str())) {
+ LexDictPageControl->ActivePageIndex = i;
+ break;
+ }
+ }
+ }
+ }
+
+ DictKeyEdit->Text = UTF8ToWideString(lookupKey);
+}
+
+
+void __fastcall TForm1::verseLookupClick(TObject *Sender)
+{
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ int wordstart;
+ int saveSelStart = rtf->SelStart;
+
+ if (!rtf->SelLength) {
+ for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--);
+ rtf->SelStart = (wordstart > -1) ? wordstart: 0;
+ for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++);
+ rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length()) - rtf->SelStart - 1;
+ freeHandLookup->Text = Trim(rtf->SelText);
+ rtf->SelStart = saveSelStart;
+ rtf->SelLength = 0;
+ }
+ else freeHandLookup->Text = Trim(rtf->SelText);
+ char ret = '\r';
+ freeHandLookupoldKeyPress(Sender, ret);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::SaveLayout1Click(TObject *Sender)
+{
+ ConfigEntMap sit;
+ sit = layoutconf->Sections["Screen"];
+ if(Form1->WindowState == wsMaximized) {
+ sit["Maximized"] = "true";
+ }
+ else {
+ sit["Maximized"] = "false";
+ sit["MainTop"] = IntToStr(Form1->Top).c_str();
+ sit["MainLeft"] = IntToStr(Form1->Left).c_str();
+ sit["MainHeight"] = IntToStr(Form1->Height).c_str();
+ sit["MainWidth"] = IntToStr(Form1->Width).c_str();
+ }
+ sit["TextComHeight"] = IntToStr(pnlTextCom->Height).c_str();
+ sit["TextWidth"] = IntToStr(pnlText->Width).c_str();
+
+ if(searchForm->WindowState == wsMaximized) {
+ sit["SearchMaximized"] = "true";
+ }
+ else {
+ sit["SearchMaximized"] = "false";
+ sit["SearchTop"] = IntToStr(searchForm->Top).c_str();
+ sit["SearchLeft"] = IntToStr(searchForm->Left).c_str();
+ sit["SearchWidth"] = IntToStr(searchForm->Width).c_str();
+ sit["SearchHeight"] = IntToStr(searchForm->Height).c_str();
+ }
+
+ OptionsList options = mainmgr->getGlobalOptions();
+ for (OptionsList::iterator it = options.begin(); it != options.end(); it++) {
+ string value = mainmgr->getGlobalOption(it->c_str());
+ (*layoutconf)["ModuleOptions"][it->c_str()] = value;
+ }
+ layoutconf->Sections["Screen"] = sit;
+ layoutconf->Save();
+}
+
+
+void TForm1::fillVKeySelector(VerseKey *vk) {
+ VerseKey *myVk = (VerseKey *)vk->clone();
+ myVk->Error(); //clear error
+ (*myVk) = TOP;
+ cbBook->Clear();
+ while (!myVk->Error()) {
+ AnsiString s1 = (const char *)(*myVk);
+ s1.SetLength(s1.Length() - 4);
+ cbBook->Items->Add(s1);
+ myVk->Book(myVk->Book() + 1);
+ }
+ delete myVk;
+}
+
+
+void TForm1::i12ize(const char *lang) {
+ LocaleMgr::systemLocaleMgr.setDefaultLocaleName(lang);
+
+ // TODO 5 -cConfiguration Ops -oScribe: add mainmgr->configpath, or something, to beginning of these image names ???
+ const char *tmp;
+ Graphics::TBitmap *bitmap = 0;
+ TPicture *pic = new TPicture();
+
+ ImageList1->Clear();
+
+ tmp = _tr("BackBtnImage");
+ if (strcmp("BackBtnImage", tmp)) {
+ pic->LoadFromFile(tmp);
+ bitmap = pic->Bitmap;
+ }
+ else bitmap = BackBtnImage->Picture->Bitmap;
+
+ TColor transColor = bitmap->Canvas->Pixels[0][0];
+ ImageList1->AddMasked(bitmap, transColor);
+
+ tmp = _tr("SearchBtnImage");
+ if (strcmp("SearchBtnImage", tmp)) {
+ pic->LoadFromFile(tmp);
+ bitmap = pic->Bitmap;
+ }
+ else bitmap = SearchBtnImage->Picture->Bitmap;
+
+ transColor = bitmap->Canvas->Pixels[0][0];
+ ImageList1->AddMasked(bitmap, transColor);
+
+ bitmap = BookmarkBtnImage->Picture->Bitmap;
+ transColor = bitmap->Canvas->Pixels[0][0];
+ ImageList2->AddMasked(bitmap, transColor);
+
+ delete pic;
+
+ // MainForm
+ File1->Caption = _tr("&File");
+ SaveLayout1->Caption = _tr("S&ave Layout");
+ Print1->Caption = _tr("&Print...");
+ Exit1->Caption = _tr("E&xit");
+ Edit1->Caption = _tr("&Edit");
+ Copy1->Caption = _tr("&Copy");
+ Copy2->Caption = _tr("&Copy");
+ Copy3->Caption = _tr("&Copy");
+ Copy4->Caption = _tr("&Copy");
+ CopyasBGreekTransliteration1->Caption = _tr("Copy as &B-Greek Transliteration");
+ MenuItem1->Caption = _tr("Dictionary Lookup");
+ Copy4->Caption = _tr("&Copy");
+ Copy4->Caption = _tr("&Copy");
+ Copy4->Caption = _tr("&Copy");
+ Options2->Caption = _tr("Options");
+ Options1->Caption = _tr("&Preferences...");
+ Search1->Caption = _tr("&Search");
+ NewSearchWindow1->Caption = _tr("&New Search Window");
+ Tools1->Caption = _tr("&Tools");
+ InstallManager1->Caption = _tr("Install Manager");
+ Help1->Caption = _tr("&Help");
+ Contents1->Caption = _tr("Contents");
+ DevotionaloftheDay1->Caption = _tr("Devotional of the Day");
+ About1->Caption = _tr("&About");
+ Bookmarkbtn->Caption = _tr("Bookmark");
+ DictionaryLookup1->Caption = _tr("Dictionary Lookup");
+ DictionaryLookup2->Caption = _tr("Dictionary Lookup");
+ EditEntry1->Caption = _tr("&Edit Entry");
+ DeleteEntry1->Caption = _tr("&Delete Entry");
+ LinktoVerse1->Caption = _tr("Link to Comment for Verse...");
+ AddBookmark1->Caption = _tr("&Add Bookmark");
+ EditBookmarks1->Caption = _tr("&Edit Bookmarks / Tree View...");
+ HideShowModules1->Caption = _tr("Hide / Show Modules");
+ ToolButton3->Hint = _tr("Go Back To Previous Location");
+ ToolButton4->Hint = _tr("Bring Up Search Window");
+ TextPageControl->Hint = _tr("Biblical Texts");
+ CommentaryPageControl->Hint = _tr("Commentaries");
+ LexDictPageControl->Hint = _tr("Lexicons / Dictionaries");
+ // AboutBox
+ AboutBox->Caption = _tr("About The SWORD Project");
+ AboutBox->OKButton->Caption = _tr("OK");
+
+ // bookmarkForm
+ bookmarkForm->Caption = _tr("Bookmarks");
+
+ // DevOfTheDay2
+ DevOfTheDay2->Caption = _tr("Devotion for Today");
+ DevOfTheDay2->ckShowTip->Caption = _tr("Show Devotional at Startup");
+ DevOfTheDay2->btnOK->Caption = _tr("&Close");
+ DevOfTheDay2->Label1->Caption = _tr("Words To Live By...");
+
+ // EditEntryForm
+ EditEntryForm->Caption = _tr("Edit Entry");
+ EditEntryForm->Label1->Caption = _tr("Font Size:");
+
+
+
+ // ModInstForm
+ ModInstFrm->Caption = _tr("Found New Module...");
+ ModInstFrm->OkBtn->Caption = _tr("OK");
+
+ // ModVisForm
+ ModVisForm->Caption = _tr("Check Modules To Show As Tabs");
+ ModVisForm->modList->Columns->Items[0]->Caption = _tr("Module");
+ ModVisForm->modList->Columns->Items[1]->Caption = _tr("Description");
+ ModVisForm->OkBtn->Caption = _tr("OK");
+ ModVisForm->CancelBtn->Caption = _tr("Cancel");
+
+ // NewBMfrm
+ NewBMfrm->Caption = _tr("Add New Bookmark File");
+ NewBMfrm->Label1->Caption = _tr("File Name (without extension):");
+ NewBMfrm->Label2->Caption = _tr("Bookmark Section Title:");
+ NewBMfrm->OkBtn->Caption = _tr("OK");
+ NewBMfrm->CancelBtn->Caption = _tr("Cancel");
+
+ // OptionsForm
+ Optionsfrm->Caption = _tr("Preferences");
+ Optionsfrm->TabSheet1->Caption = _tr("General");
+ Optionsfrm->TabSheet2->Caption = _tr("Special Modules");
+ Optionsfrm->TabSheet3->Caption = _tr("Display");
+ Optionsfrm->gbPersonalize->Caption = _tr("Personalize");
+ Optionsfrm->AutoBMPersonal->Caption = _tr("Save Personal Bookmarks");
+ Optionsfrm->AutoBMOther->Caption = _tr("Save Other Bookmarks");
+ Optionsfrm->HintPopups->Caption = _tr("Show Hint Pop-ups");
+ Optionsfrm->Label4->Caption = _tr("Language");
+ Optionsfrm->AutoLayout->Caption = _tr("Save Screen Layout");
+ Optionsfrm->HintStrongs->Caption = _tr("Show Hint Over Strongs Numbers");
+ Optionsfrm->OkBtn->Caption = _tr("OK");
+ Optionsfrm->CancelBtn->Caption = _tr("Cancel");
+ Optionsfrm->gbDefModules->Caption = _tr("Original Language Support - Default Modules");
+ Optionsfrm->Label7->Caption = _tr("Definitions");
+ Optionsfrm->Label8->Caption = _tr("Parsing");
+ Optionsfrm->Label5->Caption = _tr("Greek");
+ Optionsfrm->Label6->Caption = _tr("Hebrew");
+ Optionsfrm->Label10->Caption = _tr("Strong's Numbered Text");
+ Optionsfrm->gbDevos->Caption = _tr("Daily Devotionals");
+ Optionsfrm->Label9->Caption = _tr("Default Devotional");
+ Optionsfrm->devSplashCB->Caption = _tr("Show Devotional Splash Screen on Startup");
+ Optionsfrm->devsAsDictsCB->Caption = _tr("Show Devotionals as Dictionaries");
+ Optionsfrm->gbGloss->Caption = _tr("Glossaries");
+ Optionsfrm->glosAsDictsCB->Caption = _tr("Show Glossaries as Dictionaries");
+ Optionsfrm->gbColors->Caption = _tr("Display Colors");
+ Optionsfrm->Label2->Caption = _tr("Preview");
+ Optionsfrm->Label3->Caption = _tr("Module Type");
+ Optionsfrm->Label14->Caption = _tr("Scheme");
+ Optionsfrm->Label11->Caption = _tr("Text Font");
+ Optionsfrm->btnFont->Caption = _tr("Select Font...");
+ Optionsfrm->Label13->Caption = _tr("Verse Number Color");
+ Optionsfrm->btnNumClr->Caption = _tr("Select Color...");
+ Optionsfrm->AutoVSColor->Caption = _tr("Current Verse Color");
+ Optionsfrm->btnCurrVerse->Caption = _tr("Select Color...");
+ Optionsfrm->Label15->Caption = _tr("Combo/Edit Fields");
+ Optionsfrm->btnFieldClr->Caption = _tr("Select Color...");
+ Optionsfrm->Label1->Caption = _tr("Individual Modules (Font Only)");
+ Optionsfrm->btnModFonts->Caption = _tr("Select Font...");
+ Optionsfrm->Label12->Caption = _tr("Strong's Numbers <...>");
+ Optionsfrm->Label16->Caption = _tr("Strong's Tense (...)");
+ Optionsfrm->btnStrongClr->Caption = _tr("Select Color...");
+ Optionsfrm->btnMorphClr->Caption = _tr("Select Color...");
+
+ // RangeMaintForm
+ RangeMaintForm->Caption = _tr("Maintain Custom Ranges");
+ RangeMaintForm->Label1->Caption = _tr("Range Name");
+ RangeMaintForm->Label2->Caption = _tr("Range Text");
+ RangeMaintForm->Label3->Caption = _tr("eg. mat-jo;rev4");
+ RangeMaintForm->SpeedButton1->Caption = _tr("&Add");
+ RangeMaintForm->SpeedButton2->Caption = _tr("&Remove");
+ RangeMaintForm->SpeedButton3->Caption = _tr("&Save");
+ RangeMaintForm->SpeedButton4->Caption = _tr("&Cancel");
+
+ // searchForm
+ searchForm->Caption = _tr("Search...");
+ searchForm->searchBtn->Caption = _tr("Search");
+ searchForm->searchTypeGroup->Caption = _tr("Search Type");
+ searchForm->searchTypeGroup->Items->CommaText = _tr("\"Mult Word\",\"Phrase\",\"Regular Expression\"");
+ searchForm->caseSensitiveCkBx->Caption = _tr("Case Sensitive");
+ searchForm->searchOptionsGroup->Caption = _tr("Search Options");
+ searchForm->scopeGroup->Caption = _tr("Scope");
+ searchForm->scopeGroup->Items->CommaText = _tr("\"Entire Module\",\"Current Results\",\"Custom Range\"");
+ searchForm->customRangeBtn->Caption = _tr("Define Custom Range");
+ searchForm->resultsLV->Columns->Items[0]->Caption = _tr("Reference");
+ searchForm->resultsLV->Columns->Items[1]->Caption = _tr("Preview...");
+ searchForm->lblChooseModule->Caption = _tr("Choose Module");
+ searchForm->Button2->Caption = _tr("&Help");
+
+ // VerseSelFrm
+ VerseSelFrm->Caption = _tr("Type Verse");
+ VerseSelFrm->OkBtn->Caption = _tr("OkBtn");
+ VerseSelFrm->CancelBtn->Caption = _tr("Cancel");
+
+ // VerseListFrm
+ VerseListFrm->Caption = _tr("Verse List");
+
+ // Print Form
+ PrintForm->shtSelection->Caption = _tr("Print Selection");
+ PrintForm->radText->Caption = _tr("Bible Text");
+ PrintForm->radComm->Caption = _tr("Commentary Text");
+ PrintForm->radLD->Caption = _tr("Lexicon/Dictionary Text");
+ PrintForm->lblModName->Caption = _tr("Module Name");
+ PrintForm->GroupBox1->Caption = _tr("Print Source");
+ PrintForm->GroupBox2->Caption = _tr("Print Range");
+ PrintForm->staticRange->Caption = _tr("Verse List");
+ PrintForm->shtSetup->Caption = _tr("Page Setup");
+ PrintForm->labelLeft->Caption = _tr("Left:");
+ PrintForm->labelRight->Caption = _tr("Right:");
+ PrintForm->labelTop->Caption = _tr("Top:");
+ PrintForm->labelBot->Caption = _tr("Bottom:");
+ PrintForm->ckHeader->Caption = _tr("Print Header");
+ PrintForm->labelHeader->Caption = _tr("Header Text:");
+ PrintForm->ckFooter->Caption = _tr("Print Footer");
+ PrintForm->labelFooter->Caption = _tr("Footer Text:");
+ PrintForm->editFooter->Text = _tr("Page &p of &t");
+ PrintForm->GroupBox4->Caption = _tr("Margins (Inches)");
+ PrintForm->GroupBox5->Caption = _tr("Header/Footer");
+ PrintForm->shtFormat->Caption = _tr("Formatting Options");
+ PrintForm->GroupBox3->Caption = _tr("Font and Size");
+ PrintForm->Label10->Caption = _tr("Chapter Heading");
+ PrintForm->Label11->Caption = _tr("Body Text:");
+ PrintForm->Label12->Caption = _tr("Verse Numbers:");
+ PrintForm->ckBookHead->Caption = _tr("Book Name");
+ PrintForm->ckChHead->Caption = _tr("Chapter Headings");
+ PrintForm->ckParagraph->Caption = _tr("Paragraph Format");
+ PrintForm->labelFont->Caption = _tr("Font:");
+ PrintForm->ckVSNum->Caption = _tr("Verse Numbers");
+ PrintForm->ckSuperVS->Caption = _tr("Superscripted");
+ PrintForm->ckPrefix->Caption = _tr("Prefixed (John 1:1 KJV)...");
+ PrintForm->ckPostfix->Caption = _tr("Postfixed ...(John 1:1 KJV)");
+ PrintForm->btnPrint->Caption = _tr("&Print");
+ PrintForm->btnPreview->Caption = _tr("P&review...");
+ PrintForm->btnSetup->Caption = _tr("Printer&s...");
+ PrintForm->btnClose->Caption = _tr("&Close");
+
+ // Print Preview Form
+ PreviewForm->btnPrint->Caption = "Print";
+ PreviewForm->btnClose->Caption = "&Close";
+
+}
+
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FormShow(TObject *Sender)
+{
+ ModMap::iterator it;
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit, eitend;
+ AnsiString s1;
+ char textFont[128];
+ char commentFont[128];
+ char LDFont[128];
+ char tempTextFont[128];
+ char tempCommFont[128];
+ char tempLDFont[128];
+ int loop;
+ int maxFiles;
+ TColor fieldColor;
+ string tmpval;
+ bool showDevos;
+ bool showGlos;
+ bool showDevOfDay = false;
+
+/*
+ showLocked = true;
+ for (int i=0;i<=ParamCount();i++) {
+ if (LowerCase(ParamStr(i)) == "-noLocked")
+ showLocked = false;
+ }
+*/
+
+ logmodstate = true;
+ freshdict = true;
+ if (SWLog::systemlog)
+ delete SWLog::systemlog;
+ SWLog::systemlog = new SWWinLog(this->Handle); // set the system logger to our MSWindows specific SWLog class
+ tmpval = ((eit = optionsconf->Sections["System"].find("MaxFiles")) != optionsconf->Sections["System"].end())? (*eit).second : (string)"";
+ if ((maxFiles = atoi(tmpval.c_str()))) {
+ FileMgr::systemFileMgr.maxFiles = maxFiles;
+ }
+
+
+ tmpval = ((eit = optionsconf->Sections["Hints"].find("On")) != optionsconf->Sections["Hints"].end())? (*eit).second : (string)"1";
+
+ if (atoi(tmpval.c_str()))
+ Form1->ShowHint = true;
+ else Form1->ShowHint = false;
+
+ tmpval = ((eit = optionsconf->Sections["General"].find("DevsAsDicts")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"";
+ showDevos = (!stricmp(tmpval.c_str(), "true"));
+
+ tmpval = ((eit = optionsconf->Sections["General"].find("GlosAsDicts")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"";
+ showGlos = !(!stricmp(tmpval.c_str(), "false"));
+
+ tmpval = ((eit = optionsconf->Sections["Appearance"].find("locale")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"en_us";
+ i12ize(tmpval.c_str());
+
+ DefaultVSKey = new VerseKey();
+ DefaultStrKey = new StrKey();
+
+
+// DefaultVSKey->setLocale(tmpval.c_str());
+
+ tmpval = ((eit = optionsconf->Sections["Appearance"].find("TextFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman";
+ strcpy(tempTextFont, tmpval.c_str()); // Temporary holding place for text font
+
+ tmpval = ((eit = optionsconf->Sections["Appearance"].find("CommentFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman";
+ strcpy(tempCommFont, tmpval.c_str());
+
+ tmpval = ((eit = optionsconf->Sections["Appearance"].find("LDFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman";
+ strcpy(tempLDFont, tmpval.c_str());
+
+ fillVKeySelector(DefaultVSKey);
+
+ cbBook->ItemIndex = cbBook->Items->IndexOf("James");
+
+ DefaultVSKey->Persist(1); // when set to a module, make the module hold on to this actual key and not a copy
+ *DefaultVSKey = "James 1:19"; // set to our standard starting verse
+ DefaultStrKey->Persist(1);
+ *DefaultStrKey = "";
+
+ mainmgr = new BibleCSMGR(ModInstFrm);
+
+ // Load devotion and show form
+ String devoKey = TDateTime::CurrentDate().FormatString("mm.dd");
+ tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("DailyDevotion")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) {
+ it->second->SetKey(devoKey.c_str());
+ DevOfTheDay2->RichTip->Text = it->second->StripText();
+ }
+ tmpval = ((eit = optionsconf->Sections["General"].find("TipOfTheDay")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"";
+ if (!stricmp(tmpval.c_str(), "Devotional")) {
+ DevOfTheDay2->ckShowTip->Checked = true;
+ showDevOfDay = true;
+ }
+ // If no devotional text is shown then a general how-to is diplayed.
+ if(DevOfTheDay2->RichTip->Text == "")
+ DevOfTheDay2->RichTip->Text = "A Daily Devotional is not installed or is not configured for use with the \"Devotional of the Day.\n\nTo configure an installed devotional for use with this dialog box open the Preferences dialog box by going to the \"Options\" menu and selecting \"Preferences...\"; then click the \"Special Modules\" tab. Find the \"Default Devotional\" option and select a devotional to use from the list. If nothing shows up in the pull-down list you will need to install a devotional. This can be done by using the Install Manager. Some examples of devotionals are \"Spurgeon's Morning and Evening\" or \"Jonathan Bagster's Daily Light\".\n\nVisit our website at www.crosswire.org for more information.";
+
+
+ for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) {
+ bool devotional = false;
+ bool glossary = false;
+
+ // leave out enciphered texts with no key
+ if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) {
+ if ((eit = (*sit).second.find("CipherKey")) != (*sit).second.end()) {
+ const char *cipherKey = (char *)(*eit).second.c_str();
+ if (strlen(cipherKey) < 1)
+ continue;
+ }
+
+ for (eit = (*sit).second.lower_bound("Feature"), eitend = (*sit).second.upper_bound("Feature"); eit != eitend; eit++) {
+ const char *feature = eit->second.c_str();
+ if (!stricmp(feature, "StrongsNumbers")) {
+ Optionsfrm->strongsNumsCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name());
+ if (optionsconf->Sections["ModDefaults"].find("StrongsNumbers") == optionsconf->Sections["ModDefaults"].end())
+ (*optionsconf)["ModDefaults"]["StrongsNumbers"] = it->second->Name();
+ }
+ if (!stricmp(feature, "GreekDef")) {
+ Optionsfrm->greekDefCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name());
+ if (optionsconf->Sections["ModDefaults"].find("GreekDef") == optionsconf->Sections["ModDefaults"].end())
+ (*optionsconf)["ModDefaults"]["GreekDef"] = it->second->Name();
+ }
+ if (!stricmp(feature, "GreekParse")) {
+ Optionsfrm->greekParseCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name());
+ if (optionsconf->Sections["ModDefaults"].find("GreekParse") == optionsconf->Sections["ModDefaults"].end())
+ (*optionsconf)["ModDefaults"]["GreekParse"] = it->second->Name();
+ }
+ if (!stricmp(feature, "HebrewDef")) {
+ Optionsfrm->hebrewDefCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name());
+ if (optionsconf->Sections["ModDefaults"].find("HebrewDef") == optionsconf->Sections["ModDefaults"].end())
+ (*optionsconf)["ModDefaults"]["HebrewDef"] = it->second->Name();
+ }
+ if (!stricmp(feature, "HebrewParse")) {
+ Optionsfrm->hebrewParseCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name());
+ if (optionsconf->Sections["ModDefaults"].find("HebrewParse") == optionsconf->Sections["ModDefaults"].end())
+ (*optionsconf)["ModDefaults"]["HebrewParse"] = it->second->Name();
+ }
+ if (!stricmp(feature, "DailyDevotion")) {
+ Optionsfrm->dailyDefaultCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name());
+ devotional = true;
+ if (optionsconf->Sections["ModDefaults"].find("DailyDevotion") == optionsconf->Sections["ModDefaults"].end())
+ (*optionsconf)["ModDefaults"]["DailyDevotion"] = it->second->Name();
+ }
+ if (!stricmp(feature, "Glossary")) {
+ glossary = true;
+ }
+ optionsconf->Save();
+ }
+ }
+
+ if (!strcmp((*it).second->Type(), "Biblical Texts")) {
+ strcpy(textFont, tempTextFont);
+ if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) {
+ if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) {
+ strcpy(textFont,(char *)(*eit).second.c_str());
+ }
+ }
+ CreateTextPane((*it).second, textFont);
+ }
+ if (!strcmp((*it).second->Type(), "Commentaries")) {
+ strcpy(commentFont, tempCommFont);
+ if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) {
+ if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) {
+ strcpy(commentFont,(char *)(*eit).second.c_str());
+ }
+ }
+ CreateCommentPane((*it).second, commentFont);
+ }
+ if (!strcmp((*it).second->Type(), "Generic Books")) {
+ strcpy(commentFont, tempCommFont);
+ if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) {
+ if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) {
+ strcpy(commentFont,(char *)(*eit).second.c_str());
+ }
+ }
+ CreateBookPane((*it).second, commentFont);
+ }
+ if (!strcmp((*it).second->Type(), "Lexicons / Dictionaries")) {
+ strcpy(LDFont, tempLDFont);
+ if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) {
+ if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) {
+ strcpy(LDFont,(char *)(*eit).second.c_str());
+ }
+ }
+ if ((!devotional && !glossary) ||
+ (showDevos && devotional) ||
+ (showGlos && glossary))
+ CreateLDPane((*it).second, LDFont);
+ }
+ }
+
+ layoutconf = new SWConfig("./layout.conf");
+
+ if ((sit = layoutconf->Sections.find("Screen")) != layoutconf->Sections.end()) {
+
+ if ((eit = (*sit).second.find("MainTop")) != (*sit).second.end())
+ Form1->Top = atoi((*eit).second.c_str());
+ if ((eit = (*sit).second.find("MainLeft")) != (*sit).second.end())
+ Form1->Left = atoi((*eit).second.c_str());
+ if ((eit = (*sit).second.find("MainHeight")) != (*sit).second.end())
+ Form1->Height = atoi((*eit).second.c_str());
+ if ((eit = (*sit).second.find("MainWidth")) != (*sit).second.end())
+ Form1->Width = atoi((*eit).second.c_str());
+
+ Form1->WindowState = (sit->second["Maximized"] == "true") ? wsMaximized : wsNormal;
+
+ if ((eit = (*sit).second.find("TextComHeight")) != (*sit).second.end())
+ pnlTextCom->Height = atoi((*eit).second.c_str());
+ if ((eit = (*sit).second.find("TextWidth")) != (*sit).second.end())
+ pnlText->Width = atoi((*eit).second.c_str());
+ if ((eit = (*sit).second.find("SearchTop")) != (*sit).second.end()){
+ searchForm->Top = atoi((*eit).second.c_str());
+ searchForm->Position = poDesigned;
+ }
+
+ if ((eit = (*sit).second.find("SearchLeft")) != (*sit).second.end())
+ searchForm->Left = atoi((*eit).second.c_str());
+ if ((eit = (*sit).second.find("SearchHeight")) != (*sit).second.end())
+ searchForm->Height = atoi((*eit).second.c_str());
+ if ((eit = (*sit).second.find("SearchWidth")) != (*sit).second.end())
+ searchForm->Width = atoi((*eit).second.c_str());
+
+ searchForm->WindowState = (sit->second["SearchMaximized"] == "true") ? wsMaximized : wsNormal;
+ }
+
+
+ for (loop = 0; loop < 10; loop++)
+ ctrlstates.insert(ctrlstates.begin(), 0);
+
+
+
+ // Add options to Options Main Menu choice
+ sit = layoutconf->Sections.find("ModuleOptions");
+ OptionsList options = mainmgr->getGlobalOptions();
+ for (OptionsList::iterator it = options.begin(); it != options.end(); it++) {
+ TMenuItem *newitem = new TMenuItem(MainMenu1);
+ newitem->Caption = it->c_str();
+ newitem->Default = false;
+ newitem->OnClick = OptionShowVals;
+ newitem->Hint = mainmgr->getGlobalOptionTip(it->c_str());
+ if (sit != layoutconf->Sections.end()) {
+ if ((eit = sit->second.find(it->c_str())) != sit->second.end())
+ mainmgr->setGlobalOption(it->c_str(), eit->second.c_str());
+ }
+ OptionsList values = mainmgr->getGlobalOptionValues(it->c_str());
+ for (OptionsList::iterator it2 = values.begin(); it2 != values.end(); it2++) {
+ TMenuItem *newitem2 = new TMenuItem(MainMenu1);
+ newitem2->Caption = it2->c_str();
+ newitem2->Default = false;
+ newitem2->OnClick = GlobalOptionChange;
+ newitem->Add(newitem2);
+ }
+// Mainmenu->Items->Add(newitem);
+ Options2->Add(newitem);
+ }
+
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()){
+ if ((eit = (*sit).second.find("FieldColor")) != (*sit).second.end())
+ fieldColor = TColor(atoi((*eit).second.c_str()));
+ else fieldColor = clAqua;
+ }
+
+ cbBook->Color = fieldColor;
+ CHBox->Color = fieldColor;
+ VSBox->Color = fieldColor;
+ freeHandLookup->Color = fieldColor;
+ DictKeyEdit->Color = fieldColor;
+
+ if ((sit = layoutconf->Sections.find("History")) != layoutconf->Sections.end()) {
+
+ eitend = (*sit).second.upper_bound("SearchText");
+ for (eit = (*sit).second.lower_bound("SearchText"); eit != eitend; eit++)
+ searchForm->SearchText->Items->Add(UTF8ToWideString(eit->second.c_str()));
+
+ eitend = (*sit).second.upper_bound("LookupText");
+ for (eit = (*sit).second.lower_bound("LookupText"); eit != eitend; eit++)
+ freeHandLookup->Items->Add(eit->second.c_str());
+
+ if ((eit = (*sit).second.find("LastTextModule")) != (*sit).second.end()) {
+ for (int i = 0; i < TextPageControl->PageCount; i++) {
+ if (!strcmp(TextPageControl->Pages[i]->Caption.c_str(), (*eit).second.c_str())) {
+ TextPageControl->ActivePageIndex = i;
+ break;
+ }
+ }
+ }
+ if ((eit = (*sit).second.find("LastComModule")) != (*sit).second.end()) {
+ for (int i = 0; i < CommentaryPageControl->PageCount; i++) {
+ if (!strcmp(CommentaryPageControl->Pages[i]->Caption.c_str(), (*eit).second.c_str())) {
+ CommentaryPageControl->ActivePageIndex = i;
+ break;
+ }
+ }
+ }
+ if (this->Tag) {
+ NavigateVerseURL((char*)(this->Tag));
+ }
+ else if ((eit = (*sit).second.find("LastVerse")) != (*sit).second.end()) {
+ freeHandLookup->Text = (*eit).second.c_str();
+ char ret = '\r';
+ freeHandLookupoldKeyPress(0, ret);
+ }
+ }
+
+ ConfigEntMap *section;
+ TPageControl *pc = 0;
+ for (int pcs = 0; pcs < 3; pcs++) {
+ switch (pcs) {
+ case 0:
+ pc = TextPageControl;
+ section = &(*layoutconf)["TextView"];
+ break;
+ case 1:
+ pc = CommentaryPageControl;
+ section = &(*layoutconf)["CommentView"];
+ break;
+ case 2:
+ pc = LexDictPageControl;
+ section = &(*layoutconf)["LDView"];
+ break;
+ }
+
+ for (int i = 0; i < pc->PageCount; i++) {
+ string heading = pc->Pages[i]->Caption.c_str();
+ pc->Pages[i]->TabVisible = !((*section)[heading.c_str()] == "false"); // !false allows default to be true
+ }
+ }
+
+ SplashPg->Hide();
+ if(showDevOfDay){
+ DevOfTheDay2->Show();
+ }
+ RefreshActiveSheet(LexDictPageControl);
+ RefreshActiveSheet(CommentaryPageControl);
+ RefreshActiveSheet(TextPageControl);
+}
+
+bool TForm1::hasFeature(SWMgr *mgr, const char *modName, const char *feature) {
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit, eitend;
+
+ if ((sit = mgr->config->Sections.find(modName)) != mgr->config->Sections.end()) {
+ for (eit = (*sit).second.lower_bound("Feature"), eitend = (*sit).second.upper_bound("Feature"); eit != eitend; eit++) {
+ const char *tfeature = eit->second.c_str();
+ if (!stricmp(tfeature, feature))
+ return true;
+ }
+ }
+ return false;
+}
+
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::LookupPokeData(TObject *Sender)
+{
+ char buf[255];
+ char *token;
+ ModMap::iterator it;
+
+ strncpy(buf, Lookup->Text.c_str(), 254);
+ buf[254] = 0;
+ token = strtok(buf, " ");
+ if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) {
+ token = strtok(NULL, "");
+ (*it).second->SetKey(token);
+ Lookup->Text = (const char *)(*(*it).second);
+ }
+ else Lookup->Text = "";
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::SearchPokeData(TObject *Sender)
+{
+ char buf[255];
+ char *token;
+ ModMap::iterator it;
+ AnsiString retval = "";
+
+ strncpy(buf, Search->Text.c_str(), 254);
+ buf[254] = 0;
+ token = strtok(buf, " ");
+ if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) {
+ token = strtok(NULL, "");
+ ListKey &results = (*it).second->Search(token, REG_ICASE);
+ while (!results.Error()) {
+ retval = retval + (const char *)results + "; ";
+ results++;
+ }
+ Search->Text = retval;
+ }
+ else Search->Text = "";
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::UpDown3Click(TObject *Sender, TUDBtnType Button)
+{
+ ModMap::iterator it;
+
+ it = mainmgr->Modules.find(LexDictPageControl->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ if (Button == btNext)
+ (*((*it).second))++;
+ else (*((*it).second))--;
+ DictKeyEdit->Text = UTF8ToWideString(((*it).second)->KeyText());
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::UpDown1Click(TObject *Sender, TUDBtnType Button)
+{
+ if (Sender == UpDown1)
+ UpDown2->Position = 1;
+ btnLookupClick(Sender);
+}
+//---------------------------------------------------------------------------
+
+void TForm1::RestoreState(ModState *state)
+{
+ ModMap::iterator it;
+
+ if (state) {
+ state->pc->ActivePage = (TTabSheet *)state->ap;
+ if ((state->pc == TextPageControl) || (state->pc == CommentaryPageControl)) {
+ if (mainmgr) {
+ it = mainmgr->Modules.find(state->pc->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ SWModule *module = it->second;
+ if (!strcmp(module->Type(0), "Generic Books")) {
+ module->SetKey(state->key);
+ }
+ else {
+ *DefaultVSKey = state->key;
+ TextKeyChanged();
+ }
+ }
+ }
+ }
+ if (state->pc == LexDictPageControl) {
+ DictKeyEdit->Text = UTF8ToWideString((const char *)state->key);
+ }
+ if (state->pc->ActivePage->ControlCount){
+ Form1->SetFocusedControl( (TWinControl *)state->pc->ActivePage->Controls[0] );
+ }
+ }
+}
+
+
+void __fastcall TForm1::BackbtnClick(TObject *Sender)
+{
+ list <ModState *>::iterator it;
+ logmodstate = false;
+ it = modstates.begin();
+ if (it != modstates.end()) {
+ it++;
+
+ if (it != modstates.end()) {
+ RestoreState(*it);
+ delete *modstates.begin();
+ modstates.erase(modstates.begin(), it);
+ }
+ }
+ logmodstate = true;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Button1Click(TObject *Sender)
+{
+/*
+ list <ModState *>::iterator it;
+ ListBox1->Clear();
+ for (it = modstates.begin(); it != modstates.end(); it++) {
+ ListBox1->Items->Add((*it)->ap->Caption.c_str());
+ }
+*/
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::CopyasBGreekTransliteration1Click(TObject *Sender)
+{
+ char *retbuf;
+ int len;
+ TClipboard *clip = new TClipboard();
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ len = rtf->SelText.Length() * 2;
+ retbuf = new char [ len ];
+ if (!Greek2bGreek(retbuf, rtf->SelText.c_str(), len)) {
+ clip->SetTextBuf(retbuf);
+ }
+ delete clip;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Copy1Click(TObject *Sender)
+{
+ int wordstart;
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ if (!rtf->SelLength) {
+ for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--);
+ rtf->SelStart = (wordstart > -1) ? wordstart: 0;
+ for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++);
+ rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length()) - rtf->SelStart - 1;
+ }
+ rtf->CopyToClipboard();
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::BookmarkItemClick(TObject *Sender)
+{
+ TMenuItem *menuchoice = (TMenuItem *)Sender;
+ const char *source = menuchoice->Caption.c_str();
+ char *value = new char [strlen(source) + 1];
+ int k = 0;
+ for (unsigned int j = 0; j < strlen(source); j++) {
+ if (source[j] != '&')
+ value[k++] = source[j];
+ }
+ value[k] = 0;
+ *DefaultVSKey = value;
+ delete [] value;
+ TextKeyChanged();
+}
+
+void __fastcall TForm1::AddBookmark1Click(TObject *Sender)
+{
+// TMenuItem *newitem;
+
+ bookmarkForm->bmtree->Items->AddChild(bookmarkForm->bmtree->Items->Item[0], (const char *)*DefaultVSKey);
+}
+
+void TForm1::AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree)
+{
+ TMenuItem *newitem;
+
+ for (tree = tree->getFirstChild(); tree; tree = tree->getNextSibling()) {
+ newitem = new TMenuItem(menu);
+ newitem->Caption = tree->Text;
+ if (!tree->getFirstChild())
+ newitem->OnClick = BookmarkItemClick;
+ item->Add(newitem);
+ AddSectionToMenu(menu, newitem, tree);
+ }
+}
+
+void TForm1::RefreshBookmarksMenu(TMenu *menu, TTreeView *treeview)
+{
+ TMenuItem *newitem;
+ TTreeNode *tree = 0;
+
+ if (treeview->Items->Count)
+ tree = treeview->Items->Item[0];
+
+ while (menu->Items->Count > 3)
+ menu->Items->Delete(3);
+
+ for (;tree;tree = tree->getNextSibling()) {
+ newitem = new TMenuItem(menu);
+ newitem->Caption = tree->Text;
+ menu->Items->Add(newitem);
+ AddSectionToMenu(menu, newitem, tree);
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::BookmarkbtnClick(TObject *Sender)
+{
+ TPoint menup, point;
+ point.x = 0;
+ point.y = Bookmarkbtn->Height;
+ menup = Bookmarkbtn->ClientToScreen(point);
+ RefreshBookmarksMenu(BookmarkPopup, bookmarkForm->bmtree);
+ BookmarkPopup->Popup(menup.x, menup.y);
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::EditBookmarks1Click(TObject *Sender)
+{
+ bookmarkForm->Show();
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key,
+ TShiftState Shift)
+{
+ char buf[5];
+ int val;
+ ModMap::iterator it;
+ TPageControl *pc = TextPageControl;
+
+ if ((Shift.Contains(ssCtrl)) && (!Shift.Contains(ssAlt))) {
+ if ((Key >= '0') && (Key <= '9')) {
+ sprintf(buf, "%c", Key);
+ val = atoi(buf);
+
+ if (!Shift.Contains(ssShift)) {
+ if ((Screen->ActiveControl == CommentaryPageControl) || (IsChild(CommentaryPageControl->Handle, Screen->ActiveControl->Handle)))
+ pc = CommentaryPageControl;
+ if ((Screen->ActiveControl == LexDictPageControl) || (IsChild(LexDictPageControl->Handle, Screen->ActiveControl->Handle)))
+ pc = LexDictPageControl;
+
+ it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ if (ctrlstates[val])
+ delete ctrlstates[val];
+
+ ctrlstates[val] = new ModState(pc, pc->ActivePage, (*it).second->KeyText());
+ }
+ }
+ else RestoreState(ctrlstates[val]);
+ }
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Options1Click(TObject *Sender)
+{
+ ModMap::iterator it;
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit;
+ ConfigEntMap emap;
+ int color;
+ string tmpval;
+
+ //*********************************
+ //Initialize Preferences Dialog Box
+
+ Optionsfrm->LoadDispSettings(optionsconf);
+ /*
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) {
+ if ((*sit).second.find("AutoVSColor") != (*sit).second.end())
+ Optionsfrm->AutoVSColor->Checked = (((atoi((*(*sit).second.find("AutoVSColor")).second.c_str()))) ? true:false);
+ else Optionsfrm->AutoVSColor->Checked = true;
+
+ if ((*sit).second.find("TextBackColor") != (*sit).second.end())
+ Optionsfrm->FontDialogText->BackColor = TColor(atoi((*(*sit).second.find("TextBackColor")).second.c_str()));
+ else Optionsfrm->FontDialogText->BackColor = TColor(clWhite);
+
+ if ((*sit).second.find("CommentBackColor") != (*sit).second.end())
+ Optionsfrm->FontDialogComment->BackColor = TColor(atoi((*(*sit).second.find("CommentBackColor")).second.c_str()));
+ else Optionsfrm->FontDialogComment->BackColor = TColor(clWhite);
+
+ if ((*sit).second.find("LDBackColor") != (*sit).second.end())
+ Optionsfrm->FontDialogLD->BackColor = TColor(atoi((*(*sit).second.find("LDBackColor")).second.c_str()));
+ else Optionsfrm->FontDialogLD->BackColor = TColor(clWhite);
+
+ if ((*sit).second.find("PopupBackColor") != (*sit).second.end())
+ Optionsfrm->FontDialogPopup->BackColor = TColor(atoi((*(*sit).second.find("PopupBackColor")).second.c_str()));
+ else Optionsfrm->FontDialogPopup->BackColor = TColor(clInfoText);
+
+ if ((*sit).second.find("TextFontName") != (*sit).second.end())
+ Optionsfrm->FontDialogText->Font->Name = ((*(*sit).second.find("TextFontName")).second.c_str());
+ else Optionsfrm->FontDialogText->Font->Name = "Times New Roman";
+
+ if ((*sit).second.find("CommentFontName") != (*sit).second.end())
+ Optionsfrm->FontDialogComment->Font->Name = ((*(*sit).second.find("CommentFontName")).second.c_str());
+ else Optionsfrm->FontDialogComment->Font->Name = "Times New Roman";
+
+ if ((*sit).second.find("LDFontName") != (*sit).second.end())
+ Optionsfrm->FontDialogLD->Font->Name = ((*(*sit).second.find("LDFontName")).second.c_str());
+ else Optionsfrm->FontDialogLD->Font->Name = "Times New Roman";
+
+ if ((*sit).second.find("PopupFontName") != (*sit).second.end())
+ Optionsfrm->FontDialogPopup->Font->Name = ((*(*sit).second.find("PopupFontName")).second.c_str());
+ else Optionsfrm->FontDialogPopup->Font->Name = "MS Sans Serif";
+
+ if ((*sit).second.find("TextFontSize") != (*sit).second.end())
+ Optionsfrm->FontDialogText->Font->Size = (atoi ((*(*sit).second.find("TextFontSize")).second.c_str()));
+ else Optionsfrm->FontDialogText->Font->Size = 10;
+
+ if ((*sit).second.find("CommentFontSize") != (*sit).second.end())
+ Optionsfrm->FontDialogComment->Font->Size = (atoi ((*(*sit).second.find("CommentFontSize")).second.c_str()));
+ else Optionsfrm->FontDialogComment->Font->Size = 10;
+
+ if ((*sit).second.find("LDFontSize") != (*sit).second.end())
+ Optionsfrm->FontDialogLD->Font->Size = (atoi ((*(*sit).second.find("LDFontSize")).second.c_str()));
+ else Optionsfrm->FontDialogLD->Font->Size = 10;
+
+ if ((*sit).second.find("PopupFontSize") != (*sit).second.end())
+ Optionsfrm->FontDialogPopup->Font->Size = (atoi ((*(*sit).second.find("PopupFontSize")).second.c_str()));
+ else Optionsfrm->FontDialogPopup->Font->Size = 10;
+
+ if ((*sit).second.find("TextFontColor") != (*sit).second.end())
+ Optionsfrm->FontDialogText->Font->Color = TColor(atoi ((*(*sit).second.find("TextFontColor")).second.c_str()));
+ else Optionsfrm->FontDialogText->Font->Color = clBlack;
+
+ if ((*sit).second.find("CommentFontColor") != (*sit).second.end())
+ Optionsfrm->FontDialogComment->Font->Color = TColor(atoi ((*(*sit).second.find("CommentFontColor")).second.c_str()));
+ else Optionsfrm->FontDialogComment->Font->Color = clBlack;
+
+ if ((*sit).second.find("LDFontColor") != (*sit).second.end())
+ Optionsfrm->FontDialogLD->Font->Color = TColor(atoi ((*(*sit).second.find("LDFontColor")).second.c_str()));
+ else Optionsfrm->FontDialogLD->Font->Color = clBlack;
+
+ if ((*sit).second.find("PopupFontColor") != (*sit).second.end())
+ Optionsfrm->FontDialogPopup->Font->Color = TColor(atoi ((*(*sit).second.find("PopupFontColor")).second.c_str()));
+ else Optionsfrm->FontDialogPopup->Font->Color = clBlack;
+ }
+ */
+ if ((sit = optionsconf->Sections.find("Bookmarks")) != optionsconf->Sections.end()) {
+ Optionsfrm->AutoBMPersonal->Checked = ((atoi(sit->second["AutoSavePersonal"].c_str()))?true:false);
+ Optionsfrm->AutoBMOther->Checked = ((atoi(sit->second["AutoSaveOther"].c_str()))?true:false);
+ }
+ if ((sit = optionsconf->Sections.find("Layout")) != optionsconf->Sections.end()) {
+ Optionsfrm->AutoLayout->Checked = ((atoi(sit->second["AutoSaveLayout"].c_str()))?true:false);
+
+ }
+
+ Optionsfrm->HintStrongs->Checked = true;
+ tmpval = ((eit = optionsconf->Sections["HintStrongs"].find("On")) != optionsconf->Sections["HintStrongs"].end())? (*eit).second : (string)"1";
+ if (!atoi(tmpval.c_str()))
+ Optionsfrm->HintStrongs->Checked = false;
+
+ Optionsfrm->HintPopups->Checked = true;
+ tmpval = ((eit = optionsconf->Sections["Hints"].find("On")) != optionsconf->Sections["Hints"].end())? (*eit).second : (string)"1";
+ if (!atoi(tmpval.c_str()))
+ Optionsfrm->HintPopups->Checked = false;
+
+ Optionsfrm->devsAsDictsCB->Checked = false;
+ tmpval = ((eit = optionsconf->Sections["General"].find("DevsAsDicts")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"false";
+ if (!stricmp(tmpval.c_str(), "true"))
+ Optionsfrm->devsAsDictsCB->Checked = true;
+
+ Optionsfrm->glosAsDictsCB->Checked = true;
+ tmpval = ((eit = optionsconf->Sections["General"].find("GlosAsDicts")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"true";
+ if (stricmp(tmpval.c_str(), "false"))
+ Optionsfrm->glosAsDictsCB->Checked = true;
+
+ Optionsfrm->devSplashCB->Checked = false;
+ tmpval = ((eit = optionsconf->Sections["General"].find("TipOfTheDay")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"";
+ if (!stricmp(tmpval.c_str(), "Devotional"))
+ Optionsfrm->devSplashCB->Checked = true;
+
+ const char *localeName = LocaleMgr::systemLocaleMgr.getDefaultLocaleName();
+ SWLocale *defLocale = LocaleMgr::systemLocaleMgr.getLocale(localeName);
+ Optionsfrm->localeCB->ItemIndex = Optionsfrm->localeCB->Items->IndexOf((defLocale)?defLocale->getDescription():"English (US)");
+
+ tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("GreekDef")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) {
+ Optionsfrm->greekDefCB->ItemIndex = Optionsfrm->greekDefCB->Items->IndexOf(it->second->Description());
+ }
+
+ tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("GreekParse")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) {
+ Optionsfrm->greekParseCB->ItemIndex = Optionsfrm->greekParseCB->Items->IndexOf(it->second->Description());
+ }
+
+ tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("HebrewDef")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) {
+ Optionsfrm->hebrewDefCB->ItemIndex = Optionsfrm->hebrewDefCB->Items->IndexOf(it->second->Description());
+ }
+
+ tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("HebrewParse")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) {
+ Optionsfrm->hebrewParseCB->ItemIndex = Optionsfrm->hebrewParseCB->Items->IndexOf(it->second->Description());
+ }
+
+ tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("DailyDevotion")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) {
+ Optionsfrm->dailyDefaultCB->ItemIndex = Optionsfrm->dailyDefaultCB->Items->IndexOf(it->second->Description());
+ }
+
+ tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("StrongsNumbers")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) {
+ Optionsfrm->strongsNumsCB->ItemIndex = Optionsfrm->strongsNumsCB->Items->IndexOf(it->second->Description());
+ }
+ //*********************************
+ // Show Dialog Box
+ if (Optionsfrm->ShowModal() == mrOk) {
+ // Save Preferences settings :)
+ emap = optionsconf->Sections["Appearance"];
+ emap.erase("AutoVSColor"); emap.insert(ConfigEntMap::value_type("AutoVSColor", IntToStr((Optionsfrm->AutoVSColor->Checked)?1:0).c_str()));
+ emap.erase("CurrentVSColor"); emap.insert(ConfigEntMap::value_type("CurrentVSColor", IntToStr(Optionsfrm->ColorDialogVS->Color).c_str()));
+ emap.erase("StrongsColor"); emap.insert(ConfigEntMap::value_type("StrongsColor", IntToStr(Optionsfrm->ColorDialogStrongs->Color).c_str()));
+ emap.erase("MorphColor"); emap.insert(ConfigEntMap::value_type("MorphColor", IntToStr(Optionsfrm->ColorDialogMorph->Color).c_str()));
+ emap.erase("VSNumberColor"); emap.insert(ConfigEntMap::value_type("VSNumberColor", IntToStr(Optionsfrm->ColorDialogVerseNum->Color).c_str()));
+ emap.erase("FieldColor"); emap.insert(ConfigEntMap::value_type("FieldColor", IntToStr(Optionsfrm->ColorDialogField->Color).c_str()));
+
+ emap.erase("TextBackColor"); emap.insert(ConfigEntMap::value_type("TextBackColor", IntToStr(Optionsfrm->FontDialogText->BackColor).c_str()));
+ emap.erase("CommentBackColor"); emap.insert(ConfigEntMap::value_type("CommentBackColor", IntToStr(Optionsfrm->FontDialogComment->BackColor).c_str()));
+ emap.erase("LDBackColor"); emap.insert(ConfigEntMap::value_type("LDBackColor", IntToStr(Optionsfrm->FontDialogLD->BackColor).c_str()));
+ emap.erase("PopupBackColor"); emap.insert(ConfigEntMap::value_type("PopupBackColor", IntToStr(Optionsfrm->FontDialogPopup->BackColor).c_str()));
+
+ emap.erase("TextFontName"); emap.insert(ConfigEntMap::value_type("TextFontName", (Optionsfrm->FontDialogText->Font->Name).c_str()));
+ emap.erase("CommentFontName"); emap.insert(ConfigEntMap::value_type("CommentFontName", (Optionsfrm->FontDialogComment->Font->Name).c_str()));
+ emap.erase("LDFontName"); emap.insert(ConfigEntMap::value_type("LDFontName", (Optionsfrm->FontDialogLD->Font->Name).c_str()));
+ emap.erase("PopupFontName"); emap.insert(ConfigEntMap::value_type("PopupFontName", (Optionsfrm->FontDialogPopup->Font->Name).c_str()));
+
+ emap.erase("TextFontSize"); emap.insert(ConfigEntMap::value_type("TextFontSize", IntToStr(Optionsfrm->FontDialogText->Font->Size).c_str()));
+ emap.erase("CommentFontSize"); emap.insert(ConfigEntMap::value_type("CommentFontSize", IntToStr(Optionsfrm->FontDialogComment->Font->Size).c_str()));
+ emap.erase("LDFontSize"); emap.insert(ConfigEntMap::value_type("LDFontSize", IntToStr(Optionsfrm->FontDialogLD->Font->Size).c_str()));
+ emap.erase("PopupFontSize"); emap.insert(ConfigEntMap::value_type("PopupFontSize", IntToStr(Optionsfrm->FontDialogPopup->Font->Size).c_str()));
+
+ emap.erase("TextFontColor"); emap.insert(ConfigEntMap::value_type("TextFontColor", IntToStr(Optionsfrm->FontDialogText->Font->Color).c_str()));
+ emap.erase("CommentFontColor"); emap.insert(ConfigEntMap::value_type("CommentFontColor", IntToStr(Optionsfrm->FontDialogComment->Font->Color).c_str()));
+ emap.erase("LDFontColor"); emap.insert(ConfigEntMap::value_type("LDFontColor", IntToStr(Optionsfrm->FontDialogLD->Font->Color).c_str()));
+ emap.erase("PopupFontColor"); emap.insert(ConfigEntMap::value_type("PopupFontColor", IntToStr(Optionsfrm->FontDialogPopup->Font->Color).c_str()));
+
+ emap.erase("locale"); emap.insert(ConfigEntMap::value_type("locale", (const char *)Optionsfrm->localeCB->Items->Objects[Optionsfrm->localeCB->ItemIndex]));
+ optionsconf->Sections["Appearance"] = emap;
+
+ emap = optionsconf->Sections["ModDefaults"];
+
+ if (Optionsfrm->greekDefCB->ItemIndex > -1) {
+ emap.erase("GreekDef"); emap.insert(ConfigEntMap::value_type("GreekDef", (const char *)Optionsfrm->greekDefCB->Items->Objects[Optionsfrm->greekDefCB->ItemIndex]));
+ }
+ if (Optionsfrm->greekParseCB->ItemIndex > -1) {
+ emap.erase("GreekParse"); emap.insert(ConfigEntMap::value_type("GreekParse", (const char *)Optionsfrm->greekParseCB->Items->Objects[Optionsfrm->greekParseCB->ItemIndex]));
+ }
+ if (Optionsfrm->hebrewDefCB->ItemIndex > -1) {
+ emap.erase("HebrewDef"); emap.insert(ConfigEntMap::value_type("HebrewDef", (const char *)Optionsfrm->hebrewDefCB->Items->Objects[Optionsfrm->hebrewDefCB->ItemIndex]));
+ }
+ if (Optionsfrm->hebrewParseCB->ItemIndex > -1) {
+ emap.erase("HebrewParse"); emap.insert(ConfigEntMap::value_type("HebrewParse", (const char *)Optionsfrm->hebrewParseCB->Items->Objects[Optionsfrm->hebrewParseCB->ItemIndex]));
+ }
+ if (Optionsfrm->dailyDefaultCB->ItemIndex > -1) {
+ emap.erase("DailyDevotion"); emap.insert(ConfigEntMap::value_type("DailyDevotion", (const char *)Optionsfrm->dailyDefaultCB->Items->Objects[Optionsfrm->dailyDefaultCB->ItemIndex]));
+ }
+ if (Optionsfrm->strongsNumsCB->ItemIndex > -1) {
+ emap.erase("StrongsNumbers"); emap.insert(ConfigEntMap::value_type("StrongsNumbers", (const char *)Optionsfrm->strongsNumsCB->Items->Objects[Optionsfrm->strongsNumsCB->ItemIndex]));
+ }
+ optionsconf->Sections["ModDefaults"] = emap;
+
+
+ emap = optionsconf->Sections["Bookmarks"];
+ emap.erase("AutoSavePersonal"); emap.insert(ConfigEntMap::value_type("AutoSavePersonal", IntToStr((Optionsfrm->AutoBMPersonal->Checked)?1:0).c_str()));
+ emap.erase("AutoSaveOther"); emap.insert(ConfigEntMap::value_type("AutoSaveOther", IntToStr((Optionsfrm->AutoBMOther->Checked)?1:0).c_str()));
+ optionsconf->Sections["Bookmarks"] = emap;
+
+ emap = optionsconf->Sections["Layout"];
+ emap.erase("AutoSaveLayout"); emap.insert(ConfigEntMap::value_type("AutoSaveLayout", IntToStr((Optionsfrm->AutoLayout->Checked)?1:0).c_str()));
+ optionsconf->Sections["Layout"] = emap;
+
+ emap = optionsconf->Sections["Hints"];
+ emap.erase("On"); emap.insert(ConfigEntMap::value_type("On", IntToStr((Optionsfrm->HintPopups->Checked)?1:0).c_str()));
+ optionsconf->Sections["Hints"] = emap;
+
+ emap = optionsconf->Sections["HintStrongs"];
+ emap.erase("On"); emap.insert(ConfigEntMap::value_type("On", IntToStr((Optionsfrm->HintStrongs->Checked)?1:0).c_str()));
+ optionsconf->Sections["HintStrongs"] = emap;
+
+ emap = optionsconf->Sections["General"];
+ emap.erase("TipOfTheDay"); emap.insert(ConfigEntMap::value_type("TipOfTheDay", (Optionsfrm->devSplashCB->Checked)?"Devotional":""));
+ emap.erase("DevsAsDicts"); emap.insert(ConfigEntMap::value_type("DevsAsDicts", (Optionsfrm->devsAsDictsCB->Checked)?"true":"false"));
+ emap.erase("GlosAsDicts"); emap.insert(ConfigEntMap::value_type("GlosAsDicts", (Optionsfrm->glosAsDictsCB->Checked)?"true":"false"));
+ optionsconf->Sections["General"] = emap;
+
+ optionsconf->Save();
+ RefRTFHeaders();
+ }
+
+ tmpval = ((eit = optionsconf->Sections["Hints"].find("On")) != optionsconf->Sections["Hints"].end())? (*eit).second : (string)"1";
+
+ if (atoi(tmpval.c_str()))
+ Form1->ShowHint = true;
+ else Form1->ShowHint = false;
+
+ tmpval = ((eit = optionsconf->Sections["Appearance"].find("locale")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"en_us";
+ i12ize(tmpval.c_str());
+ DefaultVSKey->setLocale(tmpval.c_str());
+ fillVKeySelector(DefaultVSKey);
+ TextKeyChanged();
+ RefreshActiveSheet(LexDictPageControl);
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::cbBookChange(TObject *Sender)
+{
+ CHBox->Text = "1";
+ VSBox->Text = "1";
+ if (Screen->ActiveControl == cbBook)
+ btnLookupClick(Sender);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FormCreate(TObject *Sender)
+{
+// Application->OnHint = DisplayHint;
+// Application->ShowHint = true;
+// this->ShowHint = true;
+// nsresult rv;
+// rv = NS_InitEmbedding(nsnull, nsnull);
+
+ Application->OnMessage = AppMessage;
+ Application->Title = "The SWORD Project for Windows";
+}
+
+
+void TForm1::AddVerseChoices(TPopupMenu *menu, const char *buf, TRxRichEdit *rtf) {
+ TMenuItem *newitem;
+
+ tmpVerseList = DefaultVSKey->ParseVerseList((char *)buf, *DefaultVSKey);
+
+ ModMap::iterator target;
+ target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ char *keytext = 0; // check for and remove return at end of keytext
+ stdstr(&keytext, (*(*target).second).KeyText());
+ if (keytext[strlen(keytext)-1] == '\r')
+ keytext[strlen(keytext)-1] = 0;
+
+ tmpVerseListCaption = String("VerseList from- ") + (*target).first.c_str() + ": " + keytext;
+ delete [] keytext; // ---------------------------------
+ }
+ newitem = new TMenuItem(menu);
+ newitem->Caption = "-";
+ menu->Items->Add(newitem);
+ newitem = new TMenuItem(menu);
+ newitem->Caption = _tr("Create Verse List");
+ newitem->Hint = _tr("Create a New Verse List Window");
+ newitem->Default = true;
+ newitem->OnClick = createVerseList;
+ menu->Items->Add(newitem);
+ int breakcnt = 3;
+ while (!tmpVerseList.Error()) {
+ breakcnt++;
+ newitem = new TMenuItem(menu);
+ newitem->Caption = (const char *)tmpVerseList;
+ newitem->OnClick = BookmarkItemClick;
+ if (!(breakcnt%15))
+ newitem->Break = mbBreak;
+ menu->Items->Add(newitem);
+ tmpVerseList++;
+ }
+
+
+
+}
+
+
+void __fastcall TForm1::PopupMenuPopup(TObject *Sender) {
+
+ int versestart, verseend;
+ TPopupMenu *menu = (TPopupMenu *)Sender;
+ int staticMenuItemsCount = 0;
+ TMenuItem *newitem;
+
+ if (menu == PopupMenu1)
+ staticMenuItemsCount = 4;
+ else if (menu == PopupMenu2)
+ staticMenuItemsCount = 3;
+ else if (menu == PopupMenu3)
+ staticMenuItemsCount = 7;
+
+ while (menu->Items->Count > staticMenuItemsCount)
+ menu->Items->Delete(staticMenuItemsCount);
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ if (clickText.Length()) {
+ string highlight = Trim(clickText).c_str();
+ tmpVerseList = DefaultVSKey->ParseVerseList((char *)highlight.c_str(), *DefaultVSKey);
+ if (tmpVerseList.Count())
+ AddVerseChoices(menu, highlight.c_str(), rtf);
+ }
+ else if (!rtf->SelLength) {
+ int entrylen = strlen(rtf->Text.c_str());
+ char *entrytext = new char [ entrylen + 1 ];
+ int selstart = rtf->SelStart;
+ strcpy(entrytext, rtf->Text.c_str());
+// for (versestart = rtf->SelStart; ((versestart)&&(rtf->Text[versestart] != '#')); versestart--);
+ for (versestart = selstart; ((versestart)&&(entrytext[versestart] != '#')); versestart--);
+ if (versestart) {
+ for (verseend = versestart; ((verseend < entrylen) && (entrytext[verseend] != '|')); verseend++);
+ if ((verseend < entrylen) && (verseend > selstart)) {
+ int len = (verseend - versestart) + 1;
+ char *buf = new char [ len + 1 ];
+ memset(buf, 0 , len + 1);
+ strncpy(buf, &entrytext[versestart+1], len - 2); // strip the # and | from the string
+ int buflen = strlen(buf);
+ for (int i = 0; i < buflen; i++) {
+ if ((buf[i] == 10) || (buf[i] == 13))
+ buf[i] = ' ';
+ }
+ AddVerseChoices(menu, buf, rtf);
+ delete [] buf;
+ }
+ }
+ delete [] entrytext;
+ }
+ else {
+ string highlight = Trim(rtf->SelText).c_str();
+ tmpVerseList = DefaultVSKey->ParseVerseList((char *)highlight.c_str(), *DefaultVSKey);
+ if (tmpVerseList.Count())
+ AddVerseChoices(menu, highlight.c_str(), rtf);
+
+// newitem = new TMenuItem(menu);
+// newitem->Caption = "Verse Lookup";
+// newitem->Hint = "Attempt to lookup highlighted text as a verse";
+// newitem->OnClick = verseLookupClick;
+// menu->Items->Add(newitem);
+ }
+ clickText = "";
+
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::createVerseList(TObject *Sender)
+{
+ TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList);
+ tmpForm->Caption = tmpVerseListCaption;
+ tmpForm->Show();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::freeHandLookupoldKeyPress(TObject *Sender, char &Key)
+{
+ if (Key == '\r') {
+ ListKey tmpVerseList = DefaultVSKey->ParseVerseList(freeHandLookup->Text.c_str(), *DefaultVSKey);
+
+ if (tmpVerseList.Count()) {
+ int index = freeHandLookup->Items->IndexOf(freeHandLookup->Text);
+ freeHandLookup->Items->Insert(0, freeHandLookup->Text);
+
+ if (index >= 0)
+ freeHandLookup->Items->Delete(index+1);
+
+ freeHandLookup->ItemIndex = 0;
+
+ if (tmpVerseList.Count() > 1) {
+ TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList);
+ tmpForm->Caption = _tr("User Verse List");
+ tmpForm->Show();
+ }
+
+ tmpVerseList = TOP;
+ *DefaultVSKey = tmpVerseList;
+ TextKeyChanged();
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::RTFMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) {
+ ((TWinControl *)Sender)->SetFocus();
+ TRichEdit *rtf = (TRichEdit *)Sender;
+ if (Button == mbRight) {
+ if (!rtf->SelLength)
+ SendMessage(rtf->Handle, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(X, Y));
+ TPoint menup, point;
+ point.x = X;
+ point.y = Y;
+ menup = rtf->ClientToScreen(point);
+ rtf->PopupMenu->Popup(menup.x, menup.y);
+ }
+}
+
+void __fastcall TForm1::RTFURLClick(TObject *Sender, const AnsiString URLText, TMouseButton Button) {
+ if (!renderingHint) {
+ TRichEdit *rtf = (TRichEdit *)Sender;
+ clickText = URLText;
+ rtf->PopupMenu->Popup(Mouse->CursorPos.x, Mouse->CursorPos.y);
+ }
+}
+
+
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::EditEntry1Click(TObject *Sender)
+{
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ SWModule *module;
+// EditEntry->RichEdit1->Text = rtf->Text;
+ ModMap::iterator target;
+ target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ EditEntryForm->Module = module = (*target).second;
+ EditEntryForm->RTFDisplay = rtf;
+ }
+ else EditEntryForm->Module = module = 0;
+ EditEntryForm->ShowModal();
+ if (EditEntryForm->ResultBuf) {
+ if (module)
+// DictKeyEdit->Text = EditEntry->ResultBuf; // for testing purposes
+ *module << EditEntryForm->ResultBuf;
+ }
+ RefreshActiveSheet(CommentaryPageControl);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::DeleteEntry1Click(TObject *Sender)
+{
+ if (MessageBox(Handle, "Are you sure you wish to delete this entry?", "Delete Entry", MB_YESNO) == IDYES) {
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ SWModule *module;
+ ModMap::iterator target;
+
+ target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ module = (*target).second;
+ module->deleteEntry();
+ }
+ RefreshActiveSheet(CommentaryPageControl);
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::LinktoVerse1Click(TObject *Sender)
+{
+ if (VerseSelFrm->ShowModal() == mrOk) {
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ SWModule *module;
+ ModMap::iterator target;
+ SWKey *linkkey = new VerseKey(VerseSelFrm->Panel2->Caption.c_str());
+
+ target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ module = (*target).second;
+ *module << linkkey;
+ }
+ RefreshActiveSheet(CommentaryPageControl);
+ }
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::GlobalOptionChange(TObject *Sender)
+{
+// ModMap::iterator it;
+// SectionMap::iterator sit;
+// ConfigEntMap::iterator eit, eitend;
+ ConfigEntMap::iterator eit;
+ TMenuItem *menuchoice = (TMenuItem *)Sender;
+ const char *source = menuchoice->Caption.c_str();
+ char *value = new char [strlen(source) + 1];
+ int k = 0;
+ for (unsigned int j = 0; j < strlen(source); j++) {
+ if (source[j] != '&')
+ value[k++] = source[j];
+ }
+ value[k] = 0;
+ source = menuchoice->Parent->Caption.c_str();
+ char *option = new char [strlen(source) + 1];
+ k = 0;
+ for (unsigned int j = 0; j < strlen(source); j++) {
+ if (source[j] != '&')
+ option[k++] = source[j];
+ }
+ option[k] = 0;
+ mainmgr->setGlobalOption(option, value);
+
+ if ((!stricmp(option, "Strong's Numbers")) && (!stricmp(value, "On"))) {
+ string curText = TextPageControl->ActivePage->Caption.c_str();
+ if (!hasFeature(mainmgr, curText.c_str(), "StrongsNumbers")) {
+ string tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("StrongsNumbers")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ for (int i = 0; i < TextPageControl->PageCount; i++) {
+ if (!stricmp(TextPageControl->Pages[i]->Caption.c_str(), tmpval.c_str())) {
+ TextPageControl->ActivePageIndex = i;
+ break;
+ }
+ }
+ }
+ }
+
+
+ delete [] option;
+ delete [] value;
+ TextKeyChanged();
+}
+//---------------------------------------------------------------------------
+
+
+
+void __fastcall TForm1::OptionShowVals(TObject *Sender)
+{
+ TMenuItem *menuChoice = (TMenuItem *)Sender;
+
+ string option = menuChoice->Caption.c_str();
+ int k = 0;
+ const char *source = option.c_str();
+ char *caption = new char [strlen(source) + 1];
+ for (unsigned int j = 0; j < strlen(source); j++) {
+ if (source[j] != '&')
+ caption[k++] = source[j];
+ }
+ caption[k] = 0;
+
+ string value = mainmgr->getGlobalOption(caption);
+ delete [] caption;
+ for (int i = 0; i < menuChoice->Count; i++) {
+ int k = 0;
+ char *source = menuChoice->Items[i]->Caption.c_str();
+ char *caption = new char [strlen(source) + 1];
+ for (unsigned int j = 0; j < strlen(source); j++) {
+ if (source[j] != '&')
+ caption[k++] = source[j];
+ }
+ caption[k] = 0;
+ if (!stricmp(caption, value.c_str()))
+ menuChoice->Items[i]->Checked = true;
+ else menuChoice->Items[i]->Checked = false;
+ delete [] caption;
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Contents1Click(TObject *Sender)
+{
+ string helpDir;
+ ConfigEntMap::iterator it = optionsconf->Sections["Help"].find("Directory");
+ if (it != optionsconf->Sections["Help"].end())
+ helpDir = (*it).second;
+ else helpDir = ".\\help";
+
+ string helpExe = helpDir + "\\sword.chm";
+
+ if ((int)ShellExecute(this->Handle, "open", helpExe.c_str(), NULL, NULL, SW_SHOWNORMAL) < 33) {
+ helpExe = helpDir + "\\index.html";
+ ShellExecute(this->Handle, "open", helpExe.c_str(), NULL, NULL, SW_SHOWNORMAL);
+ }
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
+{
+ int saveCount = 5;
+ closing = true;
+
+ ConfigEntMap section;
+ ConfigEntMap::iterator entryIt;
+
+
+ section = layoutconf->Sections["History"];
+ entryIt = section.find("SearchSaveCount");
+ if (entryIt != section.end())
+ saveCount = atoi(entryIt->second.c_str());
+ else section.insert(ConfigEntMap::value_type("SearchSaveCount", "5"));
+
+ section.erase("SearchText");
+ for (int loop = 0; ((loop < saveCount) && (loop < searchForm->SearchText->Items->Count)); loop++) {
+ WideString entry = searchForm->SearchText->Items->Strings[loop];
+ section.insert(ConfigEntMap::value_type("SearchText", WideStringToUTF8(entry).c_str()));
+ }
+
+ entryIt = section.find("LookupSaveCount");
+ if (entryIt != section.end())
+ saveCount = atoi(entryIt->second.c_str());
+ else section.insert(ConfigEntMap::value_type("LookupSaveCount", "5"));
+
+ section.erase("LookupText");
+ for (int loop = 0; ((loop < saveCount) && (loop < freeHandLookup->Items->Count)); loop++)
+ section.insert(ConfigEntMap::value_type("LookupText", freeHandLookup->Items->Strings[loop].c_str()));
+
+ section.erase("LastVerse");
+ section.insert(ConfigEntMap::value_type("LastVerse", (const char *)*DefaultVSKey));
+
+ section.erase("LastTextModule");
+ section.insert(ConfigEntMap::value_type("LastTextModule", TextPageControl->ActivePage->Caption.c_str()));
+
+ section.erase("LastComModule");
+ section.insert(ConfigEntMap::value_type("LastComModule", CommentaryPageControl->ActivePage->Caption.c_str()));
+
+ layoutconf->Sections["History"] = section;
+ layoutconf->Save();
+
+// NS_TermEmbedding();
+
+ section = optionsconf->Sections["Layout"];
+ entryIt = section.find("AutoSaveLayout");
+ if(entryIt != section.end()){
+ if(atoi(entryIt->second.c_str()))
+ SaveLayout1Click(this);
+ }
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::lbDictKeysOldClick(TObject *Sender)
+{
+ DictKeyEdit->Text = lbDictKeys->Items->Strings[lbDictKeys->ItemIndex];
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::HideShowModules1Click(TObject *Sender)
+{
+ ConfigEntMap *section;
+ TMenuItem *menuItem = (TMenuItem *)Sender;
+ TPopupMenu *menu = (TPopupMenu *)menuItem->GetParentMenu();
+ TComponent *comp = menu->PopupComponent;
+ TPageControl *pc = 0;
+
+ if ((comp == TextPageControl) || (comp == pnlText)) {
+ pc = TextPageControl;
+ section = &(*layoutconf)["TextView"];
+ }
+ if ((comp == CommentaryPageControl) || (comp == pnlComment)) {
+ pc = CommentaryPageControl;
+ section = &(*layoutconf)["CommentView"];
+ }
+ if ((comp == LexDictPageControl) || (comp == pnlDict)) {
+ pc = LexDictPageControl;
+ section = &(*layoutconf)["LDView"];
+ }
+
+ if (!pc) return; // assert pc
+
+ for (int i = 0; i < pc->PageCount; i++) {
+ string heading = pc->Pages[i]->Caption.c_str();
+ (*section)[heading.c_str()] = ((pc->Pages[i]->TabVisible) ? "true" : "false");
+ }
+ ModVisForm->mgr = mainmgr;
+ ModVisForm->section = section;
+ if (ModVisForm->ShowModal() == mrOk) {
+ for (int i = 0; i < pc->PageCount; i++) {
+ string heading = pc->Pages[i]->Caption.c_str();
+ pc->Pages[i]->TabVisible = ((*section)[heading.c_str()] == "true");
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::DevotionaloftheDay1Click(TObject *Sender) {
+ DevOfTheDay2->Show();
+}
+//---------------------------------------------------------------------------
+
+void dehtmlize(char *buf) {
+ bool deref = false;
+ int nums = 0;
+ while (*buf) {
+ if (deref) {
+ if (!isdigit(*buf))
+ deref = false;
+ else {
+ *buf = ' ';
+ nums++;
+ }
+ if (nums > 1)
+ deref = false;
+ }
+ if (*buf == '%') {
+ deref = true;
+ nums = 0;
+ *buf = ' ';
+ }
+ buf++;
+ }
+}
+
+void __fastcall TForm1::CppWebBrowser1BeforeNavigate2(TObject *Sender,
+ LPDISPATCH pDisp, TVariant *URL, TVariant *Flags,
+ TVariant *TargetFrameName, TVariant *PostData, TVariant *Headers,
+ TOLEBOOL *Cancel)
+{
+ AnsiString url = *URL;
+ string stuff = url.c_str();
+ char *offset = strstr(url.c_str(), "passage");
+ if (offset > 0) {
+ string verse = (offset+8);
+ char * buf = new char [ verse.length() + 1 ];
+ strcpy(buf, verse.c_str());
+ dehtmlize(buf);
+ (*Cancel) = true;
+ *DefaultVSKey = (buf);
+ TextKeyChanged();
+ delete [] buf;
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::InstallManager1Click(TObject *Sender)
+{
+ WinExec("InstallMgr.exe", SW_SHOWNORMAL);
+}
+//---------------------------------------------------------------------------
+
+
+void TForm1::RefRTFHeaders()
+{
+ ModMap::iterator it;
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit, eitend;
+ char textFont[128];
+ char commentFont[128];
+ char LDFont[128];
+ char tempTextFont[128];
+ char tempCommFont[128];
+ char tempLDFont[128];
+ char buf[1024];
+ TColor fieldColor;
+ string tmpval;
+ SWDispRTFChap* rtfDispChapter;
+ SWDispRTF* rtfDisp;
+
+ // Store fonts here: needed for being able to switch back to original font name if it changes
+ tmpval = ((eit = optionsconf->Sections["Appearance"].find("TextFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman";
+ strcpy(tempTextFont, tmpval.c_str());
+ tmpval = ((eit = optionsconf->Sections["Appearance"].find("CommentFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman";
+ strcpy(tempCommFont, tmpval.c_str());
+ tmpval = ((eit = optionsconf->Sections["Appearance"].find("LDFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman";
+ strcpy(tempLDFont, tmpval.c_str());
+
+ // Change the panels attributes here
+ for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) {
+ SWModule *module = it->second;
+ RTFDisp *disp = SWDYNAMIC_CAST(RTFDisp, module->Disp());
+ if (disp) {
+ rtfDisp = (SWDispRTF*) disp->editControl();
+ rtfDisp->recalcAppearance();
+ }
+ }
+
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end())
+ if ((*sit).second.find("LDBackColor") != (*sit).second.end())
+ lbDictKeys->Color = TColor((atoi((*(*sit).second.find("LDBackColor")).second.c_str())));
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end())
+ if ((*sit).second.find("LDFontColor") != (*sit).second.end())
+ lbDictKeys->Font->Color = TColor((atoi((*(*sit).second.find("LDFontColor")).second.c_str())));
+
+ // Change the text entry field color
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()){
+ if ((eit = (*sit).second.find("FieldColor")) != (*sit).second.end())
+ fieldColor = TColor(atoi((*eit).second.c_str()));
+ else fieldColor = clAqua;
+ }
+ cbBook->Color = fieldColor;
+ CHBox->Color = fieldColor;
+ VSBox->Color = fieldColor;
+ freeHandLookup->Color = fieldColor;
+ DictKeyEdit->Color = fieldColor;
+}
+
+
+void __fastcall TForm1::ApplicationEvents1Hint(TObject *Sender)
+{
+ StatusBar1->SimpleText = GetLongHint(Application->Hint);
+}
+
+
+void __fastcall TForm1::ApplicationEvents1ShowHint(AnsiString &HintStr,
+ bool &CanShow, THintInfo &HintInfo)
+{
+ ConfigEntMap::const_iterator const_eit;
+ string fontname;
+ char buf[1024];
+ static TRect lastRect(0,0,0,0);
+ bool selected = false;
+ bool link = false;
+ static WideString lastWord = "";
+ String verseList = "";
+ WideString targetWord;
+ // assert we are in a sword module rtf window and we're not grinding
+ if (HintInfo.HintControl == searchForm->resultsLV) {
+ HintStr = "";
+ }
+ if ((strncmp(HintInfo.HintControl->Name.c_str(), "TextRTF", 7)) &&
+ (strncmp(HintInfo.HintControl->Name.c_str(), "CommentRTF", 10)) &&
+ (strncmp(HintInfo.HintControl->Name.c_str(), "LexDictRTF", 10))) {
+ return;
+ }
+
+// Application->HintHidePause = HintDisplayTime;
+ HintInfo.HintWindowClass = __classid(THintWindow);
+
+ if (!Form1->Active)
+ return;
+
+ ConfigEntMap::iterator eit;
+ string tmpval = ((eit = optionsconf->Sections["HintStrongs"].find("On")) != optionsconf->Sections["HintStrongs"].end())? (*eit).second : (string)"1";
+
+ SWDispRTF *rtf = 0;
+ if (atoi(tmpval.c_str())) {
+ do {
+ ConfigEntMap::iterator eit;
+
+ HintInfo.HideTimeout = 32000;
+ HintInfo.HintWindowClass = __classid(TRTFHintWindow);
+ HintInfo.CursorRect = lastRect;
+ HintStr = "";
+
+ rtf = (SWDispRTF *)HintInfo.HintControl;
+
+ renderingHint = true;
+// HintTimer->Enabled = false;
+// HintTimer->Enabled = true;
+
+ if (!rtf->SelLength) {
+ SendMessage(rtf->Handle, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(HintInfo.CursorPos.x, HintInfo.CursorPos.y));
+ selected = false;
+ targetWord = rtf->WordAtCursor();
+
+ int entrylen = strlen(rtf->Text.c_str());
+ char *entrytext = new char [ entrylen + 1 ];
+ int selstart = rtf->SelStart;
+ int versestart, verseend;
+ strcpy(entrytext, rtf->Text.c_str());
+ // for (versestart = rtf->SelStart; ((versestart)&&(rtf->Text[versestart] != '#')); versestart--);
+ for (versestart = selstart; ((versestart)&&(entrytext[versestart] != '#')); versestart--);
+ if (versestart) {
+ for (verseend = versestart; ((verseend < entrylen) && (entrytext[verseend] != '|')); verseend++);
+ if ((verseend < entrylen) && (verseend > selstart)) {
+ int len = (verseend - versestart) + 1;
+ char *buf = new char [ len + 1 ];
+ memset(buf, 0 , len + 1);
+ strncpy(buf, &entrytext[versestart+1], len - 2); // strip the # and | from the string
+ int buflen = strlen(buf);
+ for (int i = 0; i < buflen; i++) {
+ if ((buf[i] == 10) || (buf[i] == 13))
+ buf[i] = ' ';
+ }
+ verseList = buf;
+ delete [] buf;
+ }
+ }
+ delete [] entrytext;
+ }
+ else {
+ selected = true;
+ targetWord = rtf->SelText;
+ }
+
+// TPoint currentChar = rtf->GetCharPos(rtf->SelStart);
+ TPoint currentChar = rtf->ScreenToClient(Mouse->CursorPos);
+ HintInfo.CursorRect = TRect(TPoint(currentChar.x-15, currentChar.y-15), TPoint(currentChar.x+15, currentChar.y+15));
+ lastRect = HintInfo.CursorRect;
+
+
+// HintInfo.CursorRect = TRect(TPoint(currentChar.x-12, currentChar.y-12), TPoint(currentChar.x+12, currentChar.y+12));
+// HintInfo.HideTimeout = 65000;
+// HintInfo.ReshowTimeout = 2000;
+// if (!rtf->SelLength) {
+// rtf->SelLength = 1;
+ if (!selected) {
+ rtf->SelLength = 1;
+ if (rtf->SelAttributes->Link) {
+ link = true;
+ int saveStart = rtf->SelStart;
+ int last = -1;
+ while ((rtf->SelStart != last) && (rtf->SelAttributes->Link)) {
+ last = rtf->SelStart;
+ rtf->SelStart -= 1;
+ rtf->SelLength = 1;
+ }
+ int start = rtf->SelStart + 1;
+ rtf->SelStart++;
+ rtf->SelLength = 1;
+ last = -1;
+ while ((rtf->SelStart != last) && (rtf->SelAttributes->Link)) {
+ last = rtf->SelStart;
+ rtf->SelStart += 1;
+ rtf->SelLength = 1;
+ }
+ int len = (rtf->SelStart - start);
+ rtf->SelStart = saveStart;
+ verseList = rtf->GetTextRange(start, start+len);
+ }
+ rtf->SelLength = 0;
+ }
+ else {
+ if (rtf->SelAttributes->Link) {
+ link = true;
+ }
+ }
+
+ // use cache if same word
+ if (targetWord.Length() && (targetWord == lastWord) && (currentRTF == rtf)) {
+ HintStr = "reshow same text";
+ break;
+ }
+ currentRTF = rtf;
+ lastWord = targetWord;
+
+ // currently assume all links are verselists
+ if (verseList.Length()) {
+ ModMap::iterator it;
+ it = mainmgr->Modules.find(TextPageControl->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ SWModule *module = it->second;
+ ListKey verses = DefaultVSKey->ParseVerseList(verseList.c_str(), *DefaultVSKey, true);
+ if (verses.Count()) {
+ RTFHintForm->rtfDrawer->fillWithVerses(module, &verses, true, true, "Popup");
+ HintStr = "show rtf";
+ }
+ else HintStr = "";
+ break;
+ }
+ }
+
+ // see if strongs number
+ char preChar = (targetWord.Length()) ? targetWord[1] : 0;
+ targetWord = TrimJunk(targetWord);
+
+ // check if all digits (strongs)
+ int i;
+ for (i = 1; i <= targetWord.Length(); i++) {
+ if (!isdigit(targetWord[i]))
+ break;
+ }
+
+ if ((i == targetWord.Length()+1) && (i-1)) {
+ String feature = (DefaultVSKey->Testament() == 1)?"Hebrew":"Greek";
+ feature += (preChar == '(')?"Parse":"Def";
+ if (!strncmp(HintInfo.HintControl->Name.c_str(), "TextRTFLXX", 10))
+ feature = "GreekDef";
+ string tmpval = ((eit = optionsconf->Sections["ModDefaults"].find(feature.c_str())) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
+ if (tmpval.size()) {
+ SWModule *defMod = mainmgr->Modules[tmpval];
+ if (!defMod) {
+ HintStr = "";
+ break;
+ }
+ defMod->SetKey(WideStringToUTF8(targetWord).c_str());
+ HintStr = defMod->RenderText();
+ defMod->SetKey(DefaultStrKey);
+
+ // Color attributes for the strongs portion of the hint are here.
+ // If the module uses it's own font load that else we will try the config file else we will use the default
+ RTFHintForm->rtfDrawer->module = defMod;
+ RTFHintForm->rtfDrawer->type = "Popup";
+ RTFHintForm->rtfDrawer->recalcAppearance();
+
+ if (HintStr.Length()) {
+ TMemoryStream *RTFStream = new TMemoryStream();
+ System::AnsiString newtext, tmptext;
+
+ newtext = RTFHintForm->rtfDrawer->RTFHeader;
+ newtext += RTFHintForm->rtfDrawer->RTFHeadMargin;
+ newtext += "\\pard \\nowidctlpar \\cf7\\f0 ";
+
+ tmptext = HintStr.c_str();
+ newtext += RTFHintForm->rtfDrawer->RTFVersePre + " " + tmptext + RTFHintForm->rtfDrawer->RTFVersePost;
+ newtext += RTFHintForm->rtfDrawer->RTFTrailer;
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
+ RTFStream->Position = 0;
+ RTFHintForm->rtfDrawer->Lines->LoadFromStream(RTFStream);
+ RTFHintForm->rtfDrawer->Repaint();
+
+ delete RTFStream;
+ HintStr = "show rtf";
+ break;
+ }
+ }
+ }
+ HintStr = "";
+ } while (false);
+ if (!HintStr.Length())
+ lastWord = "";
+ }
+}
+//---------------------------------------------------------------------------
+
+
+__fastcall TRTFHintWindow::TRTFHintWindow(Classes::TComponent* AOwner)
+ : THintWindow(AOwner)
+{
+ Canvas->Font->Name = "Arial";
+ Canvas->Font->Color = clWindowText;
+}
+
+__fastcall TRTFHintWindow::~TRTFHintWindow(void) {
+// RTFHintForm->Hide();
+}
+
+
+//------------------------------------------------------------------------------------------//
+
+void __fastcall TRTFHintWindow::CreateParams(TCreateParams &Params)
+{
+ inherited::CreateParams(Params);
+
+ Params.Style = WS_POPUP;
+ Params.WindowClass.style = Params.WindowClass.style | CS_SAVEBITS;
+
+ if(NewStyleControls)
+ {
+ Params.ExStyle = WS_EX_TOOLWINDOW;
+ AddBiDiModeExStyle(Params.ExStyle);
+ }
+}
+//------------------------------------------------------------------------------------------//
+
+void __fastcall TRTFHintWindow::Paint(void)
+{
+ TRect Rect = ClientRect;
+
+ TColor penColor;
+ string strColor;
+ strColor = Form1->optionsconf->Sections["Appearance"]["PopupFontColor"];
+ if(strColor == "")
+ penColor = clBlack;
+ else
+ penColor = StrToInt((AnsiString)strColor.c_str());
+
+ TColor backColor;
+ strColor = Form1->optionsconf->Sections["Appearance"]["PopupBackColor"];
+ if(strColor == "")
+ backColor = 14680063;
+ else
+ backColor = StrToInt((AnsiString)strColor.c_str());
+
+ Canvas->Brush->Color = penColor;
+ Canvas->FillRect(Rect);
+
+ Rect.Left += 4;
+ Rect.Top += 4;
+ Rect.Right -= 4;
+ Rect.Bottom -= 4;
+
+ Frame3D(Canvas, Rect, clBtnShadow, clBtnHighlight, 1);
+
+ Canvas->Brush->Color = backColor;//TColor(0xB4CDBB);
+ Canvas->FillRect(Rect);
+
+
+ Graphics::TMetafile *AMetaFile= new Graphics::TMetafile();
+ Graphics::TMetafileCanvas *AMetaFileCanvas = new Graphics::TMetafileCanvas(AMetaFile, 0);
+ Rect = ClientRect;
+ Rect.Right -= 12;
+ Rect.Bottom -=12;
+ bool jagged = RTFHintForm->rtfDrawer->paintTo(AMetaFileCanvas->Handle, &Rect);
+ delete AMetaFileCanvas;
+ Canvas->Draw(7,7,AMetaFile);
+ delete AMetaFile;
+
+ if (jagged) {
+ int triCount = (Rect.Right/60) + 1;
+ Canvas->Pen->Color = penColor; //clBlack; // TColor(0xA4BDAB);
+ Canvas->Brush->Color = penColor; //clBlack;
+ int i;
+ for (i = 0; i < triCount; i++) {
+ TPoint points[3];
+ points[0].x = i * 60;
+ points[0].y = ClientRect.Bottom;
+ points[1].x = (i * 60) + 30;
+ points[1].y = ClientRect.Bottom-15;
+ points[2].x = (i+1) * 60;
+ points[2].y = ClientRect.Bottom;
+ Canvas->Polygon(points, 2);
+ }
+/*
+ Canvas->Pen->Color = clBlack;
+ TPoint points[4];
+ points[0].x = 0; points[0].y = Rect.Bottom-1;
+ points[1].x = Rect.Right; points[1].y = Rect.Bottom-1;
+ points[2].x = Rect.Right; points[2].y = Rect.Bottom;
+ points[3].x = 0; points[3].y = Rect.Bottom;
+ Canvas->Polygon(points, 3);
+*/
+ }
+
+// RTFHintForm->rtfDrawer->PaintTo(Canvas->Handle, 4, 4);
+
+// RTFHintForm->Repaint();
+// RTFHintForm->rtfDrawer->Repaint();
+// Graphics::TBitmap *hintBit = RTFHintForm->GetFormImage();
+// Clipboard()->Assign(hintBit);
+// Canvas->CopyRect(Rect, hintBit->Canvas, Rect);
+// delete hintBit;
+
+/*
+ Rect.Left += 1;
+ Rect.Top += 5;
+ Rect.Right -= 1;
+ Rect.Bottom -= 1;
+
+ DrawText( Canvas->Handle,
+ Caption.c_str(),
+ -1,
+ &Rect,
+ DT_RIGHT|DT_NOPREFIX|DT_WORDBREAK|DrawTextBiDiModeFlagsReadingOnly() );
+ */
+}
+//------------------------------------------------------------------------------------------//
+
+void __fastcall TRTFHintWindow::ActivateHint(const /*Windows::*/TRect& Rect,
+ const AnsiString AHint)
+{
+ inherited::ActivateHint(Rect, AHint);
+}
+//------------------------------------------------------------------------------------------//
+
+void __fastcall TRTFHintWindow::ActivateHintData(const /*Windows::*/TRect& Rect,
+ const AnsiString AHint,
+ void* AData)
+{
+ TRect newRect = Rect;
+ // for dual head monitors, be sure we're all on one monitor
+ TForm1::ClipOrCenterRectToMonitor(&newRect, MONITOR_CLIP);
+ inherited::ActivateHintData(newRect, AHint, AData);
+}
+//------------------------------------------------------------------------------------------//
+
+bool __fastcall TRTFHintWindow::IsHintMsg(tagMSG& Msg)
+{
+ bool retVal = inherited::IsHintMsg(Msg);
+ if (retVal)
+ Form1->renderingHint = false;
+ return retVal;
+}
+
+//------------------------------------------------------------------------------------------//
+
+/*Windows::*/TRect __fastcall TRTFHintWindow::CalcHintRect(int MaxWidth,
+ const AnsiString AHint,
+ void* AData)
+{
+ TRect Rect(0, 0, 0, 0); // EmptyRect asks for size
+
+ Graphics::TMetafile *AMetaFile= new Graphics::TMetafile();
+ Graphics::TMetafileCanvas *AMetaFileCanvas = new Graphics::TMetafileCanvas(AMetaFile, 0);
+ RTFHintForm->rtfDrawer->paintTo(AMetaFileCanvas->Handle, &Rect);
+ delete AMetaFileCanvas;
+ delete AMetaFile;
+
+ Rect.Right += 12;
+ Rect.Bottom += 12;
+ return Rect;
+}
+//------------------------------------------------------------------------------------------//
+
+
+void __fastcall TForm1::Print1Click(TObject *Sender)
+{
+ PrintForm->ShowModal();
+}
+//---------------------------------------------------------------------------
+
+
+
+void __fastcall TForm1::SearchForWord1Click(TObject *Sender)
+{
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ int wordstart;
+ int saveSelStart = rtf->SelStart;
+ WideString lookupKey;
+ ConfigEntMap::iterator eit;
+
+ if (!rtf->SelLength) {
+ lookupKey = rtf->WordAtCursor();
+ lookupKey = TrimJunk(lookupKey);
+
+ int entrylen = strlen(rtf->Text.c_str());
+ WideString entrytext = rtf->GetText();
+ int selstart = rtf->SelStart;
+ int versestart, verseend;
+ for (versestart = selstart; versestart; versestart--) {
+ if (!isdigit(entrytext[versestart]))
+ break;
+ }
+ if ((entrytext[versestart] == '<') ||
+ (entrytext[versestart] == '(')) {
+ for (verseend = versestart+1; (verseend < entrylen); verseend++) {
+ if (!isdigit(entrytext[verseend]))
+ break;
+ }
+ if ((entrytext[verseend] == '>') ||
+ (entrytext[verseend] == ')')) {
+ if ((verseend < entrylen) && (verseend > selstart)) {
+ int len = (verseend - versestart) + 1;
+ lookupKey = entrytext.SubString(versestart, len);
+ }
+ }
+ }
+ }
+ else {
+ lookupKey = TRxRichEditX::Trim(rtf->GetTextRange(rtf->SelStart, rtf->SelStart + rtf->SelLength));
+ }
+
+ searchForm->SearchText->Text = lookupKey;
+ searchForm->Show();
+}
+//---------------------------------------------------------------------------
+
+//
+// ClipOrCenterRectToMonitor
+//
+// The most common problem apps have when running on a
+// multimonitor system is that they "clip" or "pin" windows
+// based on the SM_CXSCREEN and SM_CYSCREEN system metrics.
+// Because of app compatibility reasons these system metrics
+// return the size of the primary monitor.
+//
+// This shows how you use the multi-monitor functions
+// to do the same thing.
+//
+void TForm1::ClipOrCenterRectToMonitor(LPRECT prc, UINT flags) {
+ HMONITOR hMonitor;
+ MONITORINFO mi;
+ RECT rc;
+ int w = prc->right - prc->left;
+ int h = prc->bottom - prc->top;
+
+ //
+ // get the nearest monitor to the passed rect.
+ //
+ hMonitor = MonitorFromRect(prc, MONITOR_DEFAULTTONEAREST);
+
+ //
+ // get the work area or entire monitor rect.
+ //
+ mi.cbSize = sizeof(mi);
+ GetMonitorInfo(hMonitor, &mi);
+
+ if (flags & MONITOR_WORKAREA)
+ rc = mi.rcWork;
+ else
+ rc = mi.rcMonitor;
+
+ //
+ // center or clip the passed rect to the monitor rect
+ //
+ if (flags & MONITOR_CENTER)
+ {
+ prc->left = rc.left + (rc.right - rc.left - w) / 2;
+ prc->top = rc.top + (rc.bottom - rc.top - h) / 2;
+ prc->right = prc->left + w;
+ prc->bottom = prc->top + h;
+ }
+ else
+ {
+ prc->left = max(rc.left, min(rc.right-w, prc->left));
+ prc->top = max(rc.top, min(rc.bottom-h, prc->top));
+ prc->right = prc->left + w;
+ prc->bottom = prc->top + h;
+ }
+}
+
+
+void TForm1::ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags) {
+ RECT rc;
+ GetWindowRect(hwnd, &rc);
+ ClipOrCenterRectToMonitor(&rc, flags);
+ SetWindowPos(hwnd, NULL, rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+}
+
diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm b/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm
new file mode 100644
index 0000000..7a30ec1
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm
@@ -0,0 +1,738 @@
+object Form1: TForm1
+ Left = 414
+ Top = 117
+ Width = 686
+ Height = 510
+ Caption = 'The SWORD Project'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -10
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Icon.Data = {
+ 0000010001002020100000000000E80200001600000028000000200000004000
+ 0000010004000000000080020000000000000000000000000000000000000000
+ 000000008000008000000080800080000000800080008080000080808000C0C0
+ C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF006666
+ 6666666666666666666666666666688888888888888888088888888888866888
+ 8888888888888880888888888886688888888888888888808888888888866888
+ 8008888088008880800080008800688888088880880808808080808088006888
+ 8808888088080880800880888806688888008880080808880080808088066888
+ 8808080080800800080088008000688888080888888888888888888888066888
+ 8000088888888888888888888806688888888888888888880888888888866008
+ 8808880888877777777878888F86088088088808887888877788888888F60880
+ 800888078788888878878888888F6800808080878788888878878888888F6088
+ 808087878788888877788888888F0888088087887788888878888888888F0808
+ 0888788878788887788888F888F600000087778777877777777888FFFF866888
+ 8880888888888888888888888886688888880888888888888888888888866800
+ 8880808800088888888888888886688088808808080888888888888888866880
+ 8880080800888888888888888886688088800008080888888888888888866880
+ 8880880880088888888888888886088080808888888888888888888888860000
+ 0080888888888888888888888886688888808888888888888888888888866888
+ 8888088888888888888888888886666666660666666666666666666666660000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000000000000000000000000000}
+ KeyPreview = True
+ Menu = MainMenu1
+ OldCreateOrder = True
+ Position = poDefault
+ Scaled = False
+ ShowHint = True
+ OnClose = FormClose
+ OnCreate = FormCreate
+ OnKeyDown = FormKeyDown
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Splitter2: TSplitter
+ Left = 0
+ Top = 282
+ Width = 678
+ Height = 5
+ Cursor = crVSplit
+ Align = alTop
+ ResizeStyle = rsUpdate
+ end
+ object pnlTextCom: TPanel
+ Left = 0
+ Top = 46
+ Width = 678
+ Height = 236
+ Align = alTop
+ BevelOuter = bvNone
+ Caption = 'pnlTextCom'
+ TabOrder = 0
+ object Splitter1: TSplitter
+ Left = 368
+ Top = 0
+ Width = 5
+ Height = 236
+ Cursor = crHSplit
+ ResizeStyle = rsUpdate
+ end
+ object pnlText: TPanel
+ Left = 0
+ Top = 0
+ Width = 368
+ Height = 236
+ Align = alLeft
+ BevelOuter = bvNone
+ Constraints.MinHeight = 10
+ Constraints.MinWidth = 10
+ PopupMenu = PopupMenu4
+ TabOrder = 0
+ object TextPageControl: TPageControl
+ Left = 0
+ Top = 0
+ Width = 368
+ Height = 236
+ Hint = 'Biblical Texts'
+ Align = alClient
+ Font.Charset = ANSI_CHARSET
+ Font.Color = clBlack
+ Font.Height = -9
+ Font.Name = 'Arial'
+ Font.Style = []
+ HotTrack = True
+ MultiLine = True
+ ParentFont = False
+ PopupMenu = PopupMenu4
+ TabHeight = 14
+ TabOrder = 0
+ OnChange = TextPageControlChange
+ end
+ end
+ object pnlComment: TPanel
+ Left = 373
+ Top = 0
+ Width = 305
+ Height = 236
+ Align = alClient
+ BevelOuter = bvNone
+ Constraints.MinHeight = 10
+ Constraints.MinWidth = 10
+ PopupMenu = PopupMenu4
+ TabOrder = 1
+ object CommentaryPageControl: TPageControl
+ Left = 0
+ Top = 0
+ Width = 305
+ Height = 236
+ Hint = 'Commentaries'
+ Align = alClient
+ Font.Charset = ANSI_CHARSET
+ Font.Color = clBlack
+ Font.Height = -9
+ Font.Name = 'Arial'
+ Font.Style = []
+ HotTrack = True
+ MultiLine = True
+ ParentFont = False
+ PopupMenu = PopupMenu4
+ TabHeight = 14
+ TabOrder = 0
+ OnChange = CommentaryPageControlChange
+ end
+ end
+ end
+ object pnlDict: TPanel
+ Left = 0
+ Top = 287
+ Width = 678
+ Height = 162
+ Align = alClient
+ BevelOuter = bvNone
+ Constraints.MinHeight = 10
+ Constraints.MinWidth = 10
+ PopupMenu = PopupMenu4
+ TabOrder = 1
+ object Splitter3: TSplitter
+ Left = 488
+ Top = 0
+ Width = 5
+ Height = 162
+ Cursor = crHSplit
+ Align = alRight
+ end
+ object LexDictPageControl: TPageControl
+ Left = 0
+ Top = 0
+ Width = 488
+ Height = 162
+ Hint = 'Lexicons / Dictionaries'
+ Align = alClient
+ Font.Charset = ANSI_CHARSET
+ Font.Color = clBlack
+ Font.Height = -9
+ Font.Name = 'Arial'
+ Font.Style = []
+ HotTrack = True
+ MultiLine = True
+ ParentFont = False
+ PopupMenu = PopupMenu4
+ TabHeight = 14
+ TabOrder = 0
+ OnChange = LexDictPageControlChange
+ end
+ object Panel2: TPanel
+ Left = 493
+ Top = 0
+ Width = 185
+ Height = 162
+ Align = alRight
+ Caption = 'Panel2'
+ TabOrder = 1
+ object DictKeyEditOld: TRichEdit
+ Left = 1
+ Top = 1
+ Width = 183
+ Height = 24
+ Align = alTop
+ Color = clAqua
+ MaxLength = 128
+ PlainText = True
+ TabOrder = 0
+ WantReturns = False
+ WordWrap = False
+ OnChange = DictKeyEditOldChange
+ end
+ object lbDictKeysOld: TListBox
+ Left = 1
+ Top = 25
+ Width = 183
+ Height = 136
+ Align = alClient
+ ItemHeight = 13
+ TabOrder = 1
+ OnClick = lbDictKeysOldClick
+ end
+ end
+ end
+ object StatusBar1: TStatusBar
+ Left = 0
+ Top = 449
+ Width = 678
+ Height = 15
+ Panels = <>
+ SimplePanel = True
+ end
+ object CoolBar1: TCoolBar
+ Left = 0
+ Top = 0
+ Width = 678
+ Height = 46
+ AutoSize = True
+ Bands = <
+ item
+ Control = ToolBar2
+ ImageIndex = -1
+ MinHeight = 40
+ Width = 106
+ end
+ item
+ Break = False
+ Control = Panel1
+ ImageIndex = -1
+ MinHeight = 42
+ Width = 250
+ end
+ item
+ Break = False
+ Control = ToolBar1
+ ImageIndex = -1
+ Width = 314
+ end>
+ object BackBtnImage: TImage
+ Left = 16
+ Top = 0
+ Width = 38
+ Height = 34
+ AutoSize = True
+ Picture.Data = {
+ 07544269746D61701E030000424D1E0300000000000076000000280000002600
+ 0000220000000100040000000000A80200000000000000000000100000001000
+ 0000FFFFFF00FFCFCE00B5AECE00848284009CFF31002120210000FF00008482
+ 0000008200003934000000000000000000000000000000000000000000000000
+ 0000777777777777777777777777777777777777770077777777777777777777
+ 777777777777A77777007777777777777777777777777777777A777777007777
+ 7AA7AAA77AA77AA77AAA77A777A7777777007777777A777A7A7A7A77A777A7A7
+ 77A7777777007777777A777A7A7AAA77A777A7AA7A77777777007777777A777A
+ 7A777A77A777777AAA77777777007777777A77AA77A77A77A777777A77A77777
+ 77007777777AAAA777A77A77A777A77AA77A777777007777777A77AA777A7A77
+ 7A77A77A7A7A777777007777777A777A7777AA7777AAA77A77AA777777007777
+ 777A777A777777777777777A77777777770077777AAAAAA7777777775577777A
+ 777777777700777777777777777777768577777A777777777700777777777777
+ 7777776868777777A777777777007777777777777777768688777777A7777777
+ 77007777777777777777686868777777A7777777770077777777777777768686
+ 88777777AA777777770077777777777777686868687777777777777777007777
+ 7777777776868686868697777777777777007777777777776868686868683777
+ 7777777777007777777777768686868686865777777777777700777777777778
+ 6848686868685777777777777700777777777774214141616161577777777777
+ 7700777777777777421414161616377777777777770077777777777774214141
+ 6161977777777777770077777777777777421414187777777777777777007777
+ 7777777777742141687777777777777777007777777777777777421418777777
+ 7777777777007777777777777777742168777777777777777700777777777777
+ 7777774218777777777777777700777777777777777777742577777777777777
+ 7700777777777777777777774377777777777777770077777777777777777777
+ 77777777777777777700}
+ Transparent = True
+ Visible = False
+ end
+ object SearchBtnImage: TImage
+ Left = 56
+ Top = 0
+ Width = 38
+ Height = 34
+ AutoSize = True
+ Picture.Data = {
+ 07544269746D61701E030000424D1E0300000000000076000000280000002600
+ 0000220000000100040000000000A80200000000000000000000100000001000
+ 0000FFFFFF00F2F5FF00FFF7E100BAC0CF007E828F00DBB97700C4862300F6FF
+ 0C0002000600B5AECE0000000000000000000000000000000000000000000000
+ 0000999999999999999999999999999999998999990099999999999999999999
+ 9999999999999899990099999999999999999999999999999999989999009988
+ 8999888998899889899999888998998999009899989889989898989989999899
+ 9898999899009899989899989898889988999899989889989900999998988899
+ 9899989988999899999889998900999989989988998998998899989999988899
+ 8900998899989998998998998989989998988899890098899999899899989898
+ 8888998998998989890098999999988999998899989899988899899889009889
+ 8999999999999999999999999999899999009988899998889999999999999999
+ 9999899999009999999986668999999999999999999989999900999999996776
+ 6899999999999999999989999900999999995677868999999999999999999899
+ 9900999999999568786899999999999999999899990099999999995687868999
+ 9999999999999889990099999999999568744844888889999999999999009999
+ 9999999956734488888888899999999999009999999999999561488822222288
+ 9999999999009999999999999953888222222228899999999900999999999999
+ 9998882222222222899999999900999999999999999882222222222228999999
+ 9900999999999999999882222222222224999999990099999999999999984222
+ 2222222224999999990099999999999999984222222222222499999999009999
+ 9999999999984222222222222499999999009999999999999998422222222222
+ 2499999999009999999999999999822222222222499999999900999999999999
+ 9999892222222222499999999900999999999999999994922222222499999999
+ 9900999999999999999999442222244999999999990099999999999999999999
+ 44444999999999999900}
+ Transparent = True
+ Visible = False
+ end
+ object ToolBar2: TToolBar
+ Left = 9
+ Top = 1
+ Width = 93
+ Height = 40
+ AutoSize = True
+ ButtonHeight = 40
+ ButtonWidth = 45
+ EdgeBorders = []
+ Flat = True
+ Images = ImageList1
+ TabOrder = 0
+ object ToolButton3: TToolButton
+ Left = 0
+ Top = 0
+ Hint = 'Go Back To Previous Location'
+ Caption = 'Back'
+ ImageIndex = 0
+ OnClick = BackbtnClick
+ end
+ object ToolButton4: TToolButton
+ Left = 45
+ Top = 0
+ Hint = 'Bring Up Search Window'
+ Caption = 'ToolButton4'
+ ImageIndex = 1
+ OnClick = NewSearchWindow1Click
+ end
+ end
+ object Panel1: TPanel
+ Left = 117
+ Top = 0
+ Width = 237
+ Height = 42
+ BevelOuter = bvNone
+ TabOrder = 2
+ object btnLookup: TSpeedButton
+ Left = 212
+ Top = 0
+ Width = 21
+ Height = 21
+ Hint = 'Lookup'
+ Flat = True
+ Glyph.Data = {
+ 76010000424D7601000000000000760000002800000020000000100000000100
+ 0400000000000001000000000000000000001000000010000000000000000000
+ 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00555555555555
+ 555555555555555555555555555555555555555555FF55555555555559055555
+ 55555555577FF5555555555599905555555555557777F5555555555599905555
+ 555555557777FF5555555559999905555555555777777F555555559999990555
+ 5555557777777FF5555557990599905555555777757777F55555790555599055
+ 55557775555777FF5555555555599905555555555557777F5555555555559905
+ 555555555555777FF5555555555559905555555555555777FF55555555555579
+ 05555555555555777FF5555555555557905555555555555777FF555555555555
+ 5990555555555555577755555555555555555555555555555555}
+ NumGlyphs = 2
+ OnClick = btnLookupClick
+ end
+ object cbBook: TComboBox
+ Left = 0
+ Top = 0
+ Width = 121
+ Height = 21
+ Style = csDropDownList
+ Color = clAqua
+ ItemHeight = 13
+ TabOrder = 0
+ OnChange = cbBookChange
+ end
+ object CHBox: TEdit
+ Left = 128
+ Top = 0
+ Width = 25
+ Height = 22
+ Color = clAqua
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'Arial'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 1
+ Text = '1'
+ end
+ object UpDown1: TUpDown
+ Left = 153
+ Top = 0
+ Width = 22
+ Height = 22
+ Associate = CHBox
+ Min = -1
+ Max = 200
+ Position = 1
+ TabOrder = 2
+ Wrap = False
+ OnClick = UpDown1Click
+ end
+ object VSBox: TEdit
+ Left = 168
+ Top = 0
+ Width = 25
+ Height = 22
+ Color = clAqua
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'Arial'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 3
+ Text = '19'
+ end
+ object UpDown2: TUpDown
+ Left = 193
+ Top = 0
+ Width = 22
+ Height = 22
+ Associate = VSBox
+ Min = -1
+ Max = 200
+ Position = 19
+ TabOrder = 4
+ Wrap = False
+ OnClick = UpDown1Click
+ end
+ object freeHandLookup: TComboBox
+ Left = 0
+ Top = 21
+ Width = 233
+ Height = 21
+ Color = clAqua
+ ItemHeight = 13
+ TabOrder = 5
+ OnKeyPress = freeHandLookupoldKeyPress
+ end
+ end
+ object ToolBar1: TToolBar
+ Left = 369
+ Top = 8
+ Width = 301
+ Height = 25
+ AutoSize = True
+ ButtonHeight = 23
+ ButtonWidth = 82
+ EdgeBorders = []
+ Images = ImageList2
+ TabOrder = 3
+ object Bookmarkbtn: TSpeedButton
+ Left = 0
+ Top = 2
+ Width = 101
+ Height = 23
+ Caption = 'Bookmark'
+ Glyph.Data = {
+ 76010000424D7601000000000000760000002800000020000000100000000100
+ 0400000000000001000000000000000000001000000010000000000000000000
+ 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
+ 333333333333FF3333333333333C0C333333333333F777F3333333333CC0F0C3
+ 333333333777377F33333333C30F0F0C333333337F737377F333333C00FFF0F0
+ C33333F7773337377F333CC0FFFFFF0F0C3337773F33337377F3C30F0FFFFFF0
+ F0C37F7373F33337377F00FFF0FFFFFF0F0C7733373F333373770FFFFF0FFFFF
+ F0F073F33373F333373730FFFFF0FFFFFF03373F33373F333F73330FFFFF0FFF
+ 00333373F33373FF77333330FFFFF000333333373F333777333333330FFF0333
+ 3333333373FF7333333333333000333333333333377733333333333333333333
+ 3333333333333333333333333333333333333333333333333333}
+ Layout = blGlyphRight
+ NumGlyphs = 2
+ OnClick = BookmarkbtnClick
+ end
+ object BookmarkBtnImage: TImage
+ Left = 101
+ Top = 5
+ Width = 75
+ Height = 16
+ AutoSize = True
+ Picture.Data = {
+ 07544269746D6170F6020000424DF60200000000000076000000280000004B00
+ 0000100000000100040000000000800200000000000000000000100000001000
+ 0000000000000000800000800000008080008000000080008000808000008080
+ 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
+ FF00888888888888888888888888888888888888888888888888888888888888
+ 8888888888888880000088888888888888888888888888888888888888888888
+ 888888888888888888C0C8888888888000008888888888888888888888888888
+ 88888888888888888888888888888888CC0F0C88888888800000888888888888
+ 88888888888888888888888888888888888888888888888C80F0F0C888888880
+ 00008888000088880008880008808880808808808800008088088808888888C0
+ 0FFF0F0C88888880000088880888088088808088808088088088088080888080
+ 880880888888CC0FFFFFF0F0C888888000008888088808808880808880808088
+ 808808808088808088080888888C80F0FFFFFF0F0C8888800000888808880880
+ 888080888080088880880880880000808800888888800FFF0FFFFFF0F0C88880
+ 000088880000888088808088808080888088088088888080880808888880FFFF
+ F0FFFFFF0F088880000088880888088800088800088088088000800888000880
+ 0808808888880FFFFF0FFFFFF088888000008888088808888888888888808888
+ 888888888888888888088888888880FFFFF0FFF0088888800000888808880888
+ 88888888888088888888888888888888880888888888880FFFFF000888888880
+ 0000888800008888888888888880888888888888888888888808888888888880
+ FFF0888888888880000088888888888888888888888888888888888888888888
+ 8888888888888888000888888888888000008888888888888888888888888888
+ 8888888888888888888888888888888888888888888888800000888888888888
+ 8888888888888888888888888888888888888888888888888888888888888880
+ 0000}
+ Visible = False
+ end
+ end
+ object pnlSpeed: TPanel
+ Left = 12
+ Top = 0
+ Width = 0
+ Height = 49
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 1
+ end
+ end
+ object MainMenu1: TMainMenu
+ Left = 572
+ Top = 4
+ object File1: TMenuItem
+ Caption = '&File'
+ object SaveLayout1: TMenuItem
+ Caption = 'S&ave Layout'
+ OnClick = SaveLayout1Click
+ end
+ object N5: TMenuItem
+ Caption = '-'
+ end
+ object Print1: TMenuItem
+ Caption = '&Print...'
+ OnClick = Print1Click
+ end
+ object N1: TMenuItem
+ Caption = '-'
+ end
+ object Exit1: TMenuItem
+ Caption = 'E&xit'
+ OnClick = Exit1Click
+ end
+ end
+ object Edit1: TMenuItem
+ Caption = '&Edit'
+ object Copy3: TMenuItem
+ Caption = '&Copy'
+ OnClick = Copy1Click
+ end
+ end
+ object Options2: TMenuItem
+ Caption = 'Options'
+ object Options1: TMenuItem
+ Caption = '&Preferences...'
+ OnClick = Options1Click
+ end
+ end
+ object Search1: TMenuItem
+ Caption = '&Search'
+ object NewSearchWindow1: TMenuItem
+ Caption = '&New Search Window'
+ ShortCut = 114
+ OnClick = NewSearchWindow1Click
+ end
+ end
+ object Tools1: TMenuItem
+ Caption = '&Tools'
+ object InstallManager1: TMenuItem
+ Caption = 'Install Manager'
+ OnClick = InstallManager1Click
+ end
+ end
+ object Help1: TMenuItem
+ Caption = '&Help'
+ object Contents1: TMenuItem
+ Caption = 'Contents'
+ OnClick = Contents1Click
+ end
+ object DevotionaloftheDay1: TMenuItem
+ Caption = 'Devotional of the Day'
+ OnClick = DevotionaloftheDay1Click
+ end
+ object SEPERATOR: TMenuItem
+ Caption = '-'
+ end
+ object About1: TMenuItem
+ Caption = '&About'
+ OnClick = About1Click
+ end
+ end
+ end
+ object PopupMenu2: TPopupMenu
+ OnPopup = PopupMenuPopup
+ Left = 273
+ Top = 246
+ object Copy2: TMenuItem
+ Caption = '&Copy'
+ OnClick = Copy1Click
+ end
+ object DictionaryLookup1: TMenuItem
+ Caption = 'Dictionary Lookup'
+ OnClick = DictionaryLookup1Click
+ end
+ object SearchForWord2: TMenuItem
+ Caption = 'Search For Word'
+ OnClick = SearchForWord1Click
+ end
+ end
+ object Search: TDdeServerItem
+ ServerConv = Bible
+ OnPokeData = SearchPokeData
+ Left = 684
+ Top = 60
+ end
+ object Lookup: TDdeServerItem
+ ServerConv = Bible
+ OnPokeData = LookupPokeData
+ Left = 656
+ Top = 60
+ end
+ object Bible: TDdeServerConv
+ Left = 624
+ Top = 60
+ end
+ object PopupMenu1: TPopupMenu
+ OnPopup = PopupMenuPopup
+ Left = 245
+ Top = 246
+ object Copy1: TMenuItem
+ Caption = '&Copy'
+ OnClick = Copy1Click
+ end
+ object CopyasBGreekTransliteration1: TMenuItem
+ Caption = 'Copy as &B-Greek Transliteration'
+ OnClick = CopyasBGreekTransliteration1Click
+ end
+ object MenuItem1: TMenuItem
+ Caption = 'Dictionary Lookup'
+ OnClick = DictionaryLookup1Click
+ end
+ object SearchForWord1: TMenuItem
+ Caption = 'Search For Word'
+ OnClick = SearchForWord1Click
+ end
+ end
+ object BookmarkPopup: TPopupMenu
+ Left = 600
+ object AddBookmark1: TMenuItem
+ Caption = '&Add Bookmark'
+ Hint = 'Add Current Verse to Personal Bookmarks'
+ OnClick = AddBookmark1Click
+ end
+ object EditBookmarks1: TMenuItem
+ Caption = '&Edit Bookmarks / Tree View...'
+ Hint = 'Edit Bookmarks / View Bookmarks in a Tree View'
+ OnClick = EditBookmarks1Click
+ end
+ object N2: TMenuItem
+ Caption = '-'
+ end
+ end
+ object ImageList1: TImageList
+ BlendColor = clBtnFace
+ DrawingStyle = dsTransparent
+ Height = 34
+ Width = 38
+ Left = 14
+ Top = 4
+ end
+ object ImageList2: TImageList
+ Masked = False
+ Width = 75
+ Left = 518
+ Top = 2
+ end
+ object PopupMenu3: TPopupMenu
+ OnPopup = PopupMenuPopup
+ Left = 301
+ Top = 246
+ object EditEntry1: TMenuItem
+ Caption = '&Edit Entry'
+ OnClick = EditEntry1Click
+ end
+ object DeleteEntry1: TMenuItem
+ Caption = '&Delete Entry'
+ OnClick = DeleteEntry1Click
+ end
+ object LinktoVerse1: TMenuItem
+ Caption = 'Link to Comment for Verse...'
+ OnClick = LinktoVerse1Click
+ end
+ object N3: TMenuItem
+ Caption = '-'
+ end
+ object Copy4: TMenuItem
+ Caption = '&Copy'
+ OnClick = Copy1Click
+ end
+ object DictionaryLookup2: TMenuItem
+ Caption = 'Dictionary Lookup'
+ OnClick = DictionaryLookup1Click
+ end
+ object SearchForWord3: TMenuItem
+ Caption = 'Search For Word'
+ OnClick = SearchForWord1Click
+ end
+ end
+ object PopupMenu4: TPopupMenu
+ Left = 328
+ Top = 58
+ object HideShowModules1: TMenuItem
+ Caption = 'Hide / Show Modules'
+ OnClick = HideShowModules1Click
+ end
+ end
+ object ApplicationEvents1: TApplicationEvents
+ OnHint = ApplicationEvents1Hint
+ OnShowHint = ApplicationEvents1ShowHint
+ Left = 547
+ Top = 19
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.h b/apps/windoze/CBuilder5/BibleCS/mainfrm.h
new file mode 100644
index 0000000..cd23e99
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.h
@@ -0,0 +1,418 @@
+//---------------------------------------------------------------------------
+#ifndef mainfrmH
+#define mainfrmH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ExtCtrls.hpp>
+#include <vcl\ComCtrls.hpp>
+#include "biblecsmgr.h"
+#include <swtext.h>
+#include <strkey.h>
+#include <regex.h>
+#include <listkey.h>
+#include <swgenbook.h>
+#include "swdisprtfchap.h"
+#include <AppEvnts.hpp>
+#include <Buttons.hpp>
+#include <DdeMan.hpp>
+#include <Graphics.hpp>
+#include <ImgList.hpp>
+#include <Menus.hpp>
+#include <ToolWin.hpp>
+#include <vcl\Buttons.hpp>
+#include <vcl\Menus.hpp>
+#include <vcl\DdeMan.hpp>
+#include <OleCtrls.hpp>
+#include <ToolWin.hpp>
+#include <shellapi.h>
+#include <Graphics.hpp>
+#include <ImgList.hpp>
+#include <jpeg.hpp>
+#include "RxRichEdit.hpp"
+//#include "MOZILLACONTROLLib_OCX.h"
+#include "SHDocVw_OCX.h"
+#include <AppEvnts.hpp>
+#include <TntStdCtrls.hpp>
+
+#ifndef USEOLDRTF
+#include "RxRichEdit.hpp"
+#else
+#define TRxRichEdit TRichEdit
+#endif
+
+#include <list>
+#include <vector>
+
+#define _tr(text) LocaleMgr::systemLocaleMgr.translate(text)
+#define MONITOR_CENTER 0x0001 // center rect to monitor
+#define MONITOR_CLIP 0x0000 // clip rect to monitor
+#define MONITOR_WORKAREA 0x0002 // use monitor work area
+#define MONITOR_AREA 0x0000 // use monitor entire area
+
+
+class RTFDisp : public SWDisplay {
+ SWDispRTF *edit;
+ static SWClass classdef;
+public:
+ RTFDisp(SWDispRTF *iedit) { myclass = &classdef; edit = iedit; }
+ virtual SWDispRTF *editControl() { return edit; }
+ RTFDisp() {}
+ virtual char Display(SWModule &imodule) {
+ return edit->Display(imodule);
+ }
+};
+
+class RTFBookDisp : public RTFDisp {
+ SWDispRTF *edit;
+ TTreeView *toc;
+public:
+ RTFBookDisp(SWDispRTF *iedit, TTreeView *itoc) : RTFDisp(iedit) { toc = itoc;}
+ RTFBookDisp() {}
+
+ void fillTreeTOC(TreeKeyIdx treeKey, TTreeView *tree, TTreeNode *parent) {
+ TTreeNode *node = tree->Items->AddChildObject(parent, treeKey.getLocalName(), (void *)treeKey.getOffset());
+ if (treeKey.firstChild()) {
+ fillTreeTOC(treeKey, tree, node);
+ treeKey.parent();
+ }
+ if (treeKey.nextSibling())
+ fillTreeTOC(treeKey, tree, parent);
+ }
+
+ virtual char Display(SWModule &imodule) {
+ if (!toc->Items->GetFirstNode()) {
+ //edit->Text = "Loading TOC...";
+ imodule = TOP;
+ ((TreeKeyIdx *)((SWKey *)imodule))->firstChild();
+ fillTreeTOC(*(TreeKeyIdx *)((SWKey *)imodule), toc, toc->Selected);
+ }
+ return RTFDisp::Display(imodule);
+ }
+};
+
+class HREFDisp : public SWDisplay {
+ TCppWebBrowser *edit;
+public:
+ HREFDisp(TCppWebBrowser *iedit) { edit = iedit; }
+ HREFDisp() {}
+ char Display(SWModule &imodule) {
+
+ TMemoryStream *stm = new TMemoryStream();
+
+ if ( stm == NULL )
+ return 1;
+
+ stm->Clear();
+ string modText = (string)"<HTML><BODY>" + (string)imodule.RenderText() + (string)"</BODY></HTML>";
+ stm->WriteBuffer(modText.c_str(), modText.length());
+
+ IPersistStreamInit *psi = NULL;
+
+ stm->Seek( 0, 0 );
+
+ // If you pass soOwned instead, the stream will be freed for you
+ TStreamAdapter *sa = new TStreamAdapter( stm, soReference );
+
+ if ( sa == NULL ) {
+ delete stm;
+ return 1;
+ }
+
+ _di_IDispatch doc = edit->Document;
+ if ( doc == NULL ) {
+ TVariant url = "about:blank";
+ edit->Navigate2( &url );
+ while ( doc == NULL ) {
+ Application->ProcessMessages();
+ doc = edit->Document;
+ }
+ }
+
+// if ( doc->QueryInterface(IID_IPersistStreamInit, (void**)&psi ) == S_OK ) {
+ HRESULT result = doc->QueryInterface(IID_IPersistStreamInit, (void**)&psi );
+ if (result == S_OK) {
+// if ( doc->QueryInterface(IID_IWrite, (void**)"test" ) == S_OK ) {
+ if ( psi )
+ psi->Load( *sa );
+ }
+ else
+ delete sa;
+
+ delete stm;
+
+// edit->SetTextBuf("yo mama");
+// edit->RequestDoc((char *)imodule);
+ return 0;
+ }
+};
+
+class DispExternal : public SWDisplay {
+public:
+ DispExternal() {}
+ char Display(SWModule &imodule) {
+ SHELLEXECUTEINFO info;
+ info.cbSize = sizeof(SHELLEXECUTEINFO);
+ info.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_CLASSNAME;
+ info.hwnd = GetFocus();
+ info.lpVerb = "open";
+ info.lpFile = (const char *)imodule;
+ info.lpParameters = NULL;
+ info.lpDirectory = NULL;
+ info.nShow = 0;
+// info.lpClass = ".html";
+ ShellExecuteEx(&info);
+// ShellExecute(edit->Handle, "open", (char *)imodule, NULL, NULL, SW_SHOWNORMAL);
+ return 0;
+ }
+};
+
+
+class ModState {
+public:
+ ModState(TPageControl *ipc, TTabSheet *iap, SWKey ikey) { pc = ipc; ap = iap; key = ikey; }
+ ModState();
+ TPageControl *pc;
+ TTabSheet* ap;
+ SWKey key;
+};
+
+//---------------------------------------------------------------------------
+class TForm1 : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *pnlTextCom;
+ TSplitter *Splitter2;
+ TPanel *pnlText;
+ TPanel *pnlComment;
+ TSplitter *Splitter1;
+ TPanel *pnlDict;
+ TPageControl *TextPageControl;
+ TPageControl *CommentaryPageControl;
+ TStatusBar *StatusBar1;
+ TPageControl *LexDictPageControl;
+ TMainMenu *MainMenu1;
+ TMenuItem *Search1;
+ TMenuItem *NewSearchWindow1;
+ TMenuItem *Help1;
+ TMenuItem *About1;
+ TPopupMenu *PopupMenu2;
+ TMenuItem *DictionaryLookup1;
+ TMenuItem *File1;
+ TMenuItem *SaveLayout1;
+ TMenuItem *Exit1;
+ TMenuItem *N1;
+ TDdeServerItem *Search;
+ TDdeServerItem *Lookup;
+ TDdeServerConv *Bible;
+ TPopupMenu *PopupMenu1;
+ TMenuItem *MenuItem1;
+ TMenuItem *Copy1;
+ TMenuItem *CopyasBGreekTransliteration1;
+ TMenuItem *Copy2;
+ TMenuItem *Edit1;
+ TMenuItem *Copy3;
+ TPopupMenu *BookmarkPopup;
+ TMenuItem *AddBookmark1;
+ TMenuItem *N2;
+ TMenuItem *EditBookmarks1;
+ TMenuItem *Options1;
+ TCoolBar *CoolBar1;
+ TImageList *ImageList1;
+ TImage *BackBtnImage;
+ TImage *SearchBtnImage;
+ TToolBar *ToolBar2;
+ TToolButton *ToolButton3;
+ TToolButton *ToolButton4;
+ TPanel *pnlSpeed;
+ TPanel *Panel1;
+ TComboBox *cbBook;
+ TEdit *CHBox;
+ TUpDown *UpDown1;
+ TEdit *VSBox;
+ TUpDown *UpDown2;
+ TSpeedButton *btnLookup;
+ TToolBar *ToolBar1;
+ TImageList *ImageList2;
+ TImage *BookmarkBtnImage;
+ TSpeedButton *Bookmarkbtn;
+ TPopupMenu *PopupMenu3;
+ TMenuItem *Copy4;
+ TMenuItem *DictionaryLookup2;
+ TMenuItem *N3;
+ TMenuItem *EditEntry1;
+ TMenuItem *DeleteEntry1;
+ TMenuItem *LinktoVerse1;
+ TMenuItem *Options2;
+ TMenuItem *Contents1;
+ TComboBox *freeHandLookup;
+ TPanel *Panel2;
+ TSplitter *Splitter3;
+ TRichEdit *DictKeyEditOld;
+ TListBox *lbDictKeysOld;
+ TPopupMenu *PopupMenu4;
+ TMenuItem *HideShowModules1;
+ TMenuItem *DevotionaloftheDay1;
+ TMenuItem *Tools1;
+ TMenuItem *InstallManager1;
+ TMenuItem *SEPERATOR;
+ TApplicationEvents *ApplicationEvents1;
+ TMenuItem *Print1;
+ TMenuItem *N5;
+ TMenuItem *SearchForWord1;
+ TMenuItem *SearchForWord2;
+ TMenuItem *SearchForWord3;
+ void __fastcall TextPageControlChange(TObject *Sender);
+ void __fastcall btnLookupClick(TObject *Sender);
+ void __fastcall CommentaryPageControlChange(TObject *Sender);
+
+
+
+ void __fastcall DictKeyEditOldChange(TObject *Sender);
+ void __fastcall LexDictPageControlChange(TObject *Sender);
+ void __fastcall NewSearchWindow1Click(TObject *Sender);
+
+ void __fastcall Exit1Click(TObject *Sender);
+ void __fastcall About1Click(TObject *Sender);
+ void __fastcall DictionaryLookup1Click(TObject *Sender);
+ void __fastcall SaveLayout1Click(TObject *Sender);
+
+
+ void __fastcall FormShow(TObject *Sender);
+
+ void __fastcall LookupPokeData(TObject *Sender);
+
+ void __fastcall SearchPokeData(TObject *Sender);
+ void __fastcall UpDown3Click(TObject *Sender, TUDBtnType Button);
+ void __fastcall UpDown1Click(TObject *Sender, TUDBtnType Button);
+
+
+ void __fastcall BackbtnClick(TObject *Sender);
+ void __fastcall Button1Click(TObject *Sender);
+ void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender);
+ void __fastcall Copy1Click(TObject *Sender);
+
+
+
+ void __fastcall AddBookmark1Click(TObject *Sender);
+ void __fastcall BookmarkItemClick(TObject *Sender);
+ void __fastcall BookmarkbtnClick(TObject *Sender);
+ void __fastcall EditBookmarks1Click(TObject *Sender);
+
+ void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
+ void __fastcall Options1Click(TObject *Sender);
+ void __fastcall cbBookChange(TObject *Sender);
+
+ void __fastcall FormCreate(TObject *Sender);
+ void __fastcall PopupMenuPopup(TObject *Sender);
+ void __fastcall createVerseList(TObject *Sender);
+ void __fastcall freeHandLookupoldKeyPress(TObject *Sender, char &Key);
+ void __fastcall RTFMouseDown(TObject *Sender, TMouseButton Button,
+ TShiftState Shift, int X, int Y);
+ void __fastcall RTFURLClick(TObject *Sender, const AnsiString URLText, TMouseButton Button);
+ void __fastcall EditEntry1Click(TObject *Sender);
+ void __fastcall DeleteEntry1Click(TObject *Sender);
+ void __fastcall LinktoVerse1Click(TObject *Sender);
+ void __fastcall BookTOCChange(TObject* Sender, TTreeNode* Node);
+
+ void __fastcall GlobalOptionChange(TObject *Sender);
+
+
+ void __fastcall OptionShowVals(TObject *Sender);
+ void __fastcall Contents1Click(TObject *Sender);
+ void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
+ void __fastcall lbDictKeysOldClick(TObject *Sender);
+ void __fastcall verseLookupClick(TObject *Sender);
+ void __fastcall HideShowModules1Click(TObject *Sender);
+ void __fastcall DevotionaloftheDay1Click(TObject *Sender);
+ void __fastcall CppWebBrowser1BeforeNavigate2(TObject *Sender,
+ LPDISPATCH pDisp, TVariant *URL, TVariant *Flags,
+ TVariant *TargetFrameName, TVariant *PostData, TVariant *Headers,
+ TOLEBOOL *Cancel);
+ void __fastcall InstallManager1Click(TObject *Sender);
+ void __fastcall ApplicationEvents1Hint(TObject *Sender);
+ void __fastcall ApplicationEvents1ShowHint(AnsiString &HintStr,
+ bool &CanShow, THintInfo &HintInfo);
+ void __fastcall Print1Click(TObject *Sender);
+ void __fastcall SearchForWord1Click(TObject *Sender);
+private: // User declarations
+ list <SWDisplay *> displays; // so we can delete each display we create
+ list <ModState *> modstates;
+ vector <ModState *> ctrlstates;
+ bool logmodstate;
+ bool freshdict;
+ String clickText;
+
+ char CreateTextPane(SWModule *mod, char *font = 0);
+ char CreateCommentPane(SWModule *mod, char *font = 0);
+ char CreateLDPane(SWModule *mod, char *font = 0);
+ char CreateBookPane(SWModule *mod, char *font = 0);
+ void PushState();
+ void BackState();
+ void ForwardState();
+ void AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree);
+ void FillDictKeys();
+ void AddVerseChoices(TPopupMenu *menu, const char *buf, TRxRichEdit *rtf);
+ void fillVKeySelector(VerseKey *vk);
+ static bool hasFeature(SWMgr *mgr, const char *modName, const char *feature);
+ void NavigateVerseURL(char* verStr);
+ void RefRTFHeaders();
+
+public: // User declarations
+ TTntListBox *lbDictKeys;
+ TTntEdit *DictKeyEdit;
+ VerseKey *DefaultVSKey;
+ SWKey *DefaultStrKey;
+ BibleCSMGR *mainmgr;
+ SWConfig *layoutconf;
+ SWConfig *optionsconf;
+ SWDispRTF *currentRTF;
+ __fastcall TForm1(TComponent* Owner);
+ __fastcall ~TForm1();
+ void __fastcall DisplayHint(TObject* Sender);
+ void RefreshActiveSheet(TPageControl *ts);
+ void TextKeyChanged(); // updates dependents on TextKeyChanged
+ void RefreshBookmarksMenu(TMenu *menu, TTreeView *tree);
+ void RestoreState(ModState *state);
+ void i12ize(const char *lang);
+ static WideString TrimJunk(WideString src);
+ void __fastcall AppMessage(tagMSG &Msg, bool &Handled);
+ static void ClipOrCenterRectToMonitor(LPRECT prc, UINT flags);
+ static void ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags);
+ ListKey tmpVerseList;
+ String tmpVerseListCaption;
+ bool renderingHint;
+ bool closing;
+};
+
+class TRTFHintWindow : public THintWindow {
+ typedef THintWindow inherited;
+
+protected:
+ virtual void __fastcall Paint(void);
+ virtual void __fastcall CreateParams(TCreateParams &Params);
+
+public:
+ __fastcall virtual TRTFHintWindow(Classes::TComponent* AOwner);
+ __fastcall TRTFHintWindow(HWND ParentWindow) : THintWindow(ParentWindow) { }
+ __fastcall virtual ~TRTFHintWindow(void);
+ virtual void __fastcall ActivateHint(const /*Windows::*/TRect& Rect, const AnsiString AHint);
+ virtual void __fastcall ActivateHintData(const /*Windows::*/TRect& Rect, const AnsiString AHint, void* AData);
+ virtual /*Windows::*/TRect __fastcall CalcHintRect(int MaxWidth, const AnsiString AHint, void* AData);
+ virtual bool __fastcall IsHintMsg(tagMSG& Msg);
+
+ __property BiDiMode ;
+ __property Caption ;
+ __property Color ;
+ __property Canvas ;
+ __property Font ;
+
+};
+
+
+//---------------------------------------------------------------------------
+extern TForm1 *Form1;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp
new file mode 100644
index 0000000..5cff2a7
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp
@@ -0,0 +1,644 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include <localemgr.h>
+#include <list>
+#include <string>
+#include <dirent.h>
+#include <io.h>
+#include <dir.h>
+#include "TModuleFonts.h"
+#include "optionfrm.h"
+#include "mainfrm.h"
+
+
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TOptionsfrm *Optionsfrm;
+
+const char *TOptionsfrm::defaultLocaleName = "en_us";
+const char *TOptionsfrm::defaultLocaleDescription = "English (US)";
+//---------------------------------------------------------------------------
+__fastcall TOptionsfrm::TOptionsfrm(TComponent* Owner)
+ : TForm(Owner)
+{
+ FontDialogText = new TFontSelFrm(this);
+ FontDialogComment = new TFontSelFrm(this);
+ FontDialogLD = new TFontSelFrm(this);
+ FontDialogPopup = new TFontSelFrm(this);
+}
+//---------------------------------------------------------------------------
+void __fastcall TOptionsfrm::btnCurrVerseClick(TObject *Sender)
+{
+ ColorDialogVS->Execute();
+ shpCurrVSClr->Brush->Color = ColorDialogVS->Color;
+ UpdatePreview();
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TOptionsfrm::FormCreate(TObject *Sender)
+{
+ list<string> locales;
+
+ localeCB->Clear();
+ localeCB->Items->AddObject(defaultLocaleDescription, (TObject *)defaultLocaleName);
+
+ locales = LocaleMgr::systemLocaleMgr.getAvailableLocales();
+
+ for (list<string>::iterator it = locales.begin(); it != locales.end(); it++) {
+ const char *name = LocaleMgr::systemLocaleMgr.getLocale(it->c_str())->getName();
+ const char *description = LocaleMgr::systemLocaleMgr.getLocale(it->c_str())->getDescription();
+ localeCB->Items->AddObject(description, (TObject *)name);
+ }
+ localeCB->ItemIndex = 0;
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TOptionsfrm::FormShow(TObject *Sender)
+{
+ PageControl1->ActivePage = TabSheet1;
+ FindSchemeNames();
+ cmbTextSelect->ItemIndex = 0;
+ UpdatePreview();
+}
+
+
+
+void __fastcall TOptionsfrm::btnFontClick(TObject *Sender)
+{
+
+ TFontSelFrm* tempFrm = new TFontSelFrm(this);
+ switch (cmbTextSelect->ItemIndex)
+ {
+ case 0:
+ CopyFontDlg(tempFrm, FontDialogText);
+ if(FontDialogText->ShowModal() == mrOk){
+ CopyFontDlg(FontDialogComment, FontDialogText);
+ CopyFontDlg(FontDialogLD, FontDialogText);
+ CopyFontDlg(FontDialogPopup, FontDialogText);
+ UpdatePreview();
+ }else CopyFontDlg(FontDialogText, tempFrm);
+ break;
+ case 1:
+ CopyFontDlg(tempFrm, FontDialogText);
+ if(FontDialogText->ShowModal() == mrOk)
+ UpdatePreview();
+ else CopyFontDlg(FontDialogText, tempFrm);
+ break;
+ case 2:
+ CopyFontDlg(tempFrm, FontDialogComment);
+ if(FontDialogComment->ShowModal() == mrOk)
+ UpdatePreview();
+ else CopyFontDlg(FontDialogComment, tempFrm);
+ break;
+ case 3:
+ CopyFontDlg(tempFrm, FontDialogLD);
+ if(FontDialogLD->ShowModal() == mrOk)
+ UpdatePreview();
+ else CopyFontDlg(FontDialogLD, tempFrm);
+ break;
+ case 4:
+ CopyFontDlg(tempFrm, FontDialogPopup);
+ if(FontDialogPopup->ShowModal() == mrOk)
+ UpdatePreview();
+ else CopyFontDlg(FontDialogPopup, tempFrm);
+ break;
+ }
+ delete tempFrm;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TOptionsfrm::shpCurrVSClrMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{
+ btnCurrVerseClick(Sender);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TOptionsfrm::btnNumClrClick(TObject *Sender)
+{
+ ColorDialogVerseNum->Execute();
+ shpNumClr->Brush->Color = ColorDialogVerseNum->Color;
+ UpdatePreview();
+
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TOptionsfrm::btnFieldClrClick(TObject *Sender)
+{
+ ColorDialogField->Execute();
+ shpFieldClr->Brush->Color = ColorDialogField->Color;
+ UpdatePreview();
+}
+//---------------------------------------------------------------------------
+
+// TODO 2 -cOptions: add new category, Search Results
+void __fastcall TOptionsfrm::cmbTextSelectChange(TObject *Sender)
+{
+ UpdatePreview();
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TOptionsfrm::cmbSchemeSelectChange(TObject *Sender)
+{
+ AnsiString tempName = ExtractFilePath(Application->ExeName) + COLOR_DIR + cmbSchemeSelect->Text + COLOR_EXT;
+ SWConfig schemesconf(tempName.c_str());
+ LoadDispSettings(&schemesconf);
+ UpdatePreview();
+}
+//---------------------------------------------------------------------------
+
+// TODO 1 -cOptions: Change to use RxRichEditX somehow, so we're consistent with look and feel of real control
+void TOptionsfrm::UpdatePreview()
+{
+ char buffTemp[512], buffFinal[512], font[64];
+ char* verse = "Why, my beloved brothers, let every man be swift to hear, slow to speak, slow to wrath";
+ int vsColorRed, vsColorGreen, vsColorBlue, numColorRed, numColorGreen, numColorBlue;
+ int fontSize;
+ TMemoryStream * RTFStream = new TMemoryStream;
+
+ strcpy(buffFinal, "{\\rtf1\\ansi");
+
+ switch (cmbTextSelect->ItemIndex)
+ {
+ case 2:
+ TRxRichEditX::TColorToRGB(FontDialogComment->Font->Color, vsColorRed, vsColorGreen, vsColorBlue);
+ TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue);
+ strcpy(font, FontDialogComment->Font->Name.c_str());
+ fontSize = FontDialogComment->Font->Size;
+ RTFPreview->Color = FontDialogComment->BackColor;
+ break;
+ case 3:
+ TRxRichEditX::TColorToRGB(FontDialogLD->Font->Color, vsColorRed, vsColorGreen, vsColorBlue);
+ TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue);
+ strcpy(font, FontDialogLD->Font->Name.c_str());
+ fontSize = FontDialogLD->Font->Size;
+ RTFPreview->Color = FontDialogLD->BackColor;
+ break;
+ default:
+ TRxRichEditX::TColorToRGB(FontDialogText->Font->Color, vsColorRed, vsColorGreen, vsColorBlue);
+ TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue);
+ strcpy(font, FontDialogText->Font->Name.c_str());
+ fontSize = FontDialogText->Font->Size;
+ RTFPreview->Color = FontDialogText->BackColor;
+ }
+
+ // This is a strange way to deal with font size but I can't think of a different way to do it.
+ // So for now I will use the current system.
+ fontSize -= 12;
+ sprintf(buffTemp, "{\\fonttbl{\\f0\\fdecor\\fprq2 %s;}}" , font);
+ strcat(buffFinal, buffTemp);
+ sprintf(buffTemp, "{\\colortbl;\\red%d\\green%d\\blue%d;\\red%d\\green%d\\blue%d;}" , vsColorRed, vsColorGreen, vsColorBlue, numColorRed, numColorGreen, numColorBlue);
+ strcat(buffFinal, buffTemp);
+
+ sprintf(buffTemp, "\\pard \\qc\\nowidctlpar{\\f1\\fs%d\\cf1\\b Chapter 1 ", (30 + fontSize));
+ strcat(buffFinal, buffTemp);
+ sprintf(buffTemp, "\\par\\fs%d\\par}", (10 + fontSize));
+ strcat(buffFinal, buffTemp);
+
+ sprintf(buffTemp, "{\\fs%d\\cf2\\super 19}", (10 + fontSize));
+ strcat(buffFinal, buffTemp);
+
+ sprintf(buffTemp, "\\ql\\nowidctlpar \\cf1\\f0\\fs%d ", (24 + fontSize));
+ strcat(buffFinal, buffTemp);
+ strcat(buffFinal, verse);
+
+ strcat(buffFinal, " }");
+
+ RTFStream->WriteBuffer(buffFinal, 512);
+ RTFStream->Position = 0;
+ RTFPreview->Lines->LoadFromStream(RTFStream);
+ GetCurrentScheme();
+}
+
+TOptionsfrm::CopyFontDlg(TFontSelFrm* lhs, const TFontSelFrm* rhs)
+{
+ lhs->BackColor = rhs->BackColor;
+ lhs->Font->Color = rhs->Font->Color;
+ lhs->Font->Size = rhs->Font->Size;
+ lhs->Font->Name = rhs->Font->Name;
+}
+
+void __fastcall TOptionsfrm::btnSaveScheme(TObject *Sender)
+{
+ TPoint menup, point;
+ point.x = 0;
+ point.y = btnSave->Height;
+ menup = btnSave->ClientToScreen(point);
+ SavePopup->Popup(menup.x, menup.y);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TOptionsfrm::SaveSchemeClick(TObject *Sender)
+{
+
+ ConfigEntMap emap;
+ AnsiString strName = cmbSchemeSelect->Text;
+ if(strName != "" && !strName.Pos("/") && !strName.Pos("\\")
+ && !strName.Pos(":") && !strName.Pos("*")
+ && !strName.Pos("?") && !strName.Pos("\"")
+ && !strName.Pos("<") && !strName.Pos(">")
+ && !strName.Pos("|")) {
+
+ AnsiString strName = COLOR_DIR + cmbSchemeSelect->Text + COLOR_EXT;
+ SWConfig schemeconf(strName.c_str());
+
+ emap = schemeconf.Sections["Appearance"];
+ emap.erase("AutoVSColor"); emap.insert(ConfigEntMap::value_type("AutoVSColor", IntToStr((AutoVSColor->Checked)?1:0).c_str()));
+ emap.erase("CurrentVSColor"); emap.insert(ConfigEntMap::value_type("CurrentVSColor", IntToStr(shpCurrVSClr->Brush->Color).c_str()));
+ emap.erase("VSNumberColor"); emap.insert(ConfigEntMap::value_type("VSNumberColor", IntToStr(ColorDialogVerseNum->Color).c_str()));
+ emap.erase("FieldColor"); emap.insert(ConfigEntMap::value_type("FieldColor", IntToStr(ColorDialogField->Color).c_str()));
+ emap.erase("StrongsColor"); emap.insert(ConfigEntMap::value_type("StrongsColor", IntToStr(ColorDialogStrongs->Color).c_str()));
+ emap.erase("MorphColor"); emap.insert(ConfigEntMap::value_type("MorphColor", IntToStr(ColorDialogMorph->Color).c_str()));
+
+ emap.erase("TextBackColor"); emap.insert(ConfigEntMap::value_type("TextBackColor", IntToStr(FontDialogText->BackColor).c_str()));
+ emap.erase("CommentBackColor"); emap.insert(ConfigEntMap::value_type("CommentBackColor", IntToStr(FontDialogComment->BackColor).c_str()));
+ emap.erase("LDBackColor"); emap.insert(ConfigEntMap::value_type("LDBackColor", IntToStr(FontDialogLD->BackColor).c_str()));
+ emap.erase("PopupBackColor"); emap.insert(ConfigEntMap::value_type("PopupBackColor", IntToStr(FontDialogPopup->BackColor).c_str()));
+
+ emap.erase("TextFontName"); emap.insert(ConfigEntMap::value_type("TextFontName", (FontDialogText->Font->Name).c_str()));
+ emap.erase("CommentFontName"); emap.insert(ConfigEntMap::value_type("CommentFontName", (FontDialogComment->Font->Name).c_str()));
+ emap.erase("LDFontName"); emap.insert(ConfigEntMap::value_type("LDFontName", (FontDialogLD->Font->Name).c_str()));
+ emap.erase("PopupFontName"); emap.insert(ConfigEntMap::value_type("PopupFontName", (FontDialogPopup->Font->Name).c_str()));
+
+ emap.erase("TextFontSize"); emap.insert(ConfigEntMap::value_type("TextFontSize", IntToStr(FontDialogText->Font->Size).c_str()));
+ emap.erase("CommentFontSize"); emap.insert(ConfigEntMap::value_type("CommentFontSize", IntToStr(FontDialogComment->Font->Size).c_str()));
+ emap.erase("LDFontSize"); emap.insert(ConfigEntMap::value_type("LDFontSize", IntToStr(FontDialogLD->Font->Size).c_str()));
+ emap.erase("PopupFontSize"); emap.insert(ConfigEntMap::value_type("PopupFontSize", IntToStr(FontDialogPopup->Font->Size).c_str()));
+
+ emap.erase("TextFontColor"); emap.insert(ConfigEntMap::value_type("TextFontColor", IntToStr(FontDialogText->Font->Color).c_str()));
+ emap.erase("CommentFontColor"); emap.insert(ConfigEntMap::value_type("CommentFontColor", IntToStr(FontDialogComment->Font->Color).c_str()));
+ emap.erase("LDFontColor"); emap.insert(ConfigEntMap::value_type("LDFontColor", IntToStr(FontDialogLD->Font->Color).c_str()));
+ emap.erase("PopupFontColor"); emap.insert(ConfigEntMap::value_type("PopupFontColor", IntToStr(FontDialogPopup->Font->Color).c_str()));
+
+ schemeconf.Sections["Appearance"] = emap;
+ schemeconf.Save();
+ }else{
+ Application->MessageBox("Scheme name missing or invalid.","Oops", MB_OK);
+ }
+ SetCurrentDir(ExtractFilePath(Application->ExeName));
+ FindSchemeNames();
+}
+//---------------------------------------------------------------------------
+
+
+void TOptionsfrm::FindSchemeNames()
+{
+ DIR *dir;
+ struct dirent *ent;
+ string conffile;
+ AnsiString strName;
+ AnsiString strPath = COLOR_DIR;
+
+ TStringList *schemeNames = new TStringList;
+ cmbSchemeSelect->Clear();
+
+ if (access(strPath.c_str(), 0)) { // directory does not exist
+ _mkdir(strPath.c_str());
+ }
+
+ if (dir = opendir(strPath.c_str())) {
+ rewinddir(dir);
+ while ((ent = readdir(dir))) {
+ if ((strcmp(ent->d_name, "."))&& (strcmp(ent->d_name, "..")) && !strcmp(ExtractFileExt(ent->d_name).c_str(), COLOR_EXT.c_str())) {
+ strName = ent->d_name;
+ schemeNames->Add(strName.SubString(1, strName.Length() - 4).c_str());
+ }
+ }
+ closedir(dir);
+ cmbSchemeSelect->Items = schemeNames;
+ }
+ delete schemeNames;
+}
+
+void __fastcall TOptionsfrm::ExportClick(TObject *Sender)
+{
+ AnsiString name = cmbSchemeSelect->Text;
+ AnsiString newFileName;
+ AnsiString exName;
+ AnsiString subdir = ExtractFilePath(Application->ExeName) + COLOR_DIR;
+ if(name != ""){
+ SaveSchDlg->FileName = name;
+ if(SaveSchDlg->Execute()){
+ exName = subdir + name + COLOR_EXT;
+ newFileName = SaveSchDlg->FileName.c_str();
+ if(!CopyFileA(exName.c_str(), newFileName.c_str(),1))
+ Application->MessageBox("Export Failed." , "Oops", MB_OK);
+ }
+ }else{
+ Application->MessageBox("No Scheme Selected to Export. Please Select a Scheme and Retry" , "Oops", MB_OK);
+ }
+ SetCurrentDir(ExtractFilePath(Application->ExeName));
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TOptionsfrm::ImportClick(TObject *Sender)
+{
+ AnsiString newFileName;
+ AnsiString exName, newPath;
+ AnsiString subdir = ExtractFilePath(Application->ExeName) + COLOR_DIR;
+ if(OpenSchDlg->Execute()){
+ exName = OpenSchDlg->FileName.c_str();
+ newFileName = ExtractFileName(exName);
+ newPath = subdir + newFileName;
+ if(!CopyFileA(exName.c_str(), newPath.c_str(),1))
+ MessageBox(this, "Import Failed." , "Oops", MB_OK);
+ }
+ SetCurrentDir(ExtractFilePath(Application->ExeName));
+ FindSchemeNames();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TOptionsfrm::DeleteClick(TObject *Sender)
+{
+ AnsiString name = cmbSchemeSelect->Text;
+ AnsiString fullName = ExtractFilePath(Application->ExeName) + COLOR_DIR + name + COLOR_EXT;
+ if(name != ""){
+ DeleteFile(fullName);
+ }else{
+ Application->MessageBox("No Scheme Selected to Delete. Please Select a Scheme and Retry" , "Oops", MB_OK);
+ }
+ SetCurrentDir(ExtractFilePath(Application->ExeName));
+ FindSchemeNames();
+}
+//---------------------------------------------------------------------------
+
+
+void TOptionsfrm::GetCurrentScheme()
+{
+
+ AnsiString tempName;
+ SWConfig *schemesconf;
+ SectionMap::iterator sit, oit;
+
+ SWConfig *optionsconf = dynamic_cast<TForm1*>(Application->MainForm)->optionsconf;
+ for(int count = 0; count < cmbSchemeSelect->Items->Count; count++)
+ {
+ tempName = ExtractFilePath(Application->ExeName) + COLOR_DIR + cmbSchemeSelect->Items->Strings[count] + COLOR_EXT;
+ schemesconf = new SWConfig(tempName.c_str());
+ if( schemesconf->Sections["Appearance"]["CurrentVSColor"] == optionsconf->Sections["Appearance"]["CurrentVSColor"] &&
+ schemesconf->Sections["Appearance"]["VSNumberColor"] == optionsconf->Sections["Appearance"]["VSNumberColor"] &&
+ schemesconf->Sections["Appearance"]["StrongsColor"] == optionsconf->Sections["Appearance"]["StrongsColor"] &&
+ schemesconf->Sections["Appearance"]["MorphColor"] == optionsconf->Sections["Appearance"]["MorphColor"] &&
+ schemesconf->Sections["Appearance"]["FieldColor"] == optionsconf->Sections["Appearance"]["FieldColor"] &&
+
+ schemesconf->Sections["Appearance"]["TextBackColor"] == optionsconf->Sections["Appearance"]["TextBackColor"] &&
+ schemesconf->Sections["Appearance"]["CommentBackColor"] == optionsconf->Sections["Appearance"]["CommentBackColor"] &&
+ schemesconf->Sections["Appearance"]["LDBackColor"] == optionsconf->Sections["Appearance"]["LDBackColor"] &&
+ schemesconf->Sections["Appearance"]["PopupBackColor"] == optionsconf->Sections["Appearance"]["PopupBackColor"] &&
+
+ schemesconf->Sections["Appearance"]["TextFontName"] == optionsconf->Sections["Appearance"]["TextFontName"] &&
+ schemesconf->Sections["Appearance"]["CommentFontName"] == optionsconf->Sections["Appearance"]["CommentFontName"] &&
+ schemesconf->Sections["Appearance"]["LDFontName"] == optionsconf->Sections["Appearance"]["LDFontName"] &&
+ schemesconf->Sections["Appearance"]["PopupFontName"] == optionsconf->Sections["Appearance"]["PopupFontName"] &&
+
+ schemesconf->Sections["Appearance"]["TextFontSize"] == optionsconf->Sections["Appearance"]["TextFontSize"] &&
+ schemesconf->Sections["Appearance"]["CommentFontSize"] == optionsconf->Sections["Appearance"]["CommentFontSize"] &&
+ schemesconf->Sections["Appearance"]["LDFontSize"] == optionsconf->Sections["Appearance"]["LDFontSize"] &&
+ schemesconf->Sections["Appearance"]["PopupFontSize"] == optionsconf->Sections["Appearance"]["PopupFontSize"] &&
+
+ schemesconf->Sections["Appearance"]["TextFontColor"] == optionsconf->Sections["Appearance"]["TextFontColor"] &&
+ schemesconf->Sections["Appearance"]["CommentFontColor"] == optionsconf->Sections["Appearance"]["CommentFontColor"] &&
+ schemesconf->Sections["Appearance"]["LDFontColor"] == optionsconf->Sections["Appearance"]["LDFontColor"] &&
+ schemesconf->Sections["Appearance"]["PopupFontColor"] == optionsconf->Sections["Appearance"]["PopupFontColor"]){ cmbSchemeSelect->ItemIndex = count;
+ count = cmbSchemeSelect->Items->Count; // Basically we are done and can move on :)
+ }
+ delete schemesconf;
+ }
+}
+
+
+
+void __fastcall TOptionsfrm::btnModFontsClick(TObject *Sender)
+{
+ TModuleFonts *pDlg = new TModuleFonts(this);
+ pDlg->ShowModal();
+
+ delete pDlg;
+}
+//---------------------------------------------------------------------------
+
+
+
+// TODO 1 -cOptions: add hint verselist preview toggle
+void __fastcall TOptionsfrm::HintStrongsClick(TObject *Sender)
+{
+ //In order for HintStrongs to work HintPopups has to be on
+ if(HintStrongs->Checked){
+ HintPopups->Checked = true;
+ }
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TOptionsfrm::HintPopupsClick(TObject *Sender)
+{
+ // If we turn off HintPopups we have to turn off HintStrongs
+ // because HintStrongs will not work if hints are off
+ if(!HintPopups->Checked)
+ HintStrongs->Checked = false;
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TOptionsfrm::btnStrongClrClick(TObject *Sender)
+{
+ ColorDialogStrongs->Execute();
+ shpStrongClr->Brush->Color = ColorDialogStrongs->Color;
+ UpdatePreview();
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TOptionsfrm::btnMorphClrClick(TObject *Sender)
+{
+ ColorDialogMorph->Execute();
+ shpMorphClr->Brush->Color = ColorDialogMorph->Color;
+ UpdatePreview();
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TOptionsfrm::shpFieldClrMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{
+ btnFieldClrClick(Sender);
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TOptionsfrm::shpStrongClrMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{
+ btnStrongClrClick(Sender);
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TOptionsfrm::shpMorphClrMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{
+ btnMorphClrClick(Sender);
+}
+//---------------------------------------------------------------------------
+
+
+
+
+void TOptionsfrm::LoadDispSettings(SWConfig* config)
+{
+ SectionMap::iterator sit;
+
+ if ((sit = config->Sections.find("Appearance")) != config->Sections.end()) {
+ if ((*sit).second.find("CurrentVSColor") != (*sit).second.end()){
+ shpCurrVSClr->Brush->Color = TColor(atoi((*(*sit).second.find("CurrentVSColor")).second.c_str()));
+ ColorDialogVS->Color = TColor(atoi((*(*sit).second.find("CurrentVSColor")).second.c_str()));
+ }
+ else {
+ shpCurrVSClr->Brush->Color = TColor(clBlue);
+ ColorDialogVS->Color = TColor(clBlue);
+ }
+ if ((*sit).second.find("AutoVSColor") != (*sit).second.end()) {
+ AutoVSColor->Checked = (atoi((*(*sit).second.find("AutoVSColor")).second.c_str()) == 0) ? false : true;
+ }
+ else {
+ AutoVSColor->Checked = true;
+ }
+
+ if ((*sit).second.find("StrongsColor") != (*sit).second.end()){
+ shpStrongClr->Brush->Color = TColor(atoi((*(*sit).second.find("StrongsColor")).second.c_str()));
+ ColorDialogStrongs->Color = TColor(atoi((*(*sit).second.find("StrongsColor")).second.c_str()));
+ }
+ else{
+ shpStrongClr->Brush->Color = TColor(16711935); // Magenta
+ ColorDialogStrongs->Color = TColor(16711935);
+ }
+
+ if ((*sit).second.find("MorphColor") != (*sit).second.end()){
+ shpMorphClr->Brush->Color = TColor(atoi((*(*sit).second.find("MorphColor")).second.c_str()));
+ ColorDialogMorph->Color = TColor(atoi((*(*sit).second.find("MorphColor")).second.c_str()));
+ }
+ else{
+ shpMorphClr->Brush->Color = TColor(60534); // Light Green
+ ColorDialogMorph->Color = TColor(60534);
+ }
+
+ if ((*sit).second.find("VSNumberColor") != (*sit).second.end()){
+ shpNumClr->Brush->Color = TColor(atoi((*(*sit).second.find("VSNumberColor")).second.c_str()));
+ ColorDialogVerseNum->Color = TColor(atoi((*(*sit).second.find("VSNumberColor")).second.c_str()));
+ }
+ else{
+ shpNumClr->Brush->Color = TColor(clBlue);
+ ColorDialogVerseNum->Color = TColor(clBlue);
+ }
+
+ if ((*sit).second.find("FieldColor") != (*sit).second.end()){
+ shpFieldClr->Brush->Color = TColor(atoi((*(*sit).second.find("FieldColor")).second.c_str()));
+ ColorDialogField->Color = TColor(atoi((*(*sit).second.find("FieldColor")).second.c_str()));
+ }
+ else{
+ shpFieldClr->Brush->Color = TColor(clAqua);
+ ColorDialogField->Color = TColor(clAqua);
+ }
+
+
+ if ((*sit).second.find("VSNumberColor") != (*sit).second.end())
+ ColorDialogVerseNum->Color = TColor(atoi ((*(*sit).second.find("VSNumberColor")).second.c_str()));
+ else
+ ColorDialogVerseNum->Color = clBlue;
+
+ //**** Font BackColor ****//
+ if ((*sit).second.find("TextBackColor") != (*sit).second.end())
+ FontDialogText->BackColor = TColor(atoi((*(*sit).second.find("TextBackColor")).second.c_str()));
+ else
+ FontDialogText->BackColor = TColor(clWhite);
+
+ if ((*sit).second.find("CommentBackColor") != (*sit).second.end())
+ FontDialogComment->BackColor = TColor(atoi((*(*sit).second.find("CommentBackColor")).second.c_str()));
+ else
+ FontDialogComment->BackColor = TColor(clWhite);
+
+ if ((*sit).second.find("LDBackColor") != (*sit).second.end())
+ FontDialogLD->BackColor = TColor(atoi((*(*sit).second.find("LDBackColor")).second.c_str()));
+ else
+ FontDialogLD->BackColor = TColor(clWhite);
+ if ((*sit).second.find("PopupBackColor") != (*sit).second.end())
+ FontDialogPopup->BackColor = TColor(atoi((*(*sit).second.find("PopupBackColor")).second.c_str()));
+ else
+ FontDialogPopup->BackColor = TColor(14680063); // 13434879 == cream color
+
+ //**** Font Face Name ****//
+ if ((*sit).second.find("TextFontName") != (*sit).second.end())
+ FontDialogText->Font->Name = ((*(*sit).second.find("TextFontName")).second.c_str());
+ else
+ FontDialogText->Font->Name = "Times New Roman";
+
+ if ((*sit).second.find("CommentFontName") != (*sit).second.end())
+ FontDialogComment->Font->Name = ((*(*sit).second.find("CommentFontName")).second.c_str());
+ else
+ FontDialogComment->Font->Name = "Times New Roman";
+
+ if ((*sit).second.find("LDFontName") != (*sit).second.end())
+ FontDialogLD->Font->Name = ((*(*sit).second.find("LDFontName")).second.c_str());
+ else
+ FontDialogLD->Font->Name = "Times New Roman";
+ if ((*sit).second.find("PopupFontName") != (*sit).second.end())
+ FontDialogPopup->Font->Name = ((*(*sit).second.find("PopupFontName")).second.c_str());
+ else
+ FontDialogPopup->Font->Name = "Times New Roman";
+
+ //**** Font Size ****//
+ if ((*sit).second.find("TextFontSize") != (*sit).second.end())
+ FontDialogText->Font->Size = (atoi ((*(*sit).second.find("TextFontSize")).second.c_str()));
+ else
+ FontDialogText->Font->Size = 10;
+ if ((*sit).second.find("CommentFontSize") != (*sit).second.end())
+ FontDialogComment->Font->Size = (atoi ((*(*sit).second.find("CommentFontSize")).second.c_str()));
+ else
+ FontDialogComment->Font->Size = 10;
+
+ if ((*sit).second.find("LDFontSize") != (*sit).second.end())
+ FontDialogLD->Font->Size = (atoi ((*(*sit).second.find("LDFontSize")).second.c_str()));
+ else
+ FontDialogLD->Font->Size = 10;
+ if ((*sit).second.find("PopupFontSize") != (*sit).second.end())
+ FontDialogPopup->Font->Size = (atoi ((*(*sit).second.find("PopupFontSize")).second.c_str()));
+ else
+ FontDialogPopup->Font->Size = 10;
+
+ //**** Font ForeColor ****//
+ if ((*sit).second.find("TextFontColor") != (*sit).second.end())
+ FontDialogText->Font->Color = TColor(atoi ((*(*sit).second.find("TextFontColor")).second.c_str()));
+ else
+ FontDialogText->Font->Color = clBlack;
+
+ if ((*sit).second.find("CommentFontColor") != (*sit).second.end())
+ FontDialogComment->Font->Color = TColor(atoi ((*(*sit).second.find("CommentFontColor")).second.c_str()));
+ else
+ FontDialogComment->Font->Color = clBlack;
+
+ if ((*sit).second.find("LDFontColor") != (*sit).second.end())
+ FontDialogLD->Font->Color = TColor(atoi ((*(*sit).second.find("LDFontColor")).second.c_str()));
+ else
+ FontDialogLD->Font->Color = clBlack;
+ if ((*sit).second.find("PopupFontColor") != (*sit).second.end())
+ FontDialogPopup->Font->Color = TColor(atoi ((*(*sit).second.find("PopupFontColor")).second.c_str()));
+ else
+ FontDialogPopup->Font->Color = clBlack;
+ }
+}
+
+
+void __fastcall TOptionsfrm::shpNumClrMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{
+ btnNumClrClick(Sender);
+}
+//---------------------------------------------------------------------------
+
+
diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm b/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm
new file mode 100644
index 0000000..3e5a86e
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm
@@ -0,0 +1,681 @@
+object Optionsfrm: TOptionsfrm
+ Left = 272
+ Top = 126
+ BorderStyle = bsDialog
+ Caption = 'Preferences'
+ ClientHeight = 325
+ ClientWidth = 531
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Icon.Data = {
+ 0000010001002020100000000000E80200001600000028000000200000004000
+ 0000010004000000000080020000000000000000000000000000000000000000
+ 000000008000008000000080800080000000800080008080000080808000C0C0
+ C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF006666
+ 6666666666666666666666666666688888888888888888088888888888866888
+ 8888888888888880888888888886688888888888888888808888888888866888
+ 8008888088008880800080008800688888088880880808808080808088006888
+ 8808888088080880800880888806688888008880080808880080808088066888
+ 8808080080800800080088008000688888080888888888888888888888066888
+ 8000088888888888888888888806688888888888888888880888888888866008
+ 8808880888877777777878888F86088088088808887888877788888888F60880
+ 800888078788888878878888888F6800808080878788888878878888888F6088
+ 808087878788888877788888888F0888088087887788888878888888888F0808
+ 0888788878788887788888F888F600000087778777877777777888FFFF866888
+ 8880888888888888888888888886688888880888888888888888888888866800
+ 8880808800088888888888888886688088808808080888888888888888866880
+ 8880080800888888888888888886688088800008080888888888888888866880
+ 8880880880088888888888888886088080808888888888888888888888860000
+ 0080888888888888888888888886688888808888888888888888888888866888
+ 8888088888888888888888888886666666660666666666666666666666660000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000000000000000000000000000}
+ OldCreateOrder = True
+ Position = poScreenCenter
+ Scaled = False
+ OnCreate = FormCreate
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Panel2: TPanel
+ Left = 0
+ Top = 284
+ Width = 531
+ Height = 41
+ Align = alBottom
+ BevelOuter = bvNone
+ TabOrder = 0
+ object OkBtn: TBitBtn
+ Left = 338
+ Top = 9
+ Width = 89
+ Height = 25
+ Anchors = [akTop, akRight]
+ TabOrder = 0
+ Kind = bkOK
+ end
+ object CancelBtn: TBitBtn
+ Left = 436
+ Top = 9
+ Width = 89
+ Height = 25
+ Anchors = [akTop, akRight]
+ TabOrder = 1
+ Kind = bkCancel
+ end
+ end
+ object PageControl1: TPageControl
+ Left = 0
+ Top = 0
+ Width = 531
+ Height = 284
+ ActivePage = TabSheet3
+ Align = alClient
+ TabOrder = 1
+ object TabSheet1: TTabSheet
+ Caption = 'General'
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 163
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object gbPersonalize: TGroupBox
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 163
+ Align = alClient
+ Caption = 'Personalize'
+ TabOrder = 0
+ object Label4: TLabel
+ Left = 7
+ Top = 79
+ Width = 48
+ Height = 13
+ Caption = 'Language'
+ end
+ object AutoBMPersonal: TCheckBox
+ Left = 7
+ Top = 17
+ Width = 210
+ Height = 14
+ Hint =
+ 'Saves your personal bookmarks when you exit'#13#10'so that you can hav' +
+ 'e them next time you run '#13#10'The Sword Project'
+ Caption = 'Autosave Personal Bookmarks'
+ TabOrder = 0
+ end
+ object AutoBMOther: TCheckBox
+ Left = 7
+ Top = 36
+ Width = 210
+ Height = 14
+ Caption = 'Autosave Other Bookmarks'
+ TabOrder = 1
+ end
+ object HintPopups: TCheckBox
+ Left = 248
+ Top = 36
+ Width = 245
+ Height = 13
+ Hint =
+ 'Shows the hint boxes when you mouseover a'#13#10'panel giving a brief ' +
+ 'description of the current '#13#10'module.'
+ Caption = 'Show Hint Pop-ups'
+ TabOrder = 2
+ OnClick = HintPopupsClick
+ end
+ object localeCB: TComboBox
+ Left = 94
+ Top = 76
+ Width = 207
+ Height = 21
+ Hint =
+ 'Select your localized language'#13#10'This only localizes the book nam' +
+ 'es'#13#10'of the bible not the interface.'
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 3
+ end
+ object AutoLayout: TCheckBox
+ Left = 7
+ Top = 55
+ Width = 210
+ Height = 17
+ Hint = 'Saves the screen layout when the program exits'
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Autosave Screen Layout'
+ TabOrder = 4
+ end
+ object HintStrongs: TCheckBox
+ Left = 248
+ Top = 17
+ Width = 245
+ Height = 17
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Show Hint Over Strongs Numbers'
+ TabOrder = 5
+ OnClick = HintStrongsClick
+ end
+ end
+ end
+ end
+ object TabSheet2: TTabSheet
+ Caption = 'Special Modules'
+ ImageIndex = 1
+ object gbDefModules: TGroupBox
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 105
+ Align = alTop
+ Caption = 'Original Language Support - Default Modules'
+ TabOrder = 0
+ object Label5: TLabel
+ Left = 7
+ Top = 36
+ Width = 29
+ Height = 13
+ Caption = 'Greek'
+ end
+ object Label6: TLabel
+ Left = 7
+ Top = 59
+ Width = 37
+ Height = 13
+ Caption = 'Hebrew'
+ end
+ object Label7: TLabel
+ Left = 75
+ Top = 16
+ Width = 49
+ Height = 13
+ Caption = 'Definitions'
+ end
+ object Label8: TLabel
+ Left = 271
+ Top = 16
+ Width = 35
+ Height = 13
+ Caption = 'Parsing'
+ end
+ object Label10: TLabel
+ Left = 7
+ Top = 81
+ Width = 114
+ Height = 13
+ Caption = 'Strong'#39's Numbered Text'
+ end
+ object hebrewDefCB: TComboBox
+ Left = 75
+ Top = 55
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 0
+ end
+ object greekDefCB: TComboBox
+ Left = 75
+ Top = 33
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 1
+ end
+ object greekParseCB: TComboBox
+ Left = 271
+ Top = 33
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 2
+ end
+ object hebrewParseCB: TComboBox
+ Left = 271
+ Top = 55
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 3
+ end
+ object strongsNumsCB: TComboBox
+ Left = 154
+ Top = 78
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 4
+ end
+ end
+ object gbDevos: TGroupBox
+ Left = 0
+ Top = 105
+ Width = 301
+ Height = 151
+ Align = alLeft
+ Anchors = [akLeft, akTop, akRight, akBottom]
+ Caption = 'Daily Devotionals'
+ TabOrder = 1
+ object Label9: TLabel
+ Left = 8
+ Top = 24
+ Width = 107
+ Height = 21
+ AutoSize = False
+ Caption = 'Default Devotional'
+ end
+ object dailyDefaultCB: TComboBox
+ Left = 115
+ Top = 18
+ Width = 166
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 0
+ end
+ object devSplashCB: TCheckBox
+ Left = 8
+ Top = 48
+ Width = 283
+ Height = 21
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Show Devotional Splash Screen on Startup'
+ TabOrder = 1
+ end
+ object devsAsDictsCB: TCheckBox
+ Left = 8
+ Top = 64
+ Width = 283
+ Height = 22
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Show Devotionals as Dictionaries'
+ TabOrder = 2
+ end
+ end
+ object gbGloss: TGroupBox
+ Left = 305
+ Top = 105
+ Width = 218
+ Height = 151
+ Align = alRight
+ Caption = 'Glossaries'
+ TabOrder = 2
+ object glosAsDictsCB: TCheckBox
+ Left = 9
+ Top = 19
+ Width = 186
+ Height = 13
+ Caption = 'Show Glossaries as Dictionaries'
+ TabOrder = 0
+ end
+ end
+ end
+ object TabSheet3: TTabSheet
+ Caption = 'Display'
+ ImageIndex = 2
+ object Panel3: TPanel
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 256
+ Align = alClient
+ Anchors = [akLeft, akTop, akRight]
+ BevelOuter = bvNone
+ Caption = 'Panel3'
+ TabOrder = 0
+ object gbColors: TGroupBox
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 256
+ Align = alClient
+ Caption = 'Display Colors'
+ TabOrder = 0
+ object Label2: TLabel
+ Left = 7
+ Top = 17
+ Width = 38
+ Height = 13
+ Caption = 'Preview'
+ end
+ object Label3: TLabel
+ Left = 228
+ Top = 10
+ Width = 66
+ Height = 13
+ Caption = 'Window Type'
+ end
+ object Label11: TLabel
+ Left = 228
+ Top = 59
+ Width = 105
+ Height = 13
+ Caption = 'Text Styles and Colors'
+ end
+ object Label13: TLabel
+ Left = 228
+ Top = 87
+ Width = 91
+ Height = 13
+ Caption = 'Entry Number Color'
+ end
+ object shpCurrVSClr: TShape
+ Left = 391
+ Top = 114
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpCurrVSClrMouseDown
+ end
+ object Label14: TLabel
+ Left = 356
+ Top = 10
+ Width = 39
+ Height = 13
+ Caption = 'Scheme'
+ end
+ object Label15: TLabel
+ Left = 228
+ Top = 145
+ Width = 86
+ Height = 13
+ Caption = 'Combo/Edit Fields'
+ end
+ object btnSave: TSpeedButton
+ Left = 491
+ Top = 27
+ Width = 22
+ Height = 22
+ Anchors = [akTop, akRight]
+ Glyph.Data = {
+ 4E010000424D4E01000000000000760000002800000012000000120000000100
+ 040000000000D800000000000000000000001000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF
+ FFFFFF000000FFFFFFFFFFFFFFFFFF000000FFD0000000000000FF000000FF03
+ 300000088030FF000000FF03300000088030FF000000FF03300000088030FF00
+ 0000FF03300000000030FF000000FF03333333333330FF000000FF0330000000
+ 0330FF000000FF03088888888030FF000000FF03088888888030FF000000FF03
+ 088888888030FF000000FF03088888888030FF000000FF03088888888000FF00
+ 0000FF03088888888080FF000000FF00000000000000FF000000FFFFFFFFFFFF
+ FFFFFF000000FFFFFFFFFFFFFFFFFF000000}
+ OnClick = btnSaveScheme
+ end
+ object Label1: TLabel
+ Left = 228
+ Top = 232
+ Width = 142
+ Height = 13
+ Caption = 'Individual Modules (Font Only)'
+ end
+ object Label12: TLabel
+ Left = 228
+ Top = 174
+ Width = 107
+ Height = 13
+ Caption = 'Strong'#39's Numbers <...>'
+ end
+ object Label16: TLabel
+ Left = 228
+ Top = 203
+ Width = 89
+ Height = 13
+ Caption = 'Strong'#39's Tense (...)'
+ end
+ object shpStrongClr: TShape
+ Left = 391
+ Top = 172
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpStrongClrMouseDown
+ end
+ object shpMorphClr: TShape
+ Left = 391
+ Top = 201
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpMorphClrMouseDown
+ end
+ object shpFieldClr: TShape
+ Left = 391
+ Top = 143
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpFieldClrMouseDown
+ end
+ object shpNumClr: TShape
+ Left = 391
+ Top = 85
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpNumClrMouseDown
+ end
+ object btnCurrVerse: TButton
+ Left = 421
+ Top = 111
+ Width = 96
+ Height = 25
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 4
+ OnClick = btnCurrVerseClick
+ end
+ object RTFPreview: TRichEdit
+ Left = 7
+ Top = 38
+ Width = 208
+ Height = 211
+ Anchors = [akLeft, akTop, akBottom]
+ ScrollBars = ssVertical
+ TabOrder = 0
+ WantReturns = False
+ end
+ object cmbTextSelect: TComboBox
+ Left = 228
+ Top = 27
+ Width = 125
+ Height = 21
+ ItemHeight = 13
+ TabOrder = 1
+ OnChange = cmbTextSelectChange
+ Items.Strings = (
+ 'All Windows'
+ 'Bible Window'
+ 'Commentary Window'
+ 'Lexicon/Dictionary Window'
+ 'Pop-Up Windows')
+ end
+ object btnFont: TButton
+ Left = 421
+ Top = 54
+ Width = 96
+ Height = 25
+ Hint =
+ 'Selects the font, the background color, and text color for your ' +
+ 'panels'
+ Anchors = [akTop, akRight]
+ Caption = 'Customize...'
+ TabOrder = 2
+ OnClick = btnFontClick
+ end
+ object AutoVSColor: TCheckBox
+ Left = 228
+ Top = 113
+ Width = 149
+ Height = 18
+ Caption = 'Current Verse Color'
+ TabOrder = 3
+ end
+ object btnNumClr: TButton
+ Left = 421
+ Top = 82
+ Width = 96
+ Height = 25
+ Hint = 'Selects the color of verse numbers'
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 5
+ OnClick = btnNumClrClick
+ end
+ object cmbSchemeSelect: TComboBox
+ Left = 356
+ Top = 27
+ Width = 121
+ Height = 21
+ ItemHeight = 13
+ TabOrder = 6
+ OnChange = cmbSchemeSelectChange
+ Items.Strings = (
+ 'Default'
+ 'Parchment'
+ 'Midnight')
+ end
+ object btnFieldClr: TButton
+ Left = 421
+ Top = 140
+ Width = 96
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 7
+ OnClick = btnFieldClrClick
+ end
+ object btnModFonts: TButton
+ Left = 421
+ Top = 227
+ Width = 96
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = 'Select Font...'
+ TabOrder = 8
+ OnClick = btnModFontsClick
+ end
+ object btnStrongClr: TButton
+ Left = 421
+ Top = 169
+ Width = 96
+ Height = 25
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 9
+ OnClick = btnStrongClrClick
+ end
+ object btnMorphClr: TButton
+ Left = 421
+ Top = 198
+ Width = 96
+ Height = 25
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 10
+ OnClick = btnMorphClrClick
+ end
+ end
+ end
+ end
+ end
+ object ColorDialogVS: TColorDialog
+ Ctl3D = True
+ Color = 3328000
+ Left = 295
+ Top = 65528
+ end
+ object ColorDialogField: TColorDialog
+ Ctl3D = True
+ Left = 323
+ Top = 65528
+ end
+ object ColorDialogVerseNum: TColorDialog
+ Ctl3D = True
+ Left = 348
+ Top = 65528
+ end
+ object SavePopup: TPopupMenu
+ Left = 268
+ Top = 65528
+ object SaveScheme: TMenuItem
+ Caption = '&Save Scheme'
+ OnClick = SaveSchemeClick
+ end
+ object DeleteScheme1: TMenuItem
+ Caption = '&Delete Scheme'
+ OnClick = DeleteClick
+ end
+ object Import: TMenuItem
+ Caption = 'Import Scheme...'
+ OnClick = ImportClick
+ end
+ object Export: TMenuItem
+ Caption = 'E&xport Scheme...'
+ OnClick = ExportClick
+ end
+ end
+ object OpenSchDlg: TOpenDialog
+ DefaultExt = '*.sch'
+ Filter = 'Sword Scheme File (*.sch)|*.sch'
+ Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofEnableSizing]
+ Title = 'Select Scheme File'
+ Left = 220
+ Top = 65528
+ end
+ object SaveSchDlg: TSaveDialog
+ DefaultExt = '.sch'
+ Filter = 'Sword Scheme File (*.sch)|*.sch'
+ Left = 244
+ Top = 65528
+ end
+ object ColorDialogStrongs: TColorDialog
+ Ctl3D = True
+ Left = 376
+ Top = 65528
+ end
+ object ColorDialogMorph: TColorDialog
+ Ctl3D = True
+ Color = clFuchsia
+ CustomColors.Strings = (
+ 'ColorA=FFFFFFFF'
+ 'ColorB=FFFFFFFF'
+ 'ColorC=FFFFFFFF'
+ 'ColorD=FFFFFFFF'
+ 'ColorE=FFFFFFFF'
+ 'ColorF=FFFFFFFF'
+ 'ColorG=FFFFFFFF'
+ 'ColorH=FFFFFFFF'
+ 'ColorI=FFFFFFFF'
+ 'ColorJ=FFFFFFFF'
+ 'ColorK=FFFFFFFF'
+ 'ColorL=FFFFFFFF'
+ 'ColorM=FFFFFFFF'
+ 'ColorN=FFFFFFFF'
+ 'ColorO=FFFFFFFF'
+ 'ColorP=FFFFFFFF')
+ Left = 408
+ Top = 65528
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.h b/apps/windoze/CBuilder5/BibleCS/optionfrm.h
new file mode 100644
index 0000000..5ff30c9
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.h
@@ -0,0 +1,146 @@
+//---------------------------------------------------------------------------
+#ifndef optionfrmH
+#define optionfrmH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ExtCtrls.hpp>
+#include <vcl\Dialogs.hpp>
+#include <ComCtrls.hpp>
+
+#include "FontSel.h"
+#include <Buttons.hpp>
+#include <Menus.hpp>
+
+const AnsiString COLOR_DIR = "colors\\";
+const AnsiString COLOR_EXT = ".sch";
+
+//---------------------------------------------------------------------------
+class TOptionsfrm : public TForm
+{
+__published: // IDE-managed Components
+ TColorDialog *ColorDialogVS;
+ TPanel *Panel2;
+ TPageControl *PageControl1;
+ TTabSheet *TabSheet1;
+ TTabSheet *TabSheet2;
+ TPanel *Panel1;
+ TGroupBox *gbPersonalize;
+ TCheckBox *AutoBMPersonal;
+ TCheckBox *AutoBMOther;
+ TGroupBox *gbDefModules;
+ TComboBox *hebrewDefCB;
+ TComboBox *greekDefCB;
+ TComboBox *greekParseCB;
+ TComboBox *hebrewParseCB;
+ TLabel *Label5;
+ TLabel *Label6;
+ TLabel *Label7;
+ TLabel *Label8;
+ TGroupBox *gbDevos;
+ TLabel *Label9;
+ TComboBox *dailyDefaultCB;
+ TCheckBox *devSplashCB;
+ TCheckBox *devsAsDictsCB;
+ TLabel *Label10;
+ TComboBox *strongsNumsCB;
+ TTabSheet *TabSheet3;
+ TCheckBox *HintPopups;
+ TLabel *Label4;
+ TComboBox *localeCB;
+ TPanel *Panel3;
+ TGroupBox *gbColors;
+ TLabel *Label2;
+ TLabel *Label3;
+ TRichEdit *RTFPreview;
+ TComboBox *cmbTextSelect;
+ TButton *btnFont;
+ TCheckBox *AutoVSColor;
+ TButton *btnCurrVerse;
+ TButton *btnNumClr;
+ TLabel *Label11;
+ TLabel *Label13;
+ TShape *shpCurrVSClr;
+ TLabel *Label14;
+ TComboBox *cmbSchemeSelect;
+ TButton *btnFieldClr;
+ TLabel *Label15;
+ TColorDialog *ColorDialogField;
+ TColorDialog *ColorDialogVerseNum;
+ TPopupMenu *SavePopup;
+ TMenuItem *SaveScheme;
+ TMenuItem *Export;
+ TMenuItem *Import;
+ TSpeedButton *btnSave;
+ TOpenDialog *OpenSchDlg;
+ TSaveDialog *SaveSchDlg;
+ TMenuItem *DeleteScheme1;
+ TCheckBox *AutoLayout;
+ TGroupBox *gbGloss;
+ TCheckBox *glosAsDictsCB;
+ TButton *btnModFonts;
+ TLabel *Label1;
+ TBitBtn *OkBtn;
+ TBitBtn *CancelBtn;
+ TCheckBox *HintStrongs;
+ TLabel *Label12;
+ TLabel *Label16;
+ TShape *shpStrongClr;
+ TButton *btnStrongClr;
+ TShape *shpMorphClr;
+ TButton *btnMorphClr;
+ TShape *shpFieldClr;
+ TColorDialog *ColorDialogStrongs;
+ TColorDialog *ColorDialogMorph;
+ TShape *shpNumClr;
+ void __fastcall btnCurrVerseClick(TObject *Sender);
+ void __fastcall FormCreate(TObject *Sender);
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall btnFontClick(TObject *Sender);
+ void __fastcall shpCurrVSClrMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall btnNumClrClick(TObject *Sender);
+ void __fastcall btnFieldClrClick(TObject *Sender);
+ void __fastcall cmbTextSelectChange(TObject *Sender);
+ void __fastcall cmbSchemeSelectChange(TObject *Sender);
+ void __fastcall btnSaveScheme(TObject *Sender);
+ void __fastcall SaveSchemeClick(TObject *Sender);
+ void __fastcall ExportClick(TObject *Sender);
+ void __fastcall ImportClick(TObject *Sender);
+ void __fastcall DeleteClick(TObject *Sender);
+ void __fastcall btnModFontsClick(TObject *Sender);
+ void __fastcall HintStrongsClick(TObject *Sender);
+ void __fastcall HintPopupsClick(TObject *Sender);
+ void __fastcall btnStrongClrClick(TObject *Sender);
+ void __fastcall btnMorphClrClick(TObject *Sender);
+ void __fastcall shpFieldClrMouseDown(TObject *Sender, TMouseButton Button,
+ TShiftState Shift, int X, int Y);
+ void __fastcall shpStrongClrMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall shpMorphClrMouseDown(TObject *Sender, TMouseButton Button,
+ TShiftState Shift, int X, int Y);
+ void __fastcall shpNumClrMouseDown(TObject *Sender, TMouseButton Button,
+ TShiftState Shift, int X, int Y);
+
+private: // User declarations
+ static const char *defaultLocaleName;
+ static const char *defaultLocaleDescription;
+ CopyFontDlg(TFontSelFrm* lhs, const TFontSelFrm* rhs);
+ void FindSchemeNames();
+ void GetCurrentScheme();
+public:
+ TFontSelFrm* FontDialogText;
+ TFontSelFrm* FontDialogComment;
+ TFontSelFrm* FontDialogLD;
+ TFontSelFrm* FontDialogPopup;
+ void LoadDispSettings(SWConfig* config);
+ void UpdatePreview();
+public: // User declarations
+ __fastcall TOptionsfrm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern TOptionsfrm *Optionsfrm;
+//---------------------------------------------------------------------------
+#endif
+
diff --git a/apps/windoze/CBuilder5/BibleCS/rtfhintfrm.cpp b/apps/windoze/CBuilder5/BibleCS/rtfhintfrm.cpp
new file mode 100644
index 0000000..0fbe311
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/rtfhintfrm.cpp
@@ -0,0 +1,48 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include "rtfhintfrm.h"
+#include <clipbrd.hpp>
+#include <swdisprtf.h>
+#include <swdisprtfchap.h>
+#include "mainfrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+
+TRTFHintForm *RTFHintForm;
+
+
+__fastcall TRTFHintForm::TRTFHintForm(TComponent* Owner)
+ : TForm(Owner)
+{
+ rtfDrawer = new TRxRichEditX(Panel1);
+ rtfDrawer->Parent = Panel1;
+ rtfDrawer->Align = alTop;
+ // I changed this to white because our defual now needs to be white so you can use it for controls like the search window with little extra formatting info.
+ rtfDrawer->Color = 14680063; //TColor(0xB4CDBB);
+ rtfDrawer->BorderStyle = bsNone;
+ rtfDrawer->Text = "yoyo";
+ rtfDrawer->Name = "rtfDrawer";
+ rtfDrawer->Enabled = true;
+ rtfDrawer->Visible = true;
+ rtfDrawer->DoubleBuffered = false;
+ searchListDrawer = new TRxRichEditX(Panel1);
+ searchListDrawer->Parent = Panel1;
+ searchListDrawer->Align = alBottom;
+ searchListDrawer->Color = clWindow; //TColor(0xB4CDBB);
+ searchListDrawer->BorderStyle = bsNone;
+ searchListDrawer->Text = "yoyo";
+ searchListDrawer->Name = "searchListDrawer";
+ searchListDrawer->Enabled = true;
+ searchListDrawer->Visible = true;
+ searchListDrawer->DoubleBuffered = false;
+}
+//---------------------------------------------------------------------------
+void __fastcall TRTFHintForm::Button1Click(TObject *Sender)
+{
+ Clipboard()->Assign(this->GetFormImage());
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
new file mode 100644
index 0000000..f661f7f
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
@@ -0,0 +1,414 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "searchfrm.h"
+#include <listkey.h>
+#include "mainfrm.h"
+#include <regex.h>
+#include "RangeMaintFrm.h"
+#include <unicode.hpp>
+#include <unicodertf.h>
+#include "rtfhintfrm.h"
+#include <localemgr.h>
+
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TsearchForm *searchForm;
+//---------------------------------------------------------------------------
+__fastcall TsearchForm::TsearchForm(TComponent* Owner)
+ : TForm(Owner) {
+ pvrtf = new TRxRichEditX(this);
+
+ pvrtf->Parent = plPreview;
+ pvrtf->Align = alClient;
+ pvrtf->ScrollBars = ssVertical;
+ pvrtf->ReadOnly = true;
+// pvrtf->PopupMenu = PopupMenu2;
+// SearchText = 0;
+// if (!SearchText) {
+ SearchTextOld->Visible = false;
+ SearchText = new TTntComboBox(this);
+ SearchText->Parent = Panel3;
+ SearchText->Align = alClient;
+ SearchText->ParentFont = false;
+ SearchText->Font->Size = 12;
+// }
+
+// mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf)));
+// mod->SetKey(DefaultVSKey);
+// return 0;
+ target = 0;
+}
+//---------------------------------------------------------------------------
+void __fastcall TsearchForm::searchBtnClick(TObject *Sender)
+{
+// ModMap::iterator target;
+ class TWaitCursor {
+ public:
+ TWaitCursor() : oldc(Screen->Cursor) { Screen->Cursor = crHourGlass; }
+ ~TWaitCursor() { Screen->Cursor = oldc; }
+ private:
+ TCursor oldc;
+ } wait; // show hourglass
+
+ if (!SearchText->Text.Length())
+ return;
+
+
+ int index = SearchText->Items->IndexOf(SearchText->Text);
+ SearchText->Items->Insert(0, SearchText->Text);
+
+ if (index >= 0)
+ SearchText->Items->Delete(index+1);
+
+ SearchText->ItemIndex = 0;
+
+ Caption = "";
+
+ if (target) {
+ Caption = _tr("Searching");
+ Caption += (AnsiString)" [ " + (AnsiString)target->Description() + (AnsiString)" (" + (AnsiString)target->Name() + (AnsiString)") ]...";
+ resultsLV->Items->Clear();
+ int searchType;
+ switch (searchTypeGroup->ItemIndex) {
+ case 0: searchType = -2; break;
+ case 1: searchType = -1; break;
+ case 2: searchType = 0; break;
+ }
+ int searchOptions = (caseSensitiveCkBx->Checked) ? 0 : REG_ICASE;
+ SWKey *scope = 0;
+ switch (scopeGroup->ItemIndex) {
+ case 2:
+ if (ComboBox1->ItemIndex < 0)
+ results = VerseKey().ParseVerseList(ComboBox1->Text.c_str(), "", true);
+ else {
+ TCustomRange *rs = (TCustomRange *)ComboBox1->Items->Objects[ComboBox1->ItemIndex];
+ results = VerseKey().ParseVerseList(rs->text.c_str(), "", true);
+ }
+ case 1:
+ if (!results.Count())
+ return;
+ scope = &results; break;
+ }
+
+ searchBtn->Caption = _tr("Halt");
+ searchBtn->OnClick = TerminateSearch;
+ searchThread = new TSearchThread(this, WideStringToUTF8(SearchText->Text).c_str(), searchType, searchOptions, scope);
+ }
+ else Caption = "Error finding target module";
+}
+
+
+void __fastcall TsearchForm::TerminateSearch(TObject *Sender)
+{
+ target->terminateSearch = true;
+}
+
+//---------------------------------------------------------------------------
+void __fastcall TsearchForm::ListBox1DblClick(TObject *Sender)
+{
+ if (!resultsLV->Items->Count) return; // assert items in list view
+
+ TListItem *focused = resultsLV->ItemFocused;
+ if (focused) {
+ int row = focused->Index;
+ if (targetpc == Form1->LexDictPageControl) {
+ Form1->DictKeyEdit->Text = resultsLV->Items->Item[row]->Caption.c_str();
+ }
+ else {
+ *(Form1->DefaultVSKey) = resultsLV->Items->Item[row]->Caption.c_str();
+ Form1->TextKeyChanged();
+ }
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TsearchForm::ListBox1Click(TObject *Sender)
+{
+ if (!resultsLV->Items->Count) return; // assert items in list view
+
+ if (target) {
+ TListItem *focused = resultsLV->ItemFocused;
+ if (focused) {
+ int row = focused->Index;
+ ListKey verse;
+ verse << resultsLV->Items->Item[row]->Caption.c_str();
+ pvrtf->fillWithVerses(target, &verse, true, false);
+ }
+ }
+}
+
+//---------------------------------------------------------------------------
+
+__fastcall TsearchForm::TSearchThread::TSearchThread(TsearchForm *parent, string searchText, int searchType, int searchOptions, SWKey *scope, bool CreateSuspended)
+ : TThread(CreateSuspended)
+{
+ this->parent = parent;
+ this->searchText = searchText;
+ this->searchType = searchType;
+ this->searchOptions = searchOptions;
+ this->scope = scope;
+ Priority = tpNormal;
+ FreeOnTerminate = true;
+}
+
+
+void __fastcall TsearchForm::TSearchThread::updateProgressBar(void) {
+ parent->progressBar->Position = parent->status;
+ parent->progressBar->Repaint();
+}
+
+
+void __fastcall TsearchForm::TSearchThread::updateStatus(void) {
+ Synchronize((TThreadMethod)&updateProgressBar);
+}
+
+
+void TsearchForm::TSearchThread::searchProgressCallback(char status, void *searchThread) {
+ TsearchForm::TSearchThread *thread = (TsearchForm::TSearchThread *)searchThread;
+ thread->parent->status = status;
+ thread->updateStatus();
+}
+
+
+void __fastcall TsearchForm::TSearchThread::FillListBox(void)
+{
+ TListItem *pItem;
+
+ SWKey *savekey = (SWKey *)*(parent->target);
+ for (results = TOP; !results.Error(); results++) {
+ parent->target->SetKey(results);
+ pItem = parent->resultsLV->Items->Add();
+ pItem->Caption = (const char *)results;
+ pItem->SubItems->Add("");
+// pItem->SubItems->Add((*parent->target).second->StripText());
+// pItem = resultsLV->Items->Add(
+ }
+ parent->target->SetKey(*savekey);
+// ListBox1->Items->Pack(); // so Count is set correctly (per helpfile)
+ parent->Caption = ((AnsiString)parent->resultsLV->Items->Count + (AnsiString)" " + (AnsiString)((parent->resultsLV->Items->Count == 1) ? _tr("match") : _tr("matches"))) + (AnsiString)" from [ " + (AnsiString)parent->target->Description() + (AnsiString)" (" + (AnsiString)parent->target->Name() + (AnsiString)") ]";
+ parent->searchBtn->Caption = _tr("Search");
+ parent->searchBtn->OnClick = parent->searchBtnClick;
+}
+
+void __fastcall TsearchForm::TSearchThread::Execute()
+{
+ results = parent->target->Search(searchText.c_str(), searchType, searchOptions, scope, 0, searchProgressCallback, this);
+
+ Synchronize((TThreadMethod)&FillListBox);
+ parent->results = results;
+}
+
+
+
+
+void __fastcall TsearchForm::scopeGroupClick(TObject *Sender) {
+ bool enabled = (scopeGroup->ItemIndex == 2);
+
+ customRangeBtn->Enabled = enabled;
+ ComboBox1->Enabled = enabled;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TsearchForm::customRangeBtnClick(TObject *Sender)
+{
+ RangeMaintForm->ShowModal();
+ populateRanges();
+}
+//---------------------------------------------------------------------------
+
+void TsearchForm::populateRanges() {
+ ConfigEntMap::iterator loop, end;
+ SWConfig config("./options.conf");
+ ComboBox1->Clear();
+ loop = config.Sections["CustomRanges"].begin();
+ end = config.Sections["CustomRanges"].end();
+ while (loop != end) {
+ TCustomRange *rs = new TCustomRange(loop->first.c_str(), loop->second.c_str());
+ ComboBox1->Items->AddObject(rs->name.c_str(), rs);
+ loop++;
+ }
+}
+
+
+void __fastcall TsearchForm::FormShow(TObject *Sender)
+{
+ populateRanges();
+ fillList();
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TsearchForm::resultsLVChange(TObject *Sender, TListItem *Item,
+ TItemChange Change)
+{
+ ListBox1Click(Sender);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TsearchForm::resultsLVCustomDrawItem(TCustomListView *Sender, TListItem *Item, TCustomDrawState State, bool &DefaultDraw) {
+
+ if (target && !Form1->closing) {
+ TRect rect = Item->DisplayRect(drSelectBounds);
+ static UnicodeRTF filter;
+ char buf[255];
+ strcpy(buf, Item->Caption.c_str());
+
+ SWKey *key = *target;
+ if (!SWDYNAMIC_CAST(VerseKey, key))
+ filter.ProcessText(buf, 253, *target, target);
+
+ RTFHintForm->searchListDrawer->fillWithRTFString(target, ((String)" \\b " + buf + " ").c_str());
+ if (resultsLV->Selected == Item) RTFHintForm->searchListDrawer->Color = TColor(0xB4CDBB);
+ Sender->Canvas->Brush->Color = RTFHintForm->searchListDrawer->Color;
+ Sender->Canvas->FillRect(rect);
+
+ rect.Right = resultsLV->Column[0]->Width;
+ RTFHintForm->searchListDrawer->paintTo(Sender->Canvas->Handle, &rect, 0);
+
+ ListKey verse;
+ verse << Item->Caption.c_str();
+ RTFHintForm->searchListDrawer->fillWithVerses(target, &verse, false, false, "Default", true);
+ //set color back in case it got changed in fill*
+ if (resultsLV->Selected == Item) RTFHintForm->searchListDrawer->Color = TColor(0xB4CDBB);
+
+ RTFHintForm->searchListDrawer->SelStart = 3;
+ RTFHintForm->searchListDrawer->SelLength = 1;
+ double textHeight = RTFHintForm->searchListDrawer->SelAttributes->Height;
+ double multiplier = 1.2;
+ textHeight *= multiplier;
+ int textWithMargin = 3 + textHeight;
+ if (resultsLV->StateImages->Height != textWithMargin) {
+ resultsLV->StateImages->Height = textWithMargin;
+ DefaultDraw = false;
+ return;
+ }
+ RTFHintForm->searchListDrawer->SelLength = 0;
+
+ rect = Item->DisplayRect(drSelectBounds);
+ rect.Left = rect.Left + resultsLV->Column[0]->Width;// + 5;
+ RTFHintForm->searchListDrawer->paintTo(Sender->Canvas->Handle, &rect, 0);
+ }
+ DefaultDraw = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TsearchForm::resultsLVInfoTip(TObject *Sender,
+ TListItem *Item, AnsiString &InfoTip)
+{
+ InfoTip = "";
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TsearchForm::Button1Click(TObject *Sender)
+{
+ bool newVisible = !pnlChooseMod->Visible;
+ ChooseModSplitter->Visible = newVisible;
+ pnlChooseMod->Visible = newVisible;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TsearchForm::FormActivate(TObject *Sender)
+{
+ if (!Form1->closing) {
+ Mouse->Capture = 0;
+ if (searchBtn->OnClick != TerminateSearch) {
+ TPageControl *targetpc = Form1->TextPageControl;
+
+ if ((Form1->ActiveControl == Form1->CommentaryPageControl) || (IsChild(Form1->CommentaryPageControl->Handle, Form1->ActiveControl->Handle)))
+ targetpc = Form1->CommentaryPageControl;
+ if ((Form1->ActiveControl == Form1->LexDictPageControl) || (IsChild(Form1->LexDictPageControl->Handle, Form1->ActiveControl->Handle)))
+ targetpc = Form1->LexDictPageControl;
+
+
+ ModMap::iterator it = Form1->mainmgr->Modules.find(targetpc->ActivePage->Caption.c_str());
+ if (it != Form1->mainmgr->Modules.end()) {
+ setTarget(it->second);
+ }
+ SearchText->SetFocus();
+ }
+ }
+}
+
+void TsearchForm::setTarget(SWModule *itarget) {
+ target = itarget;
+ moduleName->Caption = target->Description() + (AnsiString) " (" + target->Name() + ")";
+ RTFHintForm->searchListDrawer->fillWithRTFString(target, "yoyo");
+ SearchText->Font->Name = RTFHintForm->searchListDrawer->dispAttribs.fontName;
+// SearchText->Font->Size = RTFHintForm->searchListDrawer->dispAttribs.fontSize;
+}
+//---------------------------------------------------------------------------
+
+void TsearchForm::fillList()
+{
+ BibleCSMGR *manager;
+ ModMap::iterator mods;
+ TTreeNode *node;
+ string nodeName;
+ manager = Form1->mainmgr;
+
+ modTreeView->Items->Clear();
+
+ if (!manager->configPath)
+ return;
+
+ for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) {
+ for (node = modTreeView->Items->GetFirstNode(); node; node = node->getNextSibling()) {
+ if (!strcmp(node->Text.c_str(), mods->second->Type())) {
+ break;
+ }
+ }
+ if (!node) { // Add Section
+ if (!strncmp(mods->second->Type(), "Bibl", 4)) // If Bibles, put first in list
+ node = modTreeView->Items->AddChildFirst(0, mods->second->Type());
+ else node = modTreeView->Items->AddChild(0, mods->second->Type());
+ }
+ nodeName = "[";
+ nodeName += mods->second->Name();
+ nodeName += "] ";
+ nodeName += mods->second->Description();
+ node = modTreeView->Items->AddChildObject(node, nodeName.c_str(), mods->second->Name());
+
+ }
+ //for (node = modTreeView->Items->GetFirstNode(); node; node = node->getNextSibling())
+ // node->Expand(true);
+ node = modTreeView->Items->GetFirstNode();
+ if (node)
+ node->MakeVisible();
+}
+
+void __fastcall TsearchForm::modTreeViewChange(TObject *Sender, TTreeNode *Node) {
+ BibleCSMGR *manager;
+ ModMap::iterator mods;
+ TTreeNode *node;
+ string nodeName;
+ manager = Form1->mainmgr;
+ TTreeNode* currNode = modTreeView->Selected;
+ AnsiString nodeSubString;
+ AnsiString modName;
+
+ for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) {
+ if (currNode->Text.SubString(2, currNode->Text.Pos("]") - 2) == mods->second->Name()) { // Add Section
+ setTarget(mods->second);
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TsearchForm::Button2Click(TObject *Sender)
+{
+ string helpDir;
+ ConfigEntMap::iterator it = Form1->optionsconf->Sections["Help"].find("Directory");
+ if (it != Form1->optionsconf->Sections["Help"].end())
+ helpDir = (*it).second;
+ else helpDir = ".\\help";
+
+ string helpExe = helpDir + "\\Sword.chm::searchh.html";
+ if ((int)ShellExecute(this->Handle, "open", "hh", helpExe.c_str(), NULL, SW_SHOWNORMAL) < 33) {
+ helpExe = helpDir + "\\searchh.html";
+ ShellExecute(this->Handle, "open", helpExe.c_str(), NULL, NULL, SW_SHOWNORMAL);
+ }
+
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm b/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm
new file mode 100644
index 0000000..c3b607f
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm
@@ -0,0 +1,393 @@
+object searchForm: TsearchForm
+ Left = 332
+ Top = 103
+ Width = 494
+ Height = 474
+ Caption = 'Search...'
+ Color = clBtnFace
+ Constraints.MinHeight = 360
+ Constraints.MinWidth = 360
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Icon.Data = {
+ 0000010001002020100000000000E80200001600000028000000200000004000
+ 0000010004000000000080020000000000000000000000000000000000000000
+ 000000008000008000000080800080000000800080008080000080808000C0C0
+ C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF006666
+ 6666666666666666666666666666688888888888888888088888888888866888
+ 8888888888888880888888888886688888888888888888808888888888866888
+ 8008888088008880800080008800688888088880880808808080808088006888
+ 8808888088080880800880888806688888008880080808880080808088066888
+ 8808080080800800080088008000688888080888888888888888888888066888
+ 8000088888888888888888888806688888888888888888880888888888866008
+ 8808880888877777777878888F86088088088808887888877788888888F60880
+ 800888078788888878878888888F6800808080878788888878878888888F6088
+ 808087878788888877788888888F0888088087887788888878888888888F0808
+ 0888788878788887788888F888F600000087778777877777777888FFFF866888
+ 8880888888888888888888888886688888880888888888888888888888866800
+ 8880808800088888888888888886688088808808080888888888888888866880
+ 8880080800888888888888888886688088800008080888888888888888866880
+ 8880880880088888888888888886088080808888888888888888888888860000
+ 0080888888888888888888888886688888808888888888888888888888866888
+ 8888088888888888888888888886666666660666666666666666666666660000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000000000000000000000000000}
+ OldCreateOrder = True
+ Position = poScreenCenter
+ Scaled = False
+ OnActivate = FormActivate
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object ChooseModSplitter: TSplitter
+ Left = 101
+ Top = 0
+ Width = 5
+ Height = 431
+ Cursor = crHSplit
+ Visible = False
+ end
+ object pnlChooseMod: TPanel
+ Left = 0
+ Top = 0
+ Width = 101
+ Height = 431
+ Align = alLeft
+ TabOrder = 0
+ Visible = False
+ object Panel9: TPanel
+ Left = 1
+ Top = 1
+ Width = 99
+ Height = 24
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object lblChooseModule: TLabel
+ Left = 4
+ Top = 6
+ Width = 74
+ Height = 13
+ Caption = 'Choose Module'
+ end
+ end
+ object modTreeView: TTreeView
+ Left = 1
+ Top = 25
+ Width = 99
+ Height = 405
+ Align = alClient
+ Indent = 19
+ TabOrder = 1
+ OnChange = modTreeViewChange
+ end
+ end
+ object Panel7: TPanel
+ Left = 106
+ Top = 0
+ Width = 380
+ Height = 431
+ Align = alClient
+ BevelOuter = bvNone
+ Caption = 'Panel7'
+ TabOrder = 1
+ object pnlResult: TPanel
+ Left = 0
+ Top = 204
+ Width = 380
+ Height = 227
+ Align = alClient
+ TabOrder = 0
+ object Splitter1: TSplitter
+ Left = 1
+ Top = 108
+ Width = 378
+ Height = 5
+ Cursor = crVSplit
+ Align = alBottom
+ ResizeStyle = rsUpdate
+ end
+ object plPreview: TPanel
+ Left = 1
+ Top = 113
+ Width = 378
+ Height = 113
+ Align = alBottom
+ TabOrder = 0
+ end
+ object resultsLV: TListView
+ Left = 1
+ Top = 1
+ Width = 378
+ Height = 107
+ Hint = 'false'
+ Align = alClient
+ Columns = <
+ item
+ Caption = 'Reference'
+ MinWidth = 175
+ Width = 175
+ end
+ item
+ AutoSize = True
+ Caption = 'Preview...'
+ end>
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ HideSelection = False
+ ReadOnly = True
+ RowSelect = True
+ ParentFont = False
+ ParentShowHint = False
+ ShowHint = True
+ StateImages = searchImageList
+ TabOrder = 1
+ ViewStyle = vsReport
+ OnChange = resultsLVChange
+ OnClick = ListBox1Click
+ OnCustomDrawItem = resultsLVCustomDrawItem
+ OnDblClick = ListBox1DblClick
+ OnInfoTip = resultsLVInfoTip
+ end
+ end
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 380
+ Height = 132
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 1
+ object Panel3: TPanel
+ Left = 0
+ Top = 0
+ Width = 380
+ Height = 33
+ Align = alTop
+ BevelOuter = bvNone
+ Caption = 'Panel3'
+ TabOrder = 0
+ object SearchTextOld: TComboBox
+ Left = 0
+ Top = 2
+ Width = 378
+ Height = 21
+ Anchors = [akLeft, akTop, akRight]
+ ItemHeight = 13
+ TabOrder = 0
+ end
+ end
+ object Panel8: TPanel
+ Left = 0
+ Top = 33
+ Width = 380
+ Height = 29
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 1
+ object moduleName: TLabel
+ Left = 28
+ Top = 0
+ Width = 352
+ Height = 29
+ Align = alClient
+ AutoSize = False
+ Caption = 'moduleName'
+ Layout = tlCenter
+ end
+ object Panel6: TPanel
+ Left = 0
+ Top = 0
+ Width = 28
+ Height = 29
+ Align = alLeft
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Button1: TButton
+ Left = 3
+ Top = 3
+ Width = 22
+ Height = 21
+ Caption = '...'
+ TabOrder = 0
+ OnClick = Button1Click
+ end
+ end
+ end
+ object Panel10: TPanel
+ Left = 0
+ Top = 62
+ Width = 380
+ Height = 70
+ Align = alClient
+ BevelOuter = bvNone
+ TabOrder = 2
+ object searchTypeGroup: TRadioGroup
+ Left = 0
+ Top = 0
+ Width = 164
+ Height = 70
+ Align = alLeft
+ Caption = 'Search Type'
+ ItemIndex = 0
+ Items.Strings = (
+ 'Mult Word'
+ 'Phrase'
+ 'Regular Expression')
+ TabOrder = 0
+ end
+ object searchOptionsGroup: TGroupBox
+ Left = 164
+ Top = 0
+ Width = 132
+ Height = 70
+ Align = alLeft
+ Caption = 'Search Options'
+ TabOrder = 1
+ object caseSensitiveCkBx: TCheckBox
+ Left = 8
+ Top = 16
+ Width = 117
+ Height = 17
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Case Sensitive'
+ TabOrder = 0
+ end
+ end
+ object Panel4: TPanel
+ Left = 298
+ Top = 0
+ Width = 82
+ Height = 70
+ Align = alRight
+ BevelOuter = bvNone
+ TabOrder = 2
+ object searchBtn: TButton
+ Left = 3
+ Top = 5
+ Width = 75
+ Height = 25
+ Caption = 'Search'
+ Default = True
+ TabOrder = 0
+ OnClick = searchBtnClick
+ end
+ object Button2: TButton
+ Left = 3
+ Top = 33
+ Width = 75
+ Height = 25
+ Caption = '&Help'
+ Default = True
+ TabOrder = 1
+ OnClick = Button2Click
+ end
+ end
+ end
+ end
+ object pnlScope: TPanel
+ Left = 0
+ Top = 132
+ Width = 380
+ Height = 72
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 2
+ object Panel2: TPanel
+ Left = 0
+ Top = 0
+ Width = 380
+ Height = 43
+ Align = alClient
+ BevelOuter = bvNone
+ TabOrder = 0
+ object scopeGroup: TRadioGroup
+ Left = 0
+ Top = 0
+ Width = 380
+ Height = 43
+ Align = alClient
+ Caption = 'Scope'
+ Columns = 3
+ ItemIndex = 0
+ Items.Strings = (
+ 'Entire Module'
+ 'Current Results'
+ 'Custom Range')
+ TabOrder = 0
+ OnClick = scopeGroupClick
+ end
+ end
+ object Panel5: TPanel
+ Left = 0
+ Top = 43
+ Width = 380
+ Height = 29
+ Align = alBottom
+ TabOrder = 1
+ object Panel11: TPanel
+ Left = 165
+ Top = 1
+ Width = 214
+ Height = 27
+ Align = alClient
+ BevelOuter = bvNone
+ Caption = 'Panel11'
+ TabOrder = 0
+ object ComboBox1: TComboBox
+ Left = 4
+ Top = 4
+ Width = 206
+ Height = 21
+ Anchors = [akLeft, akTop, akRight]
+ Enabled = False
+ ItemHeight = 13
+ TabOrder = 0
+ end
+ end
+ object Panel12: TPanel
+ Left = 1
+ Top = 1
+ Width = 164
+ Height = 27
+ Align = alLeft
+ BevelOuter = bvNone
+ TabOrder = 1
+ object customRangeBtn: TButton
+ Left = 4
+ Top = 4
+ Width = 153
+ Height = 21
+ Caption = 'Define Custom Range'
+ Enabled = False
+ TabOrder = 0
+ OnClick = customRangeBtnClick
+ end
+ end
+ end
+ end
+ end
+ object progressBar: TProgressBar
+ Left = 0
+ Top = 431
+ Width = 486
+ Height = 16
+ Align = alBottom
+ Min = 0
+ Max = 100
+ Step = 1
+ TabOrder = 2
+ end
+ object searchImageList: TImageList
+ Left = 300
+ Top = 601
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.h b/apps/windoze/CBuilder5/BibleCS/searchfrm.h
new file mode 100644
index 0000000..2b9a8ca
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.h
@@ -0,0 +1,107 @@
+//---------------------------------------------------------------------------
+#ifndef searchH
+#define searchH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ExtCtrls.hpp>
+#include "mainfrm.h"
+#include <swmgr.h>
+#include <ComCtrls.hpp>
+#include <TntStdCtrls.hpp>
+#include "rxricheditx.h"
+#include <ImgList.hpp>
+//---------------------------------------------------------------------------
+class TsearchForm : public TForm {
+ class TSearchThread;
+ friend class TSearchThread;
+__published: // IDE-managed Components
+ TImageList *searchImageList;
+ TPanel *pnlChooseMod;
+ TPanel *Panel7;
+ TProgressBar *progressBar;
+ TPanel *pnlResult;
+ TSplitter *Splitter1;
+ TPanel *plPreview;
+ TListView *resultsLV;
+ TPanel *Panel1;
+ TPanel *Panel3;
+ TComboBox *SearchTextOld;
+ TPanel *pnlScope;
+ TPanel *Panel2;
+ TRadioGroup *scopeGroup;
+ TPanel *Panel5;
+ TPanel *Panel8;
+ TLabel *moduleName;
+ TSplitter *ChooseModSplitter;
+ TPanel *Panel9;
+ TTreeView *modTreeView;
+ TPanel *Panel6;
+ TButton *Button1;
+ TPanel *Panel10;
+ TRadioGroup *searchTypeGroup;
+ TGroupBox *searchOptionsGroup;
+ TCheckBox *caseSensitiveCkBx;
+ TPanel *Panel4;
+ TButton *searchBtn;
+ TPanel *Panel11;
+ TPanel *Panel12;
+ TButton *customRangeBtn;
+ TComboBox *ComboBox1;
+ TLabel *lblChooseModule;
+ TButton *Button2;
+ void __fastcall searchBtnClick(TObject *Sender);
+ void __fastcall TerminateSearch(TObject *Sender);
+ void __fastcall ListBox1DblClick(TObject *Sender);
+ void __fastcall ListBox1Click(TObject *Sender);
+ void __fastcall scopeGroupClick(TObject *Sender);
+ void __fastcall customRangeBtnClick(TObject *Sender);
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall resultsLVChange(TObject *Sender, TListItem *Item,
+ TItemChange Change);
+ void __fastcall resultsLVCustomDrawItem(TCustomListView *Sender,
+ TListItem *Item, TCustomDrawState State, bool &DefaultDraw);
+ void __fastcall resultsLVInfoTip(TObject *Sender, TListItem *Item,
+ AnsiString &InfoTip);
+ void __fastcall Button1Click(TObject *Sender);
+ void __fastcall FormActivate(TObject *Sender);
+ void __fastcall modTreeViewChange(TObject *Sender, TTreeNode *Node);
+ void __fastcall Button2Click(TObject *Sender);
+private: // User declarations
+ class TSearchThread : public TThread {
+ ListKey results;
+ string searchText;
+ int searchType;
+ int searchOptions;
+ SWKey *scope;
+ TsearchForm *parent;
+ protected:
+ void __fastcall Execute();
+ public:
+ __fastcall TSearchThread(TsearchForm *parent, string searchText, int searchType, int searchOptions, SWKey *scope = 0, bool CreateSuspended = false);
+ void __fastcall FillListBox(void);
+ static void searchProgressCallback(char status, void *searchFrm);
+ void __fastcall updateStatus(void);
+ void __fastcall updateProgressBar(void);
+ } *searchThread;
+ TRxRichEditX *pvrtf;
+ ListKey results;
+ void populateRanges();
+public: // User declarations
+ void setTarget(SWModule *target);
+ char status;
+ SWModule *target;
+ TPageControl *targetpc;
+ TTntComboBox *SearchText;
+// AnsiString CapText;
+
+ __fastcall TsearchForm(TComponent* Owner);
+ void fillList();
+};
+//---------------------------------------------------------------------------
+extern TsearchForm *searchForm;
+//---------------------------------------------------------------------------
+#endif
+
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Default.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Default.sch
new file mode 100644
index 0000000..3fe1ff9
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Default.sch
@@ -0,0 +1,20 @@
+[Appearance]
+CommentBackColor=16777215
+CommentFontColor=0
+CommentFontName=Times New Roman
+CommentFontSize=12
+CurrentVSColor=16711680
+FieldColor=16776960
+LDBackColor=16777215
+LDFontColor=0
+LDFontName=Times New Roman
+LDFontSize=12
+TextBackColor=16777215
+TextFontColor=0
+TextFontName=Times New Roman
+TextFontSize=12
+VSNumberColor=16711680
+PopupBackColor=14680063
+PopupFontColor=0
+PopupFontName=Times New Roman
+PopupFontSize=9
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Light Blues.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Light Blues.sch
new file mode 100644
index 0000000..bf26d58
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Light Blues.sch
@@ -0,0 +1,24 @@
+
+[Appearance]
+CommentBackColor=16771797
+CommentFontColor=8388608
+CommentFontName=MS Sans Serif
+CommentFontSize=12
+CurrentVSColor=8388863
+FieldColor=16771797
+LDBackColor=16771797
+LDFontColor=8388608
+LDFontName=MS Sans Serif
+LDFontSize=12
+MorphColor=4227072
+PopupBackColor=16773087
+PopupFontColor=8388608
+PopupFontName=MS Sans Serif
+PopupFontSize=10
+StrongsColor=8388736
+TextBackColor=16771797
+TextFontColor=8388608
+TextFontName=MS Sans Serif
+TextFontSize=12
+VSNumberColor=255
+
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Lighten Up.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Lighten Up.sch
new file mode 100644
index 0000000..657beba
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Lighten Up.sch
@@ -0,0 +1,24 @@
+
+[Appearance]
+CommentBackColor=16777215
+CommentFontColor=8421504
+CommentFontName=MS Serif
+CommentFontSize=12
+CurrentVSColor=0
+FieldColor=12632256
+LDBackColor=16777215
+LDFontColor=8421504
+LDFontName=MS Serif
+LDFontSize=12
+MorphColor=5329233
+PopupBackColor=15461355
+PopupFontColor=6908265
+PopupFontName=Times New Roman
+PopupFontSize=11
+StrongsColor=5329233
+TextBackColor=16777215
+TextFontColor=8421504
+TextFontName=MS Serif
+TextFontSize=12
+VSNumberColor=12632256
+
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Midnight.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Midnight.sch
new file mode 100644
index 0000000..e73c6fb
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Midnight.sch
@@ -0,0 +1,24 @@
+
+[Appearance]
+CommentBackColor=0
+CommentFontColor=65280
+CommentFontName=Arial
+CommentFontSize=14
+CurrentVSColor=65535
+FieldColor=12632256
+LDBackColor=0
+LDFontColor=65280
+LDFontName=Arial
+LDFontSize=14
+MorphColor=16711808
+PopupBackColor=0
+PopupFontColor=65535
+PopupFontName=Arial
+PopupFontSize=10
+StrongsColor=16711935
+TextBackColor=0
+TextFontColor=65280
+TextFontName=Arial
+TextFontSize=14
+VSNumberColor=8454143
+
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Navy Blues.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Navy Blues.sch
new file mode 100644
index 0000000..f8cacbe
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Navy Blues.sch
@@ -0,0 +1,24 @@
+
+[Appearance]
+CommentBackColor=8404992
+CommentFontColor=14408667
+CommentFontName=Tahoma
+CommentFontSize=13
+CurrentVSColor=65535
+FieldColor=12632256
+LDBackColor=8404992
+LDFontColor=14408667
+LDFontName=Tahoma
+LDFontSize=13
+MorphColor=16777215
+PopupBackColor=12632256
+PopupFontColor=8388608
+PopupFontName=Tahoma
+PopupFontSize=11
+StrongsColor=16777215
+TextBackColor=8404992
+TextFontColor=14408667
+TextFontName=Tahoma
+TextFontSize=13
+VSNumberColor=8454143
+
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Parchment.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Parchment.sch
new file mode 100644
index 0000000..88b69be
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Parchment.sch
@@ -0,0 +1,24 @@
+
+[Appearance]
+CommentBackColor=13434879
+CommentFontColor=0
+CommentFontName=Arial
+CommentFontSize=10
+CurrentVSColor=4227327
+FieldColor=16777215
+LDBackColor=13434879
+LDFontColor=0
+LDFontName=Arial
+LDFontSize=10
+MorphColor=25025
+PopupBackColor=14680063
+PopupFontColor=0
+PopupFontName=Arial
+PopupFontSize=9
+StrongsColor=16512
+TextBackColor=13434879
+TextFontColor=0
+TextFontName=Arial
+TextFontSize=10
+VSNumberColor=4227327
+
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/de.conf b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/de.conf
new file mode 100644
index 0000000..722e88d
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/de.conf
@@ -0,0 +1,180 @@
+[Meta]
+Name=de
+Description=German
+Translator=Christian Renz <crenz@web42.com>
+
+[Text]
+BackBtnImage=uilocales.d/de_back.bmp
+SearchBtnImage=uilocales.d/de_search.bmp
+&About=&Über SWORD...
+About The SWORD Project=Über das SWORD Projekt
+&Add=&Hinzufügen
+&Add Bookmark=Lesezeichen &hinzufügen
+Add New Bookmark File=Neue Lesezeichendatei hinzufügen
+Bookmark Section Title:=Name für diese Gruppe von Lesezeichen:
+Bookmark=Lesezeichen
+Bookmarks=Lesezeichen
+Cancel=Abbrechen
+Case Sensitive=Groß-/Kleinschreibung
+Chapter=Kapitel
+Check Modules To Show As Tabs=Anzuzeigende Module ankreuzen
+Combo/Edit Fields=Kombo-/Eingabefelder
+Contents=&Inhalt
+&Copy=&Kopieren
+Copy as &B-Greek Transliteration=Als &B-Greek-Umschrift kopieren
+&Close=&Schließen
+Create a New Verse List Window=Neues Verslistenfenster &öffnen
+Create Verse List=Neue Versliste erstellen
+Current Verse Color=Aktuelle Versfarbe
+Daily Devotionals=Tageslese
+Default Devotional=Standard-Tagelese
+Define Custom Range=Eigenen Bereich festlegen
+Definitions=Definitionen
+&Delete Entry=Eintrag l&öschen
+Description=Beschreibung
+Devotion for Today=Tageslese für heute
+Devotional of the Day=&Tageslese
+Dictionary Lookup=Im Wörterbuch nachschlagen
+Display Colors=Anzeigefarben
+Display=Anzeige
+&Edit=&Bearbeiten
+&Edit Bookmarks / Tree View...=Lesezeichen &bearbeiten / Baumdarstellung...
+Edit Entry=Eintrag bearbeiten
+&Edit Entry=Eintrag &bearbeiten
+"Entire Module","Current Results","Custom Range"="Ganzes Module","Aktuelle Ergebnisse","Eigener Bereich"
+E&xit=&Beenden
+eg. mat-jo;rev4=z.B. mat-jo;rev4
+&File=&Datei
+File Name (without extension):=Dateiname (ohne Endung)
+Font Size:=Schriftgröße
+Found New Module...=Neues Modul gefunden...
+General=Allgemein
+Greek=Griechisch
+Hebrew=Hebräisch
+&Help=&Hilfe
+Hide / Show Modules=Module anzeigen/verstecken
+Individual Modules (Font Only)=Einzelne Module (nur Schriftart)
+Install Manager=&Installationsprogramm
+Language=Sprache
+Link to Comment for Verse...=Mit anderem Vers &verknüpfen
+Maintain Custom Ranges=Eigene Bereiche verwalten
+Module Type=Modulart
+Module=Modul
+"Mult Word","Phrase","Regular Expression"="Mehrere Worte","Ausdruck","Regulärer Ausdruck"
+&New Search Window=&Neues Suchfenster...
+OK=OK
+OkBtn=OK
+Options=&Optionen
+Original Language Support - Default Modules=Standardmodule für Ursprachenunterstützung
+Parsing=Syntaxanalyse
+Personalize=Personalisieren
+Preferences=Voreinstellungen
+&Preferences...=&Voreinstellungen...
+Preview...=Vorschau...
+Preview=Vorschau
+Range Name=Name für diesen Bereich
+Range Text=Bibeltext
+Reference=Bibelstelle
+&Remove=&Entfernen
+&Save=&Speichern
+S&ave Layout=Anordnung s&peichern
+Save Other Bookmarks=Andere Lesezeichen speichern
+Save Personal Bookmarks=Eigene Lesezeichen speichern
+Save Screen Layout=Bildschirmanordnung speichern
+Scheme=Schema
+Scope=Bereich
+&Search=&Suche
+Search Options=Sucheinstellungen
+Search Type=Suchart
+Search...=Suche...
+Search=Suche
+Select Color...=Farbe...
+Select Font...=Schriftart...
+Show Devotional at Startup=Tageslese beim Programmstart anzeigen
+Show Devotional Splash Screen on Startup=Tageslese beim Programmstart anzeigen
+Show Devotionals as Dictionaries=Tageslese als Wörterbucher anzeigen
+Show Hint Over Strongs Numbers=Erklärung über Strongs-Nummern anzeigen
+Show Hint Pop-ups=Tipps anzeigen
+Special Modules=Besondere Module
+Strong's Numbered Text=Text mit Strongs-Nummern
+Text Font=Schriftart für den Text
+&Tools=&Tools
+Type Verse=Vers eintippen
+User Verse List=Eigene Versliste
+Verse List=Versliste
+Verse Number Color=Farbe für Versnummern
+&New Bookmark File=&Neue Lesezeichendatei
+P&rint...=&Drucken...
+The SWORD Project=Das SWORD Projekt
+&Footnotes=&Fußnoten
+&On=&An
+O&ff=A&us
+&Hebrew Cantillation=Hebräische Kantillation
+H&ebrew Vowel Points=Hebräische Vokalmarkierungen
+&Strong's Numbers=Strongs-Nummern
+&Morphological Tags=Wortformenanzeige
+He&adings=Ü&berschriften
+&Transliteration=&Umschrift
+&Latin=Lateinische Buchstaben
+&Basic Latin=Lateinische Buchstaben ohne Akzente
+B&eta=B&eta
+B&Greek=B&Greek
+Print Selection=Druckauswahl
+Print Source=Quelle
+Bible Text=Bibeltext
+Commentary Text=Kommentartext
+Lexicon/Dictionary Text=Lexikon-/Wörterbuchtext
+Module Name=Modulname
+Print Range=Druckbereich
+Versbereich oder -liste:
+&Print=&Drucken
+Print=Drucken
+Print...=Drucken...
+&Print...=&Drucken...
+P&review=&Vorschau
+P&review...=&Vorschau...
+Printer&s...=D&rucker...
+Margins (Inches)=Ränder (Zoll)
+Top:=Oben:
+Left:=Links:
+Right:=Rechts:
+Bottom:=Unten:
+Header/Footer=Kopf-/Fußzeile
+Print Header=Kopfzeile drucken
+Header Text:=Kopfzeilentext:
+Print Footer=Fußzeile drucken
+Footer Text:=Fußzeilentext:
+Formatting Options=Formatierung
+Font and Size=Schriftart und -größe
+Chapter Heading:=Kapitelüberschrift:
+Body Text:=Text:
+Verse Numbers:=Versnummern:
+Font:=Schriftart:
+Book Name=Buchname
+Chapter Headings=Kapitelüberschriften
+Paragraph Format=Absatzformat
+Verse Numbers=Versnummern
+Superscripted=Hochgestellt
+Prefixed (John 1:1 KJV)...=Vorne (Johannes 1,1 KJV)...
+Postfixed ...(John 1:1 KJV)=Hinten ...(Johannes 1,1 KJV)
+"English (US)","Czech","Danish","German","French","Norwegian","Polish","Portuguese","Slovak"="Englisch (USA)","Tschechisch","Dänisch","Deutsch","Französisch","Norwegisch","Polnisch","Portugiesisch","Slovakisch"
+Glossaries=Glossare
+Show Glossaries as Dictionaries=Glossare als Wörterbücher anzeigen
+Default=Standard
+"All Modules","Bible Modules","Commentary Modules","Lexicon/Dictionary Modules"="Alle Module","Bibelmodule","Kommentarmodule","Lexikon-/Wörterbuchmodule"
+&Save Scheme=Schema &speichern
+&Delete Scheme=Schema &löschen
+&Import Scheme=Schema &importieren
+&Export Scheme=Schema &exportieren
+Personal Bookmarks=Eigene Lesezeichen
+Words To Live By...Worte zum Leben...
+Go Back To Previous Location=Zurück
+Bring Up Search Window=Suchfenster anzeigen
+Biblical Texts=Biblische Texte
+Commentaries=Kommentare
+Lexicons / Dictionaries=Lexika / Wörterbücher
+Lookup Entry=Nach Eintrag suchen
+Verse Range or List=Versbereich oder -liste
+Page Setup=Seite einrichten
+Strong's Numbers <...>=Strongs Nummer <...>
+Strong's Tense (...)=Strongs Zeitform (...) \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/hu.conf b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/hu.conf
new file mode 100644
index 0000000..946759d
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/hu.conf
@@ -0,0 +1,172 @@
+[Meta]
+Name=hu
+Description=Magyar
+Translator=Mentler Gyula <mentler@sbgk.hu>
+
+[Text]
+BackBtnImage=uilocales.d/en_back.bmp
+SearchBtnImage=uilocales.d/en_search.bmp
+&About=SWORD &névjegye
+About The SWORD Project=SWORD Projektrõl
+&Add=&Hozzáadás
+&Add Bookmark=&Könyvjelzõ elhelyezése
+Add New Bookmark File=Új könyvjelzõfile létrehozása
+Bookmark Section Title:=Könyvjelzõ csoport címe:
+Bookmark=Könyvjelzõ
+Bookmarks=Könyvjelzõk
+Cancel=Mégsem
+Case Sensitive=Kis-/Nagybetû érzékeny
+Chapter=Fejezet
+Check Modules To Show As Tabs=Fülként megjelenõ modulok kijelölése
+Combo/Edit Fields=Combo/Edit Fields
+Contents=&Tartalom
+&Copy=&Másolás
+Copy as &B-Greek Transliteration=Másolás &B-Görög átírásban
+&Close=Be&zárás
+Create a New Verse List Window=Új verslista ablak létrehozása
+Create Verse List=Verslista létrehozása
+Current Verse Color=Aktuális vers színe
+Daily Devotionals=Napi csendesség
+Default Devotional=Alapértelmezett napi csendesség
+Define Custom Range=Tartomány megadása
+Definitions=Definíciók
+&Delete Entry=Bejegyzés törlése
+Description=Leírás
+Devotion for Today=Mai csendesség
+Devotional of the Day=&Csendesség
+Dictionary Lookup=Keresés a szótárban
+Display Colors=Képernyõ színei
+Display=Képernyõ
+&Edit=S&zerkesztés
+&Edit Bookmarks / Tree View...=Könyvjelzõk s&zerkesztése / Fa nézet
+Edit Entry=Bejegyzés szerkesztése
+&Edit Entry=Bejegyzés s&zerkesztése
+"Entire Module","Current Results","Custom Range"="Egész modul","Aktuális eredmények","Beállított tartomány"
+E&xit=&Kilépés
+eg. mat-jo;rev4=eg. mat-jo;rev4
+&File=&File
+File Name (without extension):=File neve (kiterjesztés nélkül):
+Font Size:=Betûtípus mérete:
+Found New Module...=Új modultok...
+General=Álltalános
+Greek=Görög
+Hebrew=Héber
+&Help=&Súgó
+Hide / Show Modules=Modulok elrejtése/megjelenítése
+Individual Modules (Font Only)=Egyedi modulok (csak betûtípus)
+Install Manager=&Install manager program
+Language=Nyelv
+Link to Comment for Verse...=Mutató a vershez tartozó kommentárra
+Maintain Custom Ranges=Tartományok beállítása
+Module Type=Modul típus
+Module=Modul
+"Mult Word","Phrase","Regular Expression"="Több szó","Kifejezés","Reguláris kifejezés"
+&New Search Window=Új keresõablak
+OK=OK
+OkBtn=OK
+Options=&Beállítások
+Original Language Support - Default Modules=Eredeti nyelv támogatás - Alapértelmezett modulok
+Parsing=Szintaktikai feldolgozás
+Personalize=Personalize
+Preferences=Testreszabás
+&Preferences...=&Testreszabás...
+Preview...=Preview...
+Preview=Preview
+Range Name=Tartomány neve
+Range Text=Tartomány szövege
+Reference=Hivatkozás
+&Remove=&Eltávolítás
+&Save=&Mentés
+S&ave Layout=Elrendezés &mentése
+Save Other Bookmarks=Egyéb könyvjelzõk mentése
+Save Personal Bookmarks=Személyes könyvjelzõk mentése
+Save Screen Layout=Képernyõelrendezés mentése
+Scheme=Séma
+Scope=Környezet(Scope)
+&Search=&Keresés
+Search Options=Keresési opciók
+Search Type=Kereséstípus
+Search...=Keresés...
+Search=Keresés
+Select Color...=Szín...
+Select Font...=Betûtípus...
+Show Devotional at Startup=Show Devotional at Startup
+Show Devotional Splash Screen on Startup=Show Devotional Splash Screen on Startup
+Show Devotionals as Dictionaries=Show Devotionals as Dictionaries
+Show Hint Over Strongs Numbers=Magyarázatok megmutatása a Strong számok felett
+Show Hint Pop-ups=Tipp ablalok megmutatása
+Special Modules=Speciális modulok
+Strong's Numbered Text=Strong számokkal ellátott szöveg
+Text Font=Betûtípus a szöveghez
+&Tools=&Eszközök
+Type Verse=Type Verse
+User Verse List=Felhasználói verslista
+Verse List=Verslista
+Verse Number Color=Vers sorszámok színe
+&New Bookmark File=&Új könyvjelzõfile
+P&rint...=&Nyomtatás...
+The SWORD Project=A SWORD Projekt
+&Footnotes=&Lábjegyzetek
+&On=&Be
+O&ff=@Ki
+&Hebrew Cantillation=Héber recitálás
+H&ebrew Vowel Points=Héber magánhangzók pontozása
+&Strong's Numbers=Strong számok
+&Morphological Tags=Morfológiai jelzések
+He&adings=Fejlécek
+&Transliteration=Átírás
+&Latin=Latin betûk
+&Basic Latin=Latin betûk ékezet nélkül
+B&eta=B&eta
+B&Greek=B&Görög
+Print Selection=Kiválasztott rész kinyomtatása
+Print Source=Forrás nyomtatása
+Bible Text=Bibliai szöveg
+Commentary Text=Kommentár szövege
+Lexicon/Dictionary Text=Lexikon/Szótár
+Module Name=Modulnév
+Print Range=Tartomány nyomtatása
+&Print=&Nyomtatás
+P&review=Bemutatás
+Printer&s...=Nyomtatók...
+Margins (Inches)=Margók (inch)
+Top=Fent
+Left=Bal
+Right=Jobb
+Bottom=Lent
+Header/Footer=Fej-/Lábléc
+Print Header=Fejléc nyomtatás
+Header Text=Fejléc szövege
+Print Footer=Lábléc nyomtatása
+Footer Text=Lábléc szövege
+Formatting Options=Formázási opciók
+Font and Size=Metûtípus és méret
+Chapter Heading=Fejezet fejléce
+Body Text=Kenyérszöveg
+Verse Numbers=Versszámozás
+Font=Betûtípus
+Book Name=Könyv neve
+Chapter Headigns=Fejezetek fejlécei
+Paragraph Format=Bekezdés formázás
+Verse Numbers=Versszámozás
+Superscripted=Felsõ indexbe
+Prefixed (John 1:1 KJV)...=Elé írva (János 1,1 KJV)...
+Postfixed ...(John 1:1 KJV)=Utána írva ...(János 1,1 KJV)
+"English (US)","Czech","Danish","German","French","Norwegian","Polish","Portuguese","Slovak"="Angol (USA)","Cseh","Dán","Német","Francia","Norvég","Lengyel","Portugál","Szlovák"
+Glossaries=Szójegyzékek
+Show Glossaries as Dictionaries=Szójegyzékek és szótárak megmutatása
+Default=Alapértelmezett
+"All Modules","Bible Modules","Commentary Modules","Lexicon/Dictionary Modules"="Minden modul","Biblia modulok","Kommentár modulok","Lexikon/szótár modulok"
+&Save Scheme=Séma &mentés
+&Delete Scheme=Séma &törlés
+&Import Scheme=Séma &importálás
+&Export Scheme=Séma &exportálás
+Words To Live By...=Words To Live By...
+Go Back To Previous Location=Vissza az elõzõ helyre
+Bring Up Search Window=Keresõablak megjelenítése
+Biblical Texts=Bibliai szövegek
+Commentaries=Kommentárok
+Lexicons / Dictionaries=Lexikonok/Szótárak
+
+
+
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/id.conf b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/id.conf
new file mode 100644
index 0000000..a0802ef
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/id.conf
@@ -0,0 +1,179 @@
+[Meta]
+Name=id
+Description=Indonesia
+Translator=SABDA/YLSA <SABDA@xc.org>
+
+[Text]
+#BackBtnImage=uilocales.d/id_back.bmp
+#SearchBtnImage=uilocales.d/id_search.bmp
+&About=&Tentang SWORD/PEDANG...
+About The SWORD Project=Tentang Proyek SWORD/PEDANG
+&Add=&Tambah
+&Add Bookmark=Tambah Bookmark
+Add New Bookmark File=Tambah File Bookmark Baru
+Bookmark Section Title:=Judul Bagian Bookmark:
+Bookmark=Bookmark
+Bookmarks=Bookmark
+Cancel=Batal
+Case Sensitive=Huruf Besar/Kecil Berbeda
+Chapter=Pasal/Bab
+Check Modules To Show As Tabs=Cek Modul yang Ditampilkan dalam Tab
+Combo/Edit Fields=Field Multi/Edit
+Contents=Isi
+&Copy=Copy
+Copy as &B-Greek Transliteration=Copy Ke Transliterasi Yunani
+&Close=Tutup
+Create a New Verse List Window=Membuat Jendela Daftar Ayat Baru
+Create Verse List=Membuat Daftar Ayat
+Current Verse Color=Warna Ayat Aktif
+Daily Devotionals=Renungan Harian
+Default Devotional=Renungan Standar/Default
+Define Custom Range=Definisikan Batasan Khusus/Custom
+Definitions=Definisi
+&Delete Entry=Hapus Data
+Description=Deskripsi
+Devotion for Today=Renungan untuk Hari Ini
+Devotional of the Day=Renungan Hari Ini
+Dictionary Lookup=Cari dalam Kamus
+Display Colors=Warna Tampilan
+Display=Tampilkan
+&Edit=&Edit
+&Edit Bookmarks / Tree View...=Edit Bookmark / Sub-Bagian...
+Edit Entry=Edit Tulisan/Data
+&Edit Entry=Edit Tulisan/Data
+"Entire Module","Current Results","Custom Range"="Dalam Satu Modul","Dalam Hasil Pencarian","Dalam Batasan Khusus"
+E&xit=Keluar
+eg. mat-jo;rev4=mis. mat-yoh;wah4
+&File=File
+File Name (without extension):=Nama File (tanpa ekstensi/jenis):
+Font Size:=Ukuran Font:
+Found New Module...=Modul Baru Ditemukan...
+General=Umum
+Greek=Yunani
+Hebrew=Ibrani
+&Help=Help -- Bantuan/Info
+Hide / Show Modules=Sembunyikan/Tampilkan Modul
+Individual Modules (Font Only)=Modul Tersendiri (Hanya Font)
+Install Manager=Program Install Manager
+Language=Bahasa
+Link to Comment for Verse...=Link Ke Catatan/Komentar untuk Ayat...
+Maintain Custom Ranges=Mengolah Batasan Khusus
+Module Type=Jenis Modul
+Module=Modul
+"Mult Word","Phrase","Regular Expression"="Multi-Kata","Frasa","Ekspresi/Rumus"
+&New Search Window=Jendela Pencarian Baru
+OK=OK
+OkBtn=OkBtn
+Options=Pilihan
+Original Language Support - Default Modules=Dukungan untuk Bahasa Asli - Modul Standar/Default
+Parsing=Uraian Kalimat/Parsing
+Personalize=Kustomisasi Pribadi
+Preferences=Preferensi
+&Preferences...=Preferensi...
+Preview=Lihat Dahulu
+Preview...=Lihat Dahulu...
+Range Name=Batasan Nama
+Range Text=Batasan Teks
+Reference=Referensi
+&Remove=Hapus
+&Save=Simpan
+S&ave Layout=Simpan Susunan/Layout
+Save Other Bookmarks=Simpan Bookmark Lain
+Save Personal Bookmarks=Simpan Bookmark Pribadi
+Save Screen Layout=Simpan Susunan/Layout Layar
+Scheme=Skema
+Scope=Ruang Lingkup
+&Search=Cari
+Search Options=Pilihan Pencarian
+Search Type=Jenis Pencarian
+Search...=Cari...
+Search=Cari
+Select Color...=Pilih Warna...
+Select Font...=Pilih Font...
+Show Devotional at Startup=Tampilkan Renungan di Start-up
+Show Devotional Splash Screen on Startup=Tampilkan Layar Renungan Saat Start-up
+Show Devotionals as Dictionaries=Tampilkan Renungan Seperti Kamus
+Show Hint Over Strongs Numbers=Tampilkan Tip Nomor Strong
+Show Hint Pop-ups=Tampilkan Tip Pop-up
+Special Modules=Modul Khusus
+Strong's Numbered Text=Teks dengan Nomor Strong
+Text Font=Font Teks
+&Tools=Alat-alat
+Type Verse=Ketik Ayat
+User Verse List=Daftar Ayat Pengguna
+Verse List=Daftar Ayat
+Verse Number Color=Warna Nomor Ayat
+&New Bookmark File=File Bookmark Baru
+P&rint...=Cetak...
+The SWORD Project=Proyek SWORD/PEDANG
+&Footnotes=Catatan Kaki
+&On=Hidup/On
+O&ff=Mati/Off
+&Hebrew Cantillation=Kantilasi/Kanonis Ibrani
+H&ebrew Vowel Points=Titik/Poin Vokal Ibrani
+&Strong's Numbers=Nomor Strong
+&Morphological Tags= Tag Morfologi
+He&adings=Bagian Kepala
+&Transliteration=Transliterasi
+&Latin=Bahasa Latin
+&Basic Latin=Bahasa Latin (Basic/Dasar)
+B&eta=Beta
+B&Greek=Yunani
+Print Selection=Pilihan Cetak
+Print Source=Sumber Cetak
+Bible Text=Teks Alkitab
+Commentary Text=Teks Tafsiran/Komentar
+Lexicon/Dictionary Text=Teks Leksikon/Kamus
+Module Name=Nama Modul
+Print Range=Batasan Cetak
+Versbereich oder -liste: **********
+&Print=Cetak
+&Print...=Cetak...
+Print=Cetak
+Print...=Cetak...
+P&review=Lihat Dahulu Cetakan
+P&review...=Lihat Dahulu Cetakan...
+Printer&s...=Printer...
+Margins (Inches)=Margin (Inci)
+Top:=Atas:
+Left:=Kiri:
+Right:=Kanan:
+Bottom:=Bawah:
+Header/Footer=Kepala/Kaki
+Print Header=Kepala/Header Halaman Cetak
+Header Text:=Teks Kepala/Header:
+Print Footer= Kaki/Footer Halaman Cetak
+Footer Text:=Teks Kaki/Footer:
+Formatting Options=Pilihan Format
+Font and Size=Font dan Ukuran
+Chapter Heading:=Judul Bab/Pasal:
+Body Text:=Teks Utama:
+Verse Numbers:=Nomor Ayat:
+Font:=Font:
+Book Name=Nama Kitab/Buku
+Chapter Headings=Judul Bab/Pasal
+Paragraph Format=Format Paragraf
+Verse Numbers=Nomor Ayat
+Superscripted=Tulisan Superskrip
+Prefixed (John 1:1 KJV)...=Alamat Ayat Sebelum (Yohanes 1:1 TB)...
+Postfixed ...(John 1:1 KJV)=Alamat Ayat Setelah ...(Yohanes 1:1 TB)
+"English (US)","Czech","Danish","German","French","Norwegian","Polish","Portuguese","Slovak"="Inggris","Cekoslovakia","Denmark","Jerman","Prancis","Norwegia","Polandia","Portugis","Slovia"
+Glossaries=Daftar Kata - Glossary
+Show Glossaries as Dictionaries=Tampil Daftar Kata/Glossary Seperti Kamus
+Default=Standar/Default
+"All Modules","Bible Modules","Commentary Modules","Lexicon/Dictionary Modules"="Semua Modul","Modul Alkitab","Modul Tafsiran/Komentar","Modul Leksikon/Kamus"
+&Save Scheme=Simpan Skema
+&Delete Scheme=Hapus Skema
+&Import Scheme=Impor Skema
+&Export Scheme=Ekspor Skema
+Words To Live By...=Kata-kata untuk Kehidupan...
+Go Back To Previous Location=Kembali ke Lokasi Sebelumnya
+Bring Up Search Window=Dapat Jendala Pencarian
+Biblical Texts=Teks Alkitabiah
+Commentaries=Tafsiran/Komentar
+Lexicons / Dictionaries= Leksikon / Kamus
+Lookup Entry=Lookup Entry
+Verse Range or List=Verse Range or List
+Page Setup=Page Setup
+Strong's Numbers <...>=Strong's Numbers <...>
+Strong's Tense (...)=Strong's Tense (...) \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/sl.conf b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/sl.conf
new file mode 100644
index 0000000..286d8ff
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/sl.conf
@@ -0,0 +1,178 @@
+[Meta]
+Name=sl
+Description=Slovenian
+Translator=Gregor Anzelj <gre_gor@hotmail.com>
+
+[Text]
+BackBtnImage=uilocales.d/sl_back.bmp
+SearchBtnImage=uilocales.d/sl_search.bmp
+&About=Vi&zitka
+About The SWORD Project=Predstavitev projekta SWORD
+&Add=&Dodaj
+&Add Bookmark=&Dodaj zaznamek
+Add New Bookmark File=Dodaj novo datoteko zaznamkov
+Bookmark Section Title:=Ime skupine zaznamkov:
+Bookmark=Zaznamek
+Bookmarks=Zaznamki
+Cancel=Preklici
+Case Sensitive=Razlikovanje crk
+Chapter=Poglavje
+Check Modules To Show As Tabs=Oznaci module, ki bodo vidni
+Combo/Edit Fields=Kombo/Vnosna polja
+Contents=Vsebina
+&Copy=&Kopiraj
+Copy as &B-Greek Transliteration=Kopiraj kot &B-Grski prepis
+&Close=&Zapri
+Create a New Verse List Window=Ustvari okno z novim seznamom vrstic
+Create Verse List=Ustvari seznam vrstic
+Current Verse Color=Barva trenutne vrstice
+Daily Devotionals=Dnevno branje
+Default Devotional=Privzeto branje
+Define Custom Range=Definiraj lasten obseg
+Definitions=Definicije
+&Delete Entry=&Izbrisi vnos
+Description=Opis
+Devotion for Today=Danasnje dnevno branje
+Devotional of the Day=Dnevno branje
+Dictionary Lookup=Poglej v slovarju
+Display Colors=Barve zaslona
+Display=Zaslon
+&Edit=&Urejanje
+&Edit Bookmarks / Tree View...=&Urejanje zaznamkov / Drevo...
+Edit Entry=Urejanje vnosa
+&Edit Entry=&Urejanje vnosa
+"Entire Module","Current Results","Custom Range"="Celoten modul","Trenutni rezultati","Lasten obseg"
+E&xit=Iz&hod
+eg. mat-jo;rev4=npr. mt-jn;raz4
+&File=&Datoteka
+File Name (without extension):=Ime datoteke (brez koncnice):
+Font Size:=Velikost pisave:
+Found New Module...=Najden je nov modul...
+General=Splosno
+Greek=Grsko
+Hebrew=Hebrejsko
+&Help=&Pomoc
+Hide / Show Modules=Pokazi / Skrij module
+Individual Modules (Font Only)=Posamezni moduli (samo pisava)
+Install Manager=Namestitveni program
+Language=Jezik
+Link to Comment for Verse...=Povezava s komentarjem vrstice
+Maintain Custom Ranges=Vzdrzuj lastne obsege
+Module Type=Tip modula
+Module=Modul
+"Mult Word","Phrase","Regular Expression"="Vec besed","Fraza","Pravilen izraz"
+&New Search Window=&Novo iskalno okno
+OK=V redu
+OkBtn=&V redu
+Options=&Moznosti
+Original Language Support - Default Modules=Podpora za izvirne jezike - Privzeti moduli
+Parsing=Razclemba
+Personalize=Po meri
+Preferences=Nastavitve
+&Preferences...=&Nastavitve...
+Preview...=Predogled...
+Preview=Predogled
+Range Name=Ime obsega
+Range Text=Obseg besedila
+Reference=Referenca
+&Remove=&Odstrani
+&Save=&Shrani
+S&ave Layout=S&hrani izgled
+Save Other Bookmarks=Shrani druge zaznamke
+Save Personal Bookmarks=Shrani osebne zaznamke
+Save Screen Layout=Shrani izgled zaslona
+Scheme=Shema
+Scope=Obseg
+&Search=&Iskanje
+Search Options=Moznosti iskanja
+Search Type=Tip iskanja
+Search...=Iskanje...
+Search=Iskanje
+Select Color...=Izberi barvo...
+Select Font...=Izberi pisavo...
+Show Devotional at Startup=Pokazi branje ob zacetku
+Show Devotional Splash Screen on Startup=Pokazi dnevno branje ob zacetku
+Show Devotionals as Dictionaries=Pokazi dnevna branja kot slovarje
+Show Hint Over Strongs Numbers=Pokazi namige pri Strong stevilih
+Show Hint Pop-ups=Pokazi namige
+Special Modules=Posebni moduli
+Strong's Numbered Text=Besedilo s Strong stevili
+Text Font=Pisava besedila
+&Tools=&Orodja
+Type Verse=Tip vrstice
+User Verse List=Uporabnikov seznam vrstic
+Verse List=Seznam vrstic
+Verse Number Color=Barva stevilke vrstice
+&New Bookmark File=&Nova datoteka zaznamkov
+P&rint...=Na&tisni...
+The SWORD Project=Projekt SWORD
+&Footnotes=&Opombe
+&On=&Pokazi
+O&ff=&Skrij
+&Hebrew Cantillation=Hebrejska kantilacija?
+H&ebrew Vowel Points=Hebrejske pike?
+&Strong's Numbers=&Strong stevila
+&Morphological Tags=&Morfoloske oznake
+He&adings=&Naslovi
+&Transliteration=&Prepis
+&Latin=&Latinica
+&Basic Latin=Latinica &brez naglasov
+B&eta=B&eta
+B&Greek=B-&Grsko
+Print Selection=Izbor tiskanja
+Print Source=Vir tiskanja
+Bible Text=Biblicno besedilo
+Commentary Text=Besedilo komentarja
+Lexicon/Dictionary Text=Besedilo leksikona/slovarja
+Module Name=Ime modula
+Print Range=Obseg tiskanja
+&Print=Na&tisni
+&Print...=Na&tisni...
+Print=Natisni
+Print...=Natisni...
+P&review=P&redogled
+P&review...=P&redogled...
+Printer&s...=T&iskalniki...
+Margins (Inches)=Robovi (v palcih)
+Top:=Zgoraj:
+Left:=Levo:
+Right:=Desno:
+Bottom:=Spodaj:
+Header/Footer=Glava/Noga
+Print Header=Natisni glavo
+Header Text:=Besedilo glave:
+Print Footer=Natisni nogo
+Footer Text:=Besedilo noge:
+Formatting Options=Moznosti oblikovanja
+Font and Size=Pisava in velikost
+Chapter Heading:=Naslov poglavja:
+Body Text:=Besedilo:
+Verse Numbers:=Stevilke vrstic:
+Font:=Pisava:
+Book Name=Ime knjige
+Chapter Headings=Naslovi poglavij
+Paragraph Format=Oblika odstavka
+Verse Numbers=Stevilke vrstic
+Superscripted=Nadpisano
+Prefixed (John 1:1 KJV)...=Predpona (Janez 1,1 KJV)...
+Postfixed ...(John 1:1 KJV)=Pripona ...(Janez 1,1 KJV)
+"English (US)","Czech","Danish","German","French","Norwegian","Polish","Portuguese","Slovak","Slovenian"="anglesko","cesko","dansko","nemsko","francosko","norvesko","poljsko","portugalsko","slovasko","slovensko"
+Glossaries=Besednjaki
+Show Glossaries as Dictionaries=Pokazi besednjake kot slovarje
+Default=Privzeto
+"All Modules","Bible Modules","Commentary Modules","Lexicon/Dictionary Modules"="Vsi moduli","Biblicni moduli","Moduli komentarjev","Moduli leksikonov/slovarjev"
+&Save Scheme=&Shrani shemo
+&Delete Scheme=&Izbrisi shemo
+&Import Scheme=&Uvozi shemo
+&Export Scheme=I&zvozi shemo
+Words To Live By...=Besede za zivljenje...
+Go Back To Previous Location=Pojdi na prejsnje mesto
+Bring Up Search Window=Pokazi iskalno okno
+Biblical Texts=Biblicna besedila
+Commentaries=Komentarji
+Lexicons / Dictionaries=Leksikoni / Slovarji
+Lookup Entry=Lookup Entry
+Verse Range or List=Verse Range or List
+Page Setup=Page Setup
+Strong's Numbers <...>=Strong's Numbers <...>
+Strong's Tense (...)=Strong's Tense (...)
diff --git a/apps/windoze/CBuilder5/BibleCS/sword.bpr b/apps/windoze/CBuilder5/BibleCS/sword.bpr
new file mode 100644
index 0000000..8d99df8
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/sword.bpr
@@ -0,0 +1,166 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="stage\sword.exe"/>
+ <OBJFILES value="obj\sword.obj obj\mainfrm.obj obj\AboutBoxfrm.obj obj\bookmarkfrm.obj
+ obj\newbmfilefrm.obj obj\optionfrm.obj obj\searchfrm.obj
+ obj\biblecsmgr.obj obj\ModInstForm.obj obj\vrslstfrm.obj
+ obj\editentryfrm.obj obj\versesel.obj obj\RangeMaintFrm.obj
+ obj\ModVisFrm.obj obj\swdisprtfchap.obj obj\swdisprtf.obj
+ obj\DevOfTheDay.obj obj\SplashPage.obj obj\FontSel.obj rxlib\Rxcombos.obj
+ rxlib\Vclutils.obj rxlib\Rxcconst.obj rxlib\Rxconst.obj
+ obj\StudyProfessor.obj rxlib\RxRichEd.obj rxlib\Maxmin.obj
+ obj\TModuleFonts.obj obj\rtfhintfrm.obj obj\RxRichEditX.obj
+ obj\PreviewForm.obj obj\PrintFrm.obj TntUnicodeControls\Unicode.obj
+ TntUnicodeControls\TntControls.obj TntUnicodeControls\TntForms.obj
+ TntUnicodeControls\TntStdCtrls.obj TntUnicodeControls\TntClasses.obj"/>
+ <RESFILES value="sword.res"/>
+ <IDLFILES value=""/>
+ <IDLGENFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES) mainfrm.dfm AboutBoxfrm.dfm bookmarkfrm.dfm newbmfilefrm.dfm
+ optionfrm.dfm searchfrm.dfm ModInstForm.dfm vrslstfrm.dfm editentryfrm.dfm
+ versesel.dfm RangeMaintFrm.dfm ModVisFrm.dfm DevOfTheDay.dfm
+ SplashPage.dfm FontSel.dfm StudyProfessor.dfm rtfhintfrm.dfm
+ PreviewForm.dfm PrintFrm.dfm"/>
+ <LIBFILES value="swordlib.lib ..\..\..\..\..\icu-sword\as_is\borland\icucommon.lib
+ ..\..\..\..\..\icu-sword\as_is\borland\icudatab.lib
+ ..\..\..\..\..\icu-sword\as_is\borland\icui18n.lib"/>
+ <LIBRARIES value="bcbie50.lib vcljpg50.lib nmfast50.lib vclbde50.lib vcldb50.lib vclx50.lib
+ vcl50.lib"/>
+ <SPARELIBS value="vcl50.lib vclx50.lib vcldb50.lib vclbde50.lib nmfast50.lib vcljpg50.lib
+ bcbie50.lib"/>
+ <PACKAGES value="Vcl50.bpi Vclx50.bpi bcbsmp50.bpi Qrpt50.bpi Vcldb50.bpi Vclbde50.bpi
+ ibsmp50.bpi vcldbx50.bpi TeeUI50.bpi TeeDB50.bpi Tee50.bpi TeeQR50.bpi
+ VCLIB50.bpi bcbie50.bpi vclie50.bpi Inetdb50.bpi Inet50.bpi NMFast50.bpi
+ dclocx50.bpi bcb2kaxserver50.bpi"/>
+ <PATHCPP value=".;..\..;rxlib;TntUnicodeControls"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+ <RELEASELIBPATH value="$(BCB)\lib\release"/>
+ <LINKER value="ilink32"/>
+ <USERDEFINES value="_ICU_;_ICUSWORD_"/>
+ <SYSDEFINES value="NO_STRICT"/>
+ <MAINSOURCE value="sword.cpp"/>
+ <INCLUDEPATH value="TntUnicodeControls;..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib"/>
+ <LIBPATH value="TntUnicodeControls;..\..\..\..\..\TntUnicodeControls;..\..;..\..\..\..\lib;&quot;C:\Program Files\Borland\CBuilder5\RX\Units\&quot;;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;&quot;C:\program files\borland\cbuilder3\projects\&quot;;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par -w-8027 -w-8026"/>
+ <WARNOPTSTR value=""/>
+ </MACROS>
+ <OPTIONS>
+ <IDLCFLAGS value="-I..\.. -I..\..\..\..\..\icu-sword\source\common
+ -I..\..\..\..\..\icu-sword\source\i18n -I..\..\..\..\include
+ -I$(BCB)\include -I$(BCB)\include\vcl -Irxlib -src_suffix cpp -D_ICU_"/>
+ <CFLAG1 value="-O2 -Vx -Ve -RT- -X- -a8 -4 -b- -k- -vi -c -tW -tWM"/>
+ <PFLAGS value="-N2obj -N0obj -$Y- -$L- -$D- -v -M -JPHNE"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zn"/>
+ <LFLAGS value="-Iobj -D&quot;&quot; -aa -Tpe -GD -s -Gn"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="c0w32.obj $(OBJFILES)"/>
+ <ALLRES value="$(RESFILES)"/>
+ <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=1
+AutoIncBuild=1
+MajorVer=1
+MinorVer=5
+Release=3
+Build=103
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=CrossWire Software &amp; Bible Society
+FileDescription=Windows 32bit User Interface to The SWORD Project
+FileVersion=1.5.3.103
+InternalName=biblecs
+LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License
+LegalTrademarks=
+OriginalFilename=
+ProductName=The SWORD Project
+ProductVersion=1.5.4betaX
+Comments=Seek Him and you will find Him
+
+[HistoryLists\hlIncludePath]
+Count=11
+Item0=TntUnicodeControls;..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item1=TntUnicodeControls;..\..\..\WINDOZE;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item2=..\..\..\..\..\TntUnicodeControls;..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item3=..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item4=..\..\..\windoze;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item5=..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item6=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item7=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item8=..\..\..\..\..\icu-sword\source\common\;..\..\..\..\..\icu-sword\source\i18n\;..\..;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item9=C:\icu-sword\source\common\;C:\icu-sword\source\i18n\;..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item10=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+
+[HistoryLists\hlLibraryPath]
+Count=8
+Item0=TntUnicodeControls;..\..\..\..\..\TntUnicodeControls;..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item1=TntUnicodeControls;..\..\..\..\..\TntUnicodeControls;..\..\..\WINDOZE;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\..\..\..\..\TntUnicodeControls;..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item3=..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item4=..\..\..\windoze;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item5=..\..;..\..\..\windoze;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item6=..\..;..\..\..\..\lib\;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item7=..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=5
+Item0=_ICU_;_ICUSWORD_
+Item1=_ICU_;_ICUSWORD_;_DEBUG
+Item2=_ICU_
+Item3=_ICU_;_DEBUG
+Item4=_DEBUG
+
+[HistoryLists\hlIntOutputDir]
+Count=2
+Item0=obj
+Item1=C:\sword\apps\windoze\CBuilder5\BibleCS\obj
+
+[HistoryLists\hlFinalOutputDir]
+Count=4
+Item0=stage\
+Item1=C:\Documents and Settings\Michelle Trotz\My Documents\My Projects\The Sword Project\Stage_Sword\
+Item2=C:\Documents and Settings\Michelle Trotz\My Documents\My Projects\The Sword Project\Stage_Sword
+Item3=C:\sword\apps\windoze\CBuilder5\BibleCS\stage
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/BibleCS/sword.cpp b/apps/windoze/CBuilder5/BibleCS/sword.cpp
new file mode 100644
index 0000000..3686c59
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/sword.cpp
@@ -0,0 +1,160 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+#include "SplashPage.h"
+#include <winreg.h>
+#include <dir.h>
+#include "sword.h"
+
+USERES("sword.res");
+USEFORM("mainfrm.cpp", Form1);
+USEFORM("AboutBoxfrm.cpp", AboutBox);
+USEFORM("bookmarkfrm.cpp", bookmarkForm);
+USEFORM("newbmfilefrm.cpp", NewBMfrm);
+USEFORM("optionfrm.cpp", Optionsfrm);
+USEFORM("searchfrm.cpp", searchForm);
+USEUNIT("biblecsmgr.cpp");
+USEFORM("ModInstForm.cpp", ModInstFrm);
+USEFORM("vrslstfrm.cpp", VerseListFrm);
+USEFORM("editentryfrm.cpp", EditEntryForm);
+USEFORM("versesel.cpp", VerseSelFrm);
+USELIB("swordlib.lib");
+USEFORM("RangeMaintFrm.cpp", RangeMaintForm);
+USEFORM("ModVisFrm.cpp", ModVisForm);
+USEUNIT("..\..\swdisprtfchap.cpp");
+USEUNIT("..\..\swdisprtf.cpp");
+USEFORM("DevOfTheDay.cpp", DevOfTheDay2);
+USEFORM("SplashPage.cpp", SplashPg);
+USEFORM("FontSel.cpp", FontSelFrm);
+USEOBJ("rxlib\Rxcombos.obj");
+USEOBJ("rxlib\Vclutils.obj");
+USEOBJ("rxlib\Rxcconst.obj");
+USEOBJ("rxlib\Rxconst.obj");
+USEFORM("StudyProfessor.cpp", Form3);
+USELIB("..\..\..\..\..\icu-sword\as_is\borland\icucommon.lib");
+USELIB("..\..\..\..\..\icu-sword\as_is\borland\icudatab.lib");
+USELIB("..\..\..\..\..\icu-sword\as_is\borland\icui18n.lib");
+USEOBJ("rxlib\RxRichEd.obj");
+USEOBJ("rxlib\Maxmin.obj");
+USEUNIT("TModuleFonts.cpp");
+USEFORM("rtfhintfrm.cpp", RTFHintForm);
+USEUNIT("RxRichEditX.cpp");
+USEFORM("PreviewForm.cpp", PreviewForm);
+USEFORM("PrintFrm.cpp", PrintForm);
+USEOBJ("TntUnicodeControls\Unicode.obj");
+USEOBJ("TntUnicodeControls\TntControls.obj");
+USEOBJ("TntUnicodeControls\TntForms.obj");
+USEOBJ("TntUnicodeControls\TntStdCtrls.obj");
+USEOBJ("TntUnicodeControls\TntClasses.obj");
+//---------------------------------------------------------------------------
+WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
+
+ LONG result;
+
+ try {
+ HKEY hkey;
+ HWND otherInst;
+
+ // see if there's a previous instance running
+ otherInst = ::FindWindow(NULL, "The SWORD Project for Windows");
+ // if so, and we have an argument, send the argument to the other instance
+ if (*lpCmdLine) {
+ if (otherInst && *lpCmdLine) {
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\OpenVerse", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, lpCmdLine, strlen(lpCmdLine) + 1);
+ result = RegCloseKey(hkey);
+
+ PostMessage(otherInst, WM_VERSE, NULL, NULL);
+ return 0;
+ }
+
+ // TODO 5: if we have a cmdline argument, figure we have to change directories. BAD, FIX.
+ result = Application->ExeName.Length();
+ char * dir = new char[result + 1];
+ strcpy (dir, Application->ExeName.c_str());
+ for (;result > 0 && dir[result] != '\\'; result--) {
+ dir[result] = 0;
+ }
+ chdir(dir);
+ delete [] dir;
+ }
+
+ // adjust the registry for our private protocol using the current path
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1);
+ result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1);
+ result = RegCloseKey(hkey);
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1);
+ result = RegCloseKey(hkey);
+ AnsiString opencommand = Application->ExeName + " \"%1\"";
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1);
+ result = RegCloseKey(hkey);
+
+
+ /*
+ // don't override Logos' setting if it exists
+ result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "libronixdls", 0, KEY_READ | KEY_WRITE, &hkey);
+ if (!result) {
+ char* libStr = new char[32];
+ unsigned long libSize = 32;
+ result = RegQueryValueEx(hkey, NULL, NULL, NULL, libStr, &libSize);
+ if (!result) {
+ if (strstr(libStr, "SWORD")) {
+ result = 1;
+ }
+ }
+ }
+ if (result) {
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1);
+ result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1);
+ result = RegCloseKey(hkey);
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1);
+ result = RegCloseKey(hkey);
+ AnsiString opencommand = Application->ExeName + " \"%1\"";
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1);
+ result = RegCloseKey(hkey);
+ }
+ */
+ }
+ catch (Exception &exception) {
+ Application->ShowException(&exception);
+ }
+
+ try {
+ Application->Initialize();
+ Application->Title = "The SWORD Project";
+ SplashPg = new TSplashPg(static_cast<void*>(NULL));
+ SplashPg->Show();
+ Application->ProcessMessages();
+ Application->CreateForm(__classid(TForm1), &Form1);
+ Application->CreateForm(__classid(TAboutBox), &AboutBox);
+ Application->CreateForm(__classid(TbookmarkForm), &bookmarkForm);
+ Application->CreateForm(__classid(TNewBMfrm), &NewBMfrm);
+ Application->CreateForm(__classid(TOptionsfrm), &Optionsfrm);
+ Application->CreateForm(__classid(TsearchForm), &searchForm);
+ Application->CreateForm(__classid(TModInstFrm), &ModInstFrm);
+ Application->CreateForm(__classid(TVerseListFrm), &VerseListFrm);
+ Application->CreateForm(__classid(TEditEntryForm), &EditEntryForm);
+ Application->CreateForm(__classid(TVerseSelFrm), &VerseSelFrm);
+ Application->CreateForm(__classid(TRangeMaintForm), &RangeMaintForm);
+ Application->CreateForm(__classid(TModVisForm), &ModVisForm);
+ Application->CreateForm(__classid(TDevOfTheDay2), &DevOfTheDay2);
+ Application->CreateForm(__classid(TForm3), &Form3);
+ Application->CreateForm(__classid(TRTFHintForm), &RTFHintForm);
+ Application->CreateForm(__classid(TPreviewForm), &PreviewForm);
+ Application->CreateForm(__classid(TPrintForm), &PrintForm);
+ Application->Run();
+ delete SplashPg;
+ }
+ catch (Exception &exception) {
+ Application->ShowException(&exception);
+ }
+ return 0;
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/BibleCS/sword.h b/apps/windoze/CBuilder5/BibleCS/sword.h
new file mode 100644
index 0000000..5bfa702
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/sword.h
@@ -0,0 +1 @@
+#define WM_VERSE (WM_APP + 1995)
diff --git a/apps/windoze/CBuilder5/BibleCS/sword.res b/apps/windoze/CBuilder5/BibleCS/sword.res
new file mode 100644
index 0000000..8aa7e8d
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/sword.res
Binary files differ
diff --git a/apps/windoze/CBuilder5/BibleCS/swordlib.bpr b/apps/windoze/CBuilder5/BibleCS/swordlib.bpr
new file mode 100644
index 0000000..52ae339
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/swordlib.bpr
@@ -0,0 +1,203 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="..\..\..\..\lib\swordlib.lib"/>
+ <OBJFILES value="..\..\..\..\obj\swordlib.obj ..\..\..\..\obj\versekey.obj
+ ..\..\..\..\obj\swkey.obj ..\..\..\..\obj\listkey.obj
+ ..\..\..\..\obj\strkey.obj ..\..\..\..\obj\swmgr.obj
+ ..\..\..\..\obj\swconfig.obj ..\..\..\..\obj\rawcom.obj
+ ..\..\..\..\obj\swcom.obj ..\..\..\..\obj\rawverse.obj
+ ..\..\..\..\obj\rawstr.obj ..\..\..\..\obj\gbfrtf.obj
+ ..\..\..\..\obj\gbfplain.obj ..\..\..\..\obj\rawld.obj
+ ..\..\..\..\obj\swld.obj ..\..\..\..\obj\rawtext.obj
+ ..\..\..\..\obj\swtext.obj ..\..\..\..\obj\swmodule.obj
+ ..\..\..\..\obj\tbdisp.obj ..\..\..\..\obj\swwinlog.obj
+ ..\..\..\..\obj\hrefcom.obj ..\..\..\..\obj\filemgr.obj
+ ..\..\..\..\obj\rawfiles.obj ..\..\..\..\obj\utilstr.obj
+ ..\..\..\..\obj\utilconf.obj ..\..\..\..\obj\Greek2Greek.obj
+ ..\..\..\..\obj\regex.obj ..\..\..\..\obj\swlog.obj
+ ..\..\..\..\obj\swdisp.obj ..\..\..\..\obj\gbfstrongs.obj
+ ..\..\..\..\obj\gbffootnotes.obj ..\..\..\..\obj\cipherfil.obj
+ ..\..\..\..\obj\sapphire.obj ..\..\..\..\obj\swcipher.obj
+ ..\..\..\..\obj\swlocale.obj ..\..\..\..\obj\localemgr.obj
+ ..\..\..\..\obj\lzsscomprs.obj ..\..\..\..\obj\zverse.obj
+ ..\..\..\..\obj\swcomprs.obj ..\..\..\..\obj\ztext.obj
+ ..\..\..\..\obj\thmlrtf.obj ..\..\..\..\obj\gbfhtml.obj
+ ..\..\..\..\obj\gbfthml.obj ..\..\..\..\obj\plainfootnotes.obj
+ ..\..\..\..\obj\plainhtml.obj ..\..\..\..\obj\rtfhtml.obj
+ ..\..\..\..\obj\thmlgbf.obj ..\..\..\..\obj\thmlhtml.obj
+ ..\..\..\..\obj\thmlplain.obj ..\..\..\..\obj\zcom.obj
+ ..\..\..\..\obj\gbfheadings.obj ..\..\..\..\obj\rawstr4.obj
+ ..\..\..\..\obj\rawld4.obj ..\..\..\..\obj\zipcomprs.obj
+ ..\..\..\..\obj\uncompr.obj ..\..\..\..\obj\compress.obj
+ ..\..\..\..\obj\inflate.obj ..\..\..\..\obj\deflate.obj
+ ..\..\..\..\obj\zutil.obj ..\..\..\..\obj\trees.obj
+ ..\..\..\..\obj\maketree.obj ..\..\..\..\obj\infutil.obj
+ ..\..\..\..\obj\inftrees.obj ..\..\..\..\obj\inffast.obj
+ ..\..\..\..\obj\infcodes.obj ..\..\..\..\obj\infblock.obj
+ ..\..\..\..\obj\crc32.obj ..\..\..\..\obj\adler32.obj
+ ..\..\..\..\obj\gzio.obj ..\..\..\..\obj\untgz.obj
+ ..\..\..\..\obj\unicodertf.obj ..\..\..\..\obj\gbfmorph.obj
+ ..\..\..\..\obj\thmlolb.obj ..\..\..\..\obj\roman.obj
+ ..\..\..\..\obj\gbfhtmlhref.obj ..\..\..\..\obj\latin1utf8.obj
+ ..\..\..\..\obj\latin1utf16.obj ..\..\..\..\obj\scsuutf8.obj
+ ..\..\..\..\obj\swbasicfilter.obj ..\..\..\..\obj\thmlhtmlhref.obj
+ ..\..\..\..\obj\utf8cantillation.obj ..\..\..\..\obj\utf8greekaccents.obj
+ ..\..\..\..\obj\utf8hebrewpoints.obj
+ ..\..\..\..\obj\utf8transliterator.obj ..\..\..\..\obj\utf8utf16.obj
+ ..\..\..\..\obj\utf16utf8.obj ..\..\..\..\obj\utf8latin1.obj
+ ..\..\..\..\obj\utf8html.obj ..\..\..\..\obj\thmlscripref.obj
+ ..\..\..\..\obj\thmlheadings.obj ..\..\..\..\obj\thmllemma.obj
+ ..\..\..\..\obj\thmlmorph.obj ..\..\..\..\obj\thmlfootnotes.obj
+ ..\..\..\..\obj\thmlstrongs.obj ..\..\..\..\obj\utf8nfkd.obj
+ ..\..\..\..\obj\utf8nfc.obj ..\..\..\..\obj\utf8bidireorder.obj
+ ..\..\..\..\obj\utf8arshaping.obj ..\..\..\..\obj\markupfiltmgr.obj
+ ..\..\..\..\obj\encfiltmgr.obj ..\..\..\..\obj\swfiltermgr.obj
+ ..\..\..\..\obj\swversion.obj ..\..\..\..\obj\zld.obj
+ ..\..\..\..\obj\zstr.obj ..\..\..\..\obj\entriesblk.obj
+ ..\..\..\..\obj\swgenbook.obj ..\..\..\..\obj\rawgenbook.obj
+ ..\..\..\..\obj\treekey.obj ..\..\..\..\obj\treekeyidx.obj
+ ..\..\..\..\obj\thmlvariants.obj ..\..\..\..\obj\swcacher.obj
+ ..\..\..\..\obj\greeklexattribs.obj ..\..\..\..\obj\gbfosis.obj
+ ..\..\..\..\obj\thmlosis.obj"/>
+ <RESFILES value=""/>
+ <IDLFILES value=""/>
+ <IDLGENFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES)"/>
+ <LIBFILES value=""/>
+ <LIBRARIES value="nmfast50.lib vclx50.lib vcl50.lib"/>
+ <SPARELIBS value="vcl50.lib vclx50.lib nmfast50.lib"/>
+ <PACKAGES value=""/>
+ <PATHCPP value=".;..\..\..\..\src\keys;..\..\..\..\src\mgr;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\common;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts;..\..\..\..\src\modules;..\..;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\utilfuns;..\..\..\..\src\frontend;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\genbook\rawgenbook"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value=""/>
+ <RELEASELIBPATH value=""/>
+ <LINKER value="TLib"/>
+ <USERDEFINES value="_ICU_;_ICUSWORD_"/>
+ <SYSDEFINES value="NO_STRICT;_NO_VCL"/>
+ <MAINSOURCE value="swordlib.cpp"/>
+ <INCLUDEPATH value="..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl"/>
+ <LIBPATH value="..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys"/>
+ <WARNINGS value="-w-par -w-8027 -w-8026"/>
+ <WARNOPTSTR value=""/>
+ <LISTFILE value=""/>
+ </MACROS>
+ <OPTIONS>
+ <IDLCFLAGS value="-I..\.. -I..\..\..\..\src\modules\genbook\rawgenbook
+ -I..\..\..\..\src\modules\genbook -I..\..\..\..\src\modules\lexdict\zld
+ -I..\..\..\..\..\icu-sword\source\common
+ -I..\..\..\..\..\icu-sword\source\i18n -I..\..\..\..\src\utilfuns\zlib
+ -I..\..\..\..\src\modules\lexdict\rawld4
+ -I..\..\..\..\src\modules\comments\zcom
+ -I..\..\..\..\src\modules\texts\ztext -I..\..\..\..\src\frontend
+ -I..\..\.. -I..\..\..\..\utilfuns -I..\..\..\framework
+ -I..\..\..\..\src\modules\comments\rawfiles
+ -I..\..\..\..\src\modules\comments\hrefcom -I..\..\..\..\include
+ -I..\..\..\..\frontend -I..\..\..\..\src\utilfuns
+ -I..\..\..\..\src\modules -I..\..\..\..\src\modules\texts
+ -I..\..\..\..\src\modules\texts\rawtext
+ -I..\..\..\..\src\modules\texts\rawgbf -I..\..\..\..\src\modules\lexdict
+ -I..\..\..\..\src\modules\lexdict\rawld -I..\..\..\..\src\modules\filters
+ -I..\..\..\..\src\modules\common -I..\..\..\..\src\modules\comments
+ -I..\..\..\..\src\modules\comments\rawcom -I..\..\..\..\src\mgr
+ -I..\..\..\..\src\keys -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix
+ cpp -D_ICU_ -D_DEBUG"/>
+ <CFLAG1 value="-O2 -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -RT- -X- -a8
+ -4 -b- -k- -vi -c -g0 -tWM"/>
+ <PFLAGS value="-N2..\..\..\..\obj -N0..\..\..\..\obj -$Y- -$L- -$D- -v -M -JPHNE"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zn"/>
+ <LFLAGS value="/P512"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="$(OBJFILES)"/>
+ <ALLRES value=""/>
+ <ALLLIB value="cg32.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[HistoryLists\hlIncludePath]
+Count=10
+Item0=..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item1=..\..;..\..\..\WINDOZE;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\APPS;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item2=..\..\..\windoze;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item3=..\..;..\..\..\windoze;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item4=..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\windoze;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item5=..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item6=..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n\;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item7=..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;C:\icu-sword\source\common\;C:\icu-sword\source\i18n\;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item8=..\..\..\..\src\modules\lexdict\zld;C:\icu-sword\source\common\;C:\icu-sword\source\i18n\;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item9=..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common\;..\..\..\..\..\icu-sword\source\i18n\;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=6
+Item0=..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys
+Item1=..\..;..\..\..\WINDOZE;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys
+Item2=..\..\..\windoze;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys
+Item3=..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\windoze;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys
+Item4=..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys
+Item5=..\..\..\..\src\modules\lexdict\zld;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys
+
+[HistoryLists\hlConditionals]
+Count=5
+Item0=_ICU_;_ICUSWORD_
+Item1=_ICU_;_ICUSWORD_;_DEBUG
+Item2=_ICU_
+Item3=_ICU_;_DEBUG
+Item4=_DEBUG
+
+[HistoryLists\hlIntOutputDir]
+Count=2
+Item0=..\..\..\..\obj
+Item1=C:\sword\obj
+
+[HistoryLists\hlFinalOutputDir]
+Count=2
+Item0=..\..\..\..\lib\
+Item1=C:\sword\lib
+
+[HistoryLists\hlTlibPageSize]
+Count=2
+Item0=0x0200
+Item1=0x0100
+
+[Debugging]
+DebugSourceDirs=
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/BibleCS/swordlib.cpp b/apps/windoze/CBuilder5/BibleCS/swordlib.cpp
new file mode 100644
index 0000000..80f7b7e
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/swordlib.cpp
@@ -0,0 +1,121 @@
+//---------------------------------------------------------------------------
+#include <condefs.h>
+#pragma hdrstop
+USEUNIT("..\..\..\..\src\keys\versekey.cpp");
+USEUNIT("..\..\..\..\src\keys\swkey.cpp");
+USEUNIT("..\..\..\..\src\keys\listkey.cpp");
+USEUNIT("..\..\..\..\src\keys\strkey.cpp");
+USEUNIT("..\..\..\..\src\mgr\swmgr.cpp");
+USEUNIT("..\..\..\..\src\mgr\swconfig.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\rawcom\rawcom.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\swcom.cpp");
+USEUNIT("..\..\..\..\src\modules\common\rawverse.cpp");
+USEUNIT("..\..\..\..\src\modules\common\rawstr.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfrtf.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfplain.cpp");
+USEUNIT("..\..\..\..\src\modules\lexdict\rawld\rawld.cpp");
+USEUNIT("..\..\..\..\src\modules\lexdict\swld.cpp");
+USEUNIT("..\..\..\..\src\modules\texts\rawtext\rawtext.cpp");
+USEUNIT("..\..\..\..\src\modules\texts\swtext.cpp");
+USEUNIT("..\..\..\..\src\modules\swmodule.cpp");
+USEUNIT("..\..\tbdisp.cpp");
+USEUNIT("..\..\swwinlog.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\hrefcom\hrefcom.cpp");
+USEUNIT("..\..\..\..\src\mgr\filemgr.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\rawfiles\rawfiles.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\utilstr.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\utilconf.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\Greek2Greek.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\regex.c");
+USEUNIT("..\..\..\..\src\frontend\swlog.cpp");
+USEUNIT("..\..\..\..\src\frontend\swdisp.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfstrongs.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbffootnotes.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\cipherfil.cpp");
+USEUNIT("..\..\..\..\src\modules\common\sapphire.cpp");
+USEUNIT("..\..\..\..\src\modules\common\swcipher.cpp");
+USEUNIT("..\..\..\..\src\mgr\swlocale.cpp");
+USEUNIT("..\..\..\..\src\mgr\localemgr.cpp");
+USEUNIT("..\..\..\..\src\modules\common\lzsscomprs.cpp");
+USEUNIT("..\..\..\..\src\modules\common\zverse.cpp");
+USEUNIT("..\..\..\..\src\modules\common\swcomprs.cpp");
+USEUNIT("..\..\..\..\src\modules\texts\ztext\ztext.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlrtf.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfhtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfthml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\plainfootnotes.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\plainhtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\rtfhtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlgbf.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlhtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlplain.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\zcom\zcom.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfheadings.cpp");
+USEUNIT("..\..\..\..\src\modules\common\rawstr4.cpp");
+USEUNIT("..\..\..\..\src\modules\lexdict\rawld4\rawld4.cpp");
+USEUNIT("..\..\..\..\src\modules\common\zipcomprs.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\uncompr.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\compress.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\inflate.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\deflate.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\zutil.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\trees.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\maketree.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\infutil.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\inftrees.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\inffast.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\infcodes.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\infblock.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\crc32.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\adler32.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\gzio.c");
+USEUNIT("..\..\..\..\src\utilfuns\zlib\untgz.c");
+USEUNIT("..\..\..\..\src\modules\filters\unicodertf.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfmorph.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlolb.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\roman.c");
+USEUNIT("..\..\..\..\src\modules\filters\gbfhtmlhref.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\latin1utf8.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\latin1utf16.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\scsuutf8.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\swbasicfilter.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlhtmlhref.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8cantillation.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8greekaccents.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8hebrewpoints.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8transliterator.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8utf16.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf16utf8.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8latin1.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8html.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlscripref.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlheadings.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmllemma.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlmorph.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlfootnotes.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlstrongs.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8nfkd.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8nfc.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8bidireorder.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\utf8arshaping.cpp");
+USEUNIT("..\..\..\..\src\mgr\markupfiltmgr.cpp");
+USEUNIT("..\..\..\..\src\mgr\encfiltmgr.cpp");
+USEUNIT("..\..\..\..\src\mgr\swfiltermgr.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\swversion.cpp");
+USEUNIT("..\..\..\..\src\modules\lexdict\zld\zld.cpp");
+USEUNIT("..\..\..\..\src\modules\common\zstr.cpp");
+USEUNIT("..\..\..\..\src\modules\common\entriesblk.cpp");
+USEUNIT("..\..\..\..\src\modules\genbook\swgenbook.cpp");
+USEUNIT("..\..\..\..\src\modules\genbook\rawgenbook\rawgenbook.cpp");
+USEUNIT("..\..\..\..\src\keys\treekey.cpp");
+USEUNIT("..\..\..\..\src\keys\treekeyidx.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlvariants.cpp");
+USEUNIT("..\..\..\..\src\mgr\swcacher.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\greeklexattribs.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfosis.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlosis.cpp");
+//---------------------------------------------------------------------------
+#define Library
+
+// To add a file to the library use the Project menu 'Add to Project'.
+
diff --git a/apps/windoze/CBuilder5/BibleCS/swordprj.bpg b/apps/windoze/CBuilder5/BibleCS/swordprj.bpg
new file mode 100644
index 0000000..c5e4dab
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/swordprj.bpg
@@ -0,0 +1,32 @@
+#------------------------------------------------------------------------------
+VERSION = BWS.01
+#------------------------------------------------------------------------------
+!ifndef ROOT
+ROOT = $(MAKEDIR)\..
+!endif
+#------------------------------------------------------------------------------
+MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
+DCC = $(ROOT)\bin\dcc32.exe $**
+BRCC = $(ROOT)\bin\brcc32.exe $**
+#------------------------------------------------------------------------------
+PROJECTS = icucommon.lib icui18n.lib swordlib.lib sword.exe
+#------------------------------------------------------------------------------
+default: sword
+#------------------------------------------------------------------------------
+
+
+swordlib.lib: swordlib.bpr
+ $(MAKE)
+
+sword.exe: sword.bpr
+ $(MAKE)
+
+icui18n.lib: ..\..\..\..\..\icu-sword\as_is\borland\i18n.bpr
+ $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
+ $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
+
+icucommon.lib: ..\..\..\..\..\icu-sword\as_is\borland\common.bpr
+ $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
+ $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
+
+
diff --git a/apps/windoze/CBuilder5/BibleCS/versesel.cpp b/apps/windoze/CBuilder5/BibleCS/versesel.cpp
new file mode 100644
index 0000000..8788580
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/versesel.cpp
@@ -0,0 +1,22 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "versesel.h"
+#include <versekey.h>
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TVerseSelFrm *VerseSelFrm;
+//---------------------------------------------------------------------------
+__fastcall TVerseSelFrm::TVerseSelFrm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TVerseSelFrm::Edit1Change(TObject *Sender)
+{
+ VerseKey trykey = Edit1->Text.c_str();
+ Panel2->Caption = (const char *)trykey;
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp
new file mode 100644
index 0000000..ac0f3b9
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp
@@ -0,0 +1,49 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "vrslstfrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TVerseListFrm *VerseListFrm;
+//---------------------------------------------------------------------------
+__fastcall TVerseListFrm::TVerseListFrm(TComponent* Owner, ListKey &iVerseList)
+ : TForm(Owner), verseList(iVerseList) {
+ pvrtf = new SWDispRTF(this);
+
+ pvrtf->Parent = plPreview;
+ pvrtf->Align = alClient;
+ pvrtf->ScrollBars = ssVertical;
+ pvrtf->ReadOnly = true;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TVerseListFrm::ListBox1Click(TObject *Sender) {
+ ModMap::iterator target;
+ target = Form1->mainmgr->Modules.find(Form1->TextPageControl->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ SWKey *savekey = *(*target).second;
+ (*target).second->SetKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str());
+ pvrtf->Display(*(*target).second);
+ (*target).second->SetKey(*savekey);
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TVerseListFrm::ListBox1DblClick(TObject *Sender)
+{
+ *(Form1->DefaultVSKey) = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str();
+ Form1->TextKeyChanged();
+}
+//---------------------------------------------------------------------------
+void __fastcall TVerseListFrm::FormShow(TObject *Sender)
+{
+ for (verseList = TOP; (!verseList.Error()); verseList++)
+ ListBox1->Items->Add((const char *)verseList);
+}
+//---------------------------------------------------------------------------
+
+
+
+
diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm
new file mode 100644
index 0000000..ed8fd45
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm
@@ -0,0 +1,40 @@
+object VerseListFrm: TVerseListFrm
+ Left = 457
+ Top = 100
+ Width = 256
+ Height = 315
+ Caption = 'Verse List'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ FormStyle = fsStayOnTop
+ OldCreateOrder = True
+ Position = poScreenCenter
+ Scaled = False
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object plPreview: TPanel
+ Left = 0
+ Top = 143
+ Width = 248
+ Height = 145
+ Align = alBottom
+ Caption = 'plPreview'
+ TabOrder = 0
+ end
+ object ListBox1: TListBox
+ Left = 0
+ Top = 0
+ Width = 248
+ Height = 143
+ Align = alClient
+ ItemHeight = 13
+ TabOrder = 1
+ OnClick = ListBox1Click
+ OnDblClick = ListBox1DblClick
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h
new file mode 100644
index 0000000..7af64b9
--- /dev/null
+++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h
@@ -0,0 +1,29 @@
+//---------------------------------------------------------------------------
+#ifndef vrslstfrmH
+#define vrslstfrmH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+#include "mainfrm.h"
+//---------------------------------------------------------------------------
+class TVerseListFrm : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *plPreview;
+ TListBox *ListBox1;
+ void __fastcall ListBox1Click(TObject *Sender);
+ void __fastcall ListBox1DblClick(TObject *Sender);
+ void __fastcall FormShow(TObject *Sender);
+private: // User declarations
+ SWDispRTF *pvrtf;
+ ListKey &verseList;
+public: // User declarations
+ __fastcall TVerseListFrm(TComponent* Owner, ListKey &iVerseList);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TVerseListFrm *VerseListFrm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg
new file mode 100644
index 0000000..792eb7c
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg
@@ -0,0 +1,31 @@
+#------------------------------------------------------------------------------
+VERSION = BWS.01
+#------------------------------------------------------------------------------
+!ifndef ROOT
+ROOT = $(MAKEDIR)\..
+!endif
+#------------------------------------------------------------------------------
+MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
+DCC = $(ROOT)\bin\dcc32.exe $**
+BRCC = $(ROOT)\bin\brcc32.exe $**
+#------------------------------------------------------------------------------
+PROJECTS = swordlib.lib zlib.lib libcurl.lib InstallMgr.exe
+#------------------------------------------------------------------------------
+default: $(PROJECTS)
+#------------------------------------------------------------------------------
+
+InstallMgr.exe: InstallMgr.bpr
+ $(MAKE)
+
+swordlib.lib: ..\BibleCS\swordlib.bpr
+ $(MAKE)
+
+zlib.lib: zlib.bpr
+ $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
+ $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
+
+libcurl.lib: libcurl.bpr
+ $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
+ $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
+
+
diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr
new file mode 100644
index 0000000..1b2a792
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr
@@ -0,0 +1,136 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="InstallMgr.exe"/>
+ <OBJFILES value="InstallMgr.obj MainFrm.obj StatusFrm.obj RemoteMntFrm.obj InfoFrm.obj
+ cipherfrm.obj UninstallFrm.obj"/>
+ <RESFILES value="InstallMgr.res"/>
+ <IDLFILES value=""/>
+ <IDLGENFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES) MainFrm.dfm StatusFrm.dfm RemoteMntFrm.dfm InfoFrm.dfm
+ cipherfrm.dfm UninstallFrm.dfm"/>
+ <LIBFILES value="zlib.lib ..\..\..\..\lib\swordlib.lib libcurl.lib curl\lib\ws2_32.lib"/>
+ <LIBRARIES value="vclx50.lib vcl50.lib"/>
+ <SPARELIBS value="vcl50.lib vclx50.lib"/>
+ <PACKAGES value="vcl50.bpi vclx50.bpi vcljpg50.bpi bcbsmp50.bpi qrpt50.bpi vcldb50.bpi
+ vclbde50.bpi ibsmp50.bpi vcldbx50.bpi teeui50.bpi teedb50.bpi tee50.bpi
+ nmfast50.bpi dclocx50.bpi"/>
+ <PATHCPP value=".;"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+ <RELEASELIBPATH value="$(BCB)\lib\release"/>
+ <LINKER value="ilink32"/>
+ <USERDEFINES value="VCL"/>
+ <SYSDEFINES value="NO_STRICT"/>
+ <MAINSOURCE value="InstallMgr.cpp"/>
+ <INCLUDEPATH value="curl\include;..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include"/>
+ <LIBPATH value="..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par -w-8027 -w-8026"/>
+ <WARNOPTSTR value=""/>
+ </MACROS>
+ <OPTIONS>
+ <IDLCFLAGS value="-I..\BibleCS -I..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr
+ -I$(BCB)\include -I$(BCB)\include\vcl -I..\..\..\..\include -src_suffix
+ cpp -DVCL -boa"/>
+ <CFLAG1 value="-O2 -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -RT- -X- -a8
+ -b- -k- -vi -c -tW -tWM"/>
+ <PFLAGS value="-$Y- -$L- -$D- -v -JPHNE -M"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zn"/>
+ <LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/>
+ <ALLRES value="$(RESFILES)"/>
+ <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=1
+AutoIncBuild=0
+MajorVer=1
+MinorVer=5
+Release=3
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=CrossWire Bible Society
+FileDescription=SWORD Installation Manager
+FileVersion=1.5.3.0
+InternalName=InstallMgr
+LegalCopyright=Copyright 2002 by CrossWire Bible Society
+LegalTrademarks=
+OriginalFilename=
+ProductName=The SWORD Project
+ProductVersion=1.5.3
+Comments=Seek Jesus who exchanges temporary for eternal
+
+[HistoryLists\hlIncludePath]
+Count=6
+Item0=curl\include;..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item1=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item2=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item3=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item4=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item5=..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+
+[HistoryLists\hlLibraryPath]
+Count=5
+Item0=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib
+Item1=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib
+Item3=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib
+Item4=..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=8
+Item0=VCL
+Item1=VCL;__STDC__ true
+Item2=VCL;__STDC__
+Item3=VCL;_MSC_VER
+Item4=VCL __STDC__
+Item5=VCL;_DEBUG
+Item6=_DEBUG;VCL
+Item7=_DEBUG
+
+[HistoryLists\hlRunParameters]
+Count=1
+Item0=-uninstall
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp
new file mode 100644
index 0000000..a269603
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp
@@ -0,0 +1,36 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+USERES("InstallMgr.res");
+USEFORM("MainFrm.cpp", MainForm);
+USEFORM("StatusFrm.cpp", StatusForm);
+USEFORM("RemoteMntFrm.cpp", RemoteMntForm);
+USEFORM("InfoFrm.cpp", InfoForm);
+USEFORM("cipherfrm.cpp", CipherForm);
+USEFORM("UninstallFrm.cpp", UninstallForm);
+USELIB("zlib.lib");
+USELIB("..\..\..\..\lib\swordlib.lib");
+USELIB("libcurl.lib");
+USELIB("curl\lib\ws2_32.lib");
+//---------------------------------------------------------------------------
+WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
+{
+ try
+ {
+ Application->Initialize();
+ Application->Title = "Install Manager";
+ Application->CreateForm(__classid(TMainForm), &MainForm);
+ Application->CreateForm(__classid(TStatusForm), &StatusForm);
+ Application->CreateForm(__classid(TRemoteMntForm), &RemoteMntForm);
+ Application->CreateForm(__classid(TInfoForm), &InfoForm);
+ Application->CreateForm(__classid(TCipherForm), &CipherForm);
+ Application->CreateForm(__classid(TUninstallForm), &UninstallForm);
+ Application->Run();
+ }
+ catch (Exception &exception)
+ {
+ Application->ShowException(&exception);
+ }
+ return 0;
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res
new file mode 100644
index 0000000..67f5484
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res
Binary files differ
diff --git a/apps/windoze/CBuilder5/InstallMgr/MainFrm.cpp b/apps/windoze/CBuilder5/InstallMgr/MainFrm.cpp
new file mode 100644
index 0000000..42e0500
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/MainFrm.cpp
@@ -0,0 +1,1110 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+extern "C" {
+#include <untgz.h>
+}
+
+#include "MainFrm.h"
+#include "StatusFrm.h"
+#include "RemoteMntFrm.h"
+#include "InfoFrm.h"
+#include "cipherfrm.h"
+#include "UninstallFrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+
+#include <swwinlog.h>
+#include <shellapi.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <io.h>
+#include <sys/stat.h>
+#include <dir.h>
+#include <FileCtrl.hpp>
+
+TMainForm *MainForm;
+
+
+VersionInfo::VersionInfo(const char *version) {
+ char *buf = new char[ strlen(version) + 1 ];
+ char *tok;
+ major = minor = minor2 = minor3 = 0;
+
+ strcpy(buf, version);
+ tok = strtok(buf, ".");
+ if (tok)
+ major = atoi(tok);
+ tok = strtok(0, ".");
+ if (tok)
+ minor = atoi(tok);
+ tok = strtok(0, ".");
+ if (tok)
+ minor2 = atoi(tok);
+ tok = strtok(0, ".");
+ if (tok)
+ minor3 = atoi(tok);
+ delete [] buf;
+}
+
+
+int VersionInfo::compare(const VersionInfo &vi) const {
+ if (major == vi.major)
+ if (minor == vi.minor)
+ if (minor2 == vi.minor2)
+ if (minor3 == vi.minor3)
+ return 0;
+ else return minor3 - vi.minor3;
+ else return minor2 - vi.minor2;
+ else return minor - vi.minor;
+ else return major - vi.major;
+}
+
+
+__fastcall InstallSourceTab::InstallSourceTab(TComponent *Owner, const char *confEnt, const char *type) : TControl(Owner) {
+ char *buf = new char [ strlen(confEnt) + 1 ];
+
+ strcpy(buf, confEnt);
+
+ Caption = strtok(buf, "|");
+ Source = strtok(0, "|");
+ Directory = strtok(0, "|");
+ delete [] buf;
+ Type = type;
+ mgr = 0;
+}
+
+__fastcall InstallSourceTab::~InstallSourceTab() {
+ if (mgr)
+ delete mgr;
+}
+
+__fastcall TMainForm::TMainForm(TComponent* Owner)
+ : TForm(Owner)
+{
+ try {
+ manager = new SWMgr();
+ }
+ catch (...) {
+ createPathAndFile("./mods.d/globals.conf");
+ manager = new SWMgr();
+ }
+ installConf = new SWConfig("./InstallMgr.conf");
+ localMgr = 0;
+}
+
+
+__fastcall TMainForm::~TMainForm()
+{
+ delete manager;
+ delete installConf;
+ if (localMgr)
+ delete localMgr;
+}
+
+
+void __fastcall TMainForm::FormCreate(TObject *Sender) {
+
+ refreshPageControl();
+
+ if (SWLog::systemlog)
+ delete SWLog::systemlog;
+ SWLog::systemlog = new SWWinLog(this->Handle); // set the system logger to our MSWindows specific SWLog class
+
+ fillInstallTree();
+ fillSourceTree(getLocalDir(), localTree);
+}
+
+
+void TMainForm::refreshPageControl() {
+ SectionMap::iterator sources;
+ ConfigEntMap::iterator sourceBegin;
+ ConfigEntMap::iterator sourceEnd;
+
+ while (PageControl1->PageCount > 1) {
+ delete PageControl1->Pages[1];
+ }
+
+ sources = installConf->Sections.find("Sources");
+ passive = (!stricmp((*installConf)["General"]["PassiveFTP"].c_str(), "true"));
+
+ if (sources != installConf->Sections.end()) {
+ sourceBegin = sources->second.lower_bound("FTPSource");
+ sourceEnd = sources->second.upper_bound("FTPSource");
+
+ if (sourceBegin != sourceEnd) {
+ while (sourceBegin != sourceEnd) {
+ InstallSourceTab *ist = new InstallSourceTab(this, sourceBegin->second.c_str(), "FTP");
+ addSource(ist);
+ sourceBegin++;
+ }
+ }
+ }
+}
+
+
+void TMainForm::addSource(InstallSourceTab *ist)
+{
+ TTabSheet *newtab = new TTabSheet(this);
+ TTreeView *newtree = new TTreeView(this);
+ TSpeedButton *newbutton = new TSpeedButton(this);
+ TPanel *newpanel = new TPanel(this);
+ char buf[512];
+ SectionMap::iterator sit;
+
+ newtab->Caption = ist->Caption.c_str();
+ newtab->Hint = ist->Source.c_str();
+ newtab->ShowHint = true;
+ newtab->PageControl = PageControl1;
+ ist->Parent = newtab;
+ ist->tree = newtree;
+ newpanel->Parent = newtab;
+ newpanel->Align = alTop;
+ newpanel->BevelOuter = bvNone;
+ newpanel->BevelInner = bvNone;
+ newpanel->Height = 25;
+ newbutton->Parent = newpanel;
+ newbutton->Caption = "Refresh from Remote Source";
+ newbutton->Width = 210;
+ newbutton->OnClick = RefreshRemoteSource;
+ newbutton->Flat = true;
+ newbutton->Glyph = SpeedButton2->Glyph;
+ newtree->Parent = newtab;
+ newtree->Align = alClient;
+ newtree->ReadOnly = true;
+ newtree->OnDblClick = localTreeDblClick;
+ newtree->Images = ImageList1;
+ newtree->StateImages = ImageList2;
+ string parent = "./sources/" + ist->Source + "/file";
+ createParent(parent.c_str());
+ parent = "./sources/" + ist->Source;
+ fillSourceTree(parent.c_str(), newtree);
+}
+
+
+const char *TMainForm::getLocalDir()
+{
+ ConfigEntMap::iterator entry;
+
+ entry = installConf->Sections["Sources"].find("LocalPath");
+ if (entry == installConf->Sections["Sources"].end()) {
+ installConf->Sections["Sources"].insert(ConfigEntMap::value_type("LocalPath", "d:/sword"));
+ entry = installConf->Sections["Sources"].find("LocalPath");
+ }
+ return entry->second.c_str();
+
+}
+
+
+void TMainForm::setLocalDir(const char *idir)
+{
+ installConf->Sections["Sources"].erase("LocalPath"); installConf->Sections["Sources"].insert(ConfigEntMap::value_type("LocalPath", idir));
+}
+
+
+//---------------------------------------------------------------------------
+void __fastcall TMainForm::LocalPath1Click(TObject *Sender)
+{
+ AnsiString Dir = "C:";
+ WideString Root = getLocalDir();
+ SelectDirectory("Select Local Path", Root , Dir);
+
+/*
+ localPathDlg->Title = "Select a file in the directory to choose";
+ localPathDlg->InitialDir = getLocalDir();
+ if (localPathDlg->Execute()) {
+ char *buf = new char [ strlen(localPathDlg->FileName.c_str()) + 1 ];
+
+ strcpy(buf, localPathDlg->FileName.c_str());
+ int end = strlen(buf) - 1;
+ while (end) {
+ if ((buf[end] == '/') || (buf[end] == '\\'))
+ break;
+ end--;
+ }
+ buf[end+1] = 0;
+ setLocalDir(buf);
+ delete [] buf;
+ }
+*/
+
+ setLocalDir(Dir.c_str());
+
+ installConf->Save();
+ fillSourceTree(getLocalDir(), localTree);
+}
+//---------------------------------------------------------------------------
+
+void TMainForm::fillInstallTree()
+{
+ ModMap::iterator mods;
+ TTreeNode *node;
+ string nodeName;
+
+ installTree->Items->Clear();
+
+ if (!manager->configPath)
+ return;
+
+ for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) {
+ for (node = installTree->Items->GetFirstNode(); node; node = node->getNextSibling()) {
+ if (!strcmp(node->Text.c_str(), mods->second->Type())) {
+ break;
+ }
+ }
+ if (!node) { // Add Section
+ if (!strncmp(mods->second->Type(), "Bibl", 4)) // If Bibles, put first in list
+ node = installTree->Items->AddChildFirst(0, mods->second->Type());
+ else node = installTree->Items->AddChild(0, mods->second->Type());
+ }
+ nodeName = "[";
+ nodeName += mods->second->Name();
+ nodeName += "] ";
+ nodeName += mods->second->Description();
+ node = installTree->Items->AddChildObject(node, nodeName.c_str(), mods->second->Name());
+ }
+ for (node = installTree->Items->GetFirstNode(); node; node = node->getNextSibling())
+ node->Expand(true);
+ node = installTree->Items->GetFirstNode();
+ if (node)
+ node->MakeVisible();
+}
+
+
+void TMainForm::fillSourceTree(const char *sourceConf, TTreeView *tree)
+{
+ ModMap::iterator mods;
+ TTreeNode *node;
+ SectionMap::iterator sections, targetSection;
+ ConfigEntMap::iterator entry;
+ string secName;
+ const char * modDesc;
+ string nodeName;
+ string targetVersion;
+ string sourceVersion;
+ bool cipher;
+ bool showLocked = LockedModules1->Checked;
+
+ SWMgr *mgr;
+
+ if (tree == localTree) {
+ if (localMgr)
+ delete localMgr;
+ mgr = localMgr = new SWMgr(sourceConf);
+ }
+ else {
+
+ InstallSourceTab *ist = (InstallSourceTab *) tree->Parent->Controls[0];
+ if (ist->mgr)
+ delete ist->mgr;
+ mgr = ist->mgr = new SWMgr(sourceConf);
+ }
+
+ tree->Items->Clear();
+
+ if (!mgr->configPath)
+ return;
+
+ for (sections = mgr->config->Sections.begin(); sections != mgr->config->Sections.end(); sections++) {
+
+ cipher = false;
+
+ if (!strcmp(sections->first.c_str(), "Globals")) // skip [Globals]
+ continue;
+
+ entry = sections->second.find("CipherKey");
+ if (entry != sections->second.end()) {
+ if (showLocked)
+ cipher = true;
+ else continue;
+ }
+
+ mods = mgr->Modules.find(sections->first.c_str());
+ if (mods != mgr->Modules.end())
+ secName = mods->second->Type();
+ else {
+ secName = "Other";
+ }
+
+ string misc1 = ((entry = sections->second.find("Category")) != sections->second.end()) ? (*entry).second : (string)"";
+ if (misc1.length() > 0)
+ secName = misc1;
+
+ entry = sections->second.find("Description");
+ if (entry != sections->second.end())
+ modDesc = entry->second.c_str();
+ else modDesc = "";
+
+
+ targetVersion = "0.0";
+ sourceVersion = "1.0";
+
+ entry = sections->second.find("Version");
+ if (entry != sections->second.end())
+ sourceVersion = entry->second.c_str();
+
+ targetSection = manager->config->Sections.find(sections->first);
+ if (targetSection != manager->config->Sections.end()) {
+ targetVersion = "1.0";
+ entry = targetSection->second.find("Version");
+ if (entry != targetSection->second.end())
+ targetVersion = entry->second;
+ }
+
+ if (VersionInfo(sourceVersion.c_str()) > VersionInfo(targetVersion.c_str())) {
+ for (node = tree->Items->GetFirstNode(); node; node = node->getNextSibling()) {
+ if (!strcmp(node->Text.c_str(), secName.c_str())) {
+ break;
+ }
+ }
+
+ if (!node) { // Add Section
+ if (!strncmp(secName.c_str(), "Bibl", 4)) // If Bibles, put first in list
+ node = tree->Items->AddChildFirst(0, secName.c_str());
+ else node = tree->Items->AddChild(0, secName.c_str());
+ node->ImageIndex = 0;
+ }
+ nodeName = "[" + sections->first + "] " + modDesc;
+ node = tree->Items->AddChildObject(node, nodeName.c_str(), (void *) sections->first.c_str());
+ if (VersionInfo(targetVersion.c_str()) < VersionInfo("1.0")) {
+ node->ImageIndex = 1;
+ node->SelectedIndex = 1;
+ }
+ else {
+ node->ImageIndex = 2;
+ node->SelectedIndex = 2;
+ }
+ if (cipher) {
+ node->ImageIndex += 2;
+ node->SelectedIndex += 2;
+ }
+ node->StateIndex = 0;
+ }
+ }
+ for (node = tree->Items->GetFirstNode(); node; node = node->getNextSibling())
+ node->Expand(true);
+ node = tree->Items->GetFirstNode();
+ if (node)
+ node->MakeVisible();
+}
+
+
+void __fastcall TMainForm::Button5Click(TObject *Sender)
+{
+ TTreeView *tree;
+ for (int i = 0; i < PageControl1->ActivePage->ControlCount; i++) {
+ if (PageControl1->ActivePage->Controls[i]->ClassNameIs("TTreeView")) {
+ tree = (TTreeView*)(PageControl1->ActivePage->Controls[i]);
+ break;
+ }
+ }
+ TTreeNode *node = tree->Selected;
+ if (node) {
+ if (node->Parent) {
+ if (node->StateIndex == 1)
+ node->StateIndex = 0; //node->StateIndex;
+ else node->StateIndex = 1;
+ tree->Repaint();
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::localTreeDblClick(TObject *Sender)
+{
+ Button5Click(Sender);
+}
+//---------------------------------------------------------------------------
+
+int TMainForm::selectAll(TTreeView *tree, bool sel)
+{
+ TTreeNode *node;
+ TTreeNode *node2;
+ int retCount = 0;
+
+ for (node = tree->Items->GetFirstNode(); node; node = node->getNextSibling()) {
+ for (node2 = node->getFirstChild(); node2; node2 = node2->getNextSibling()) {
+ if (node2->StateIndex == 1) {
+ if (!sel) {
+ node2->StateIndex = 0; //node2->StateIndex;
+ retCount++;
+ }
+ }
+ else {
+ if (sel) {
+ node2->StateIndex = 1;
+ retCount++;
+ }
+ }
+ }
+ }
+ return retCount;
+}
+
+
+void __fastcall TMainForm::Button6Click(TObject *Sender) // SELECT ALL
+{
+ TTreeView *tree;
+ for (int i = 0; i < PageControl1->ActivePage->ControlCount; i++) {
+ if (PageControl1->ActivePage->Controls[i]->ClassNameIs("TTreeView")) {
+ tree = (TTreeView*)(PageControl1->ActivePage->Controls[i]);
+ break;
+ }
+ }
+ if (!selectAll(tree, true))
+ selectAll(tree, false);
+ tree->Repaint();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Image1Click(TObject *Sender)
+{
+ ShellExecute(this->Handle, "open", "http://www.crosswire.org", NULL, NULL, SW_SHOWNORMAL);
+
+}
+//---------------------------------------------------------------------------
+
+int TMainForm::removeModule(const char *modName)
+{
+ SectionMap::iterator module;
+ ConfigEntMap::iterator fileBegin;
+ ConfigEntMap::iterator fileEnd, entry;
+
+ module = manager->config->Sections.find(modName);
+
+ if (module != manager->config->Sections.end()) {
+ entry = module->second.find("CipherKey");
+ if (entry != module->second.end())
+ CipherForm->cipherEdit->Text = entry->second.c_str();
+
+ fileBegin = module->second.lower_bound("File");
+ fileEnd = module->second.upper_bound("File");
+
+ if (fileBegin != fileEnd) { // remove each file
+ while (fileBegin != fileEnd) {
+ //remove file
+ remove(fileBegin->second.c_str());
+ fileBegin++;
+ }
+ }
+ else { //remove all files in DataPath directory
+
+ DIR *dir;
+ struct dirent *ent;
+ ConfigEntMap::iterator entry;
+ string modDir;
+ string modFile;
+
+ entry = module->second.find("DataPath");
+ if (entry != module->second.end()) {
+ modDir = entry->second.c_str();
+ entry = module->second.find("ModDrv");
+ if (entry != module->second.end()) {
+ if (!strcmp(entry->second.c_str(), "RawLD") || !strcmp(entry->second.c_str(), "RawLD4") || !strcmp(entry->second.c_str(), "zLD") || !strcmp(entry->second.c_str(), "RawGenBook") || !strcmp(entry->second.c_str(), "zGenBook")) {
+ char *buf = new char [ strlen(modDir.c_str()) + 1 ];
+
+ strcpy(buf, modDir.c_str());
+ int end = strlen(buf) - 1;
+ while (end) {
+ if (buf[end] == '/')
+ break;
+ end--;
+ }
+ buf[end] = 0;
+ modDir = buf;
+ delete [] buf;
+ }
+ }
+
+ if (dir = opendir(modDir.c_str())) {
+ rewinddir(dir);
+ while ((ent = readdir(dir))) {
+ if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
+ modFile = modDir;
+ modFile += "/";
+ modFile += ent->d_name;
+ remove(modFile.c_str());
+ }
+ }
+ closedir(dir);
+ }
+ if (dir = opendir(manager->configPath)) { // find and remove .conf file
+ rewinddir(dir);
+ while ((ent = readdir(dir))) {
+ if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
+ modFile = manager->configPath;
+ modFile += "/";
+ modFile += ent->d_name;
+ SWConfig *config = new SWConfig(modFile.c_str());
+ if (config->Sections.find(modName) != config->Sections.end()) {
+ delete config;
+ remove(modFile.c_str());
+ }
+ else delete config;
+ }
+ }
+ closedir(dir);
+ }
+ }
+ }
+ return 0;
+ }
+ return 1;
+}
+
+
+int TMainForm::createParent(const char *pName)
+{
+ char *buf = new char [ strlen(pName) + 1 ];
+ int retCode = 0;
+
+ strcpy(buf, pName);
+ int end = strlen(buf) - 1;
+ while (end) {
+ if (buf[end] == '/')
+ break;
+ end--;
+ }
+ buf[end] = 0;
+ if (strlen(buf)>0) {
+ if (access(buf, 02)) { // not exists with write access?
+ if ((retCode = mkdir(buf))) {
+ createParent(buf);
+ retCode = mkdir(buf);
+ }
+ }
+ }
+ else retCode = -1;
+ delete [] buf;
+ return retCode;
+}
+
+
+int TMainForm::createPathAndFile(const char *fName)
+{
+ int fd;
+
+ fd = open(fName, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+ if (fd < 1) {
+ createParent(fName);
+ fd = open(fName, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+ }
+ return fd;
+}
+
+
+int TMainForm::copyFileToCWD(const char *sourceDir, const char *fName)
+{
+ string sourcePath = sourceDir;
+ sourcePath += fName;
+
+ string dest;
+ dest = manager->prefixPath;
+ if ((manager->prefixPath[strlen(manager->prefixPath)-1] != '\\') && ( manager->prefixPath[strlen(manager->prefixPath)-1] != '/'))
+ dest += "/";
+ dest += fName;
+
+ return copyFile(sourcePath.c_str(), dest.c_str());
+}
+
+
+int TMainForm::copyFile(const char *sourceFile, const char *targetFile)
+{
+ int sfd, dfd, len;
+ char buf[4096];
+
+ if ((sfd = open(sourceFile, O_RDONLY|O_BINARY)) < 1)
+ return -1;
+ if ((dfd = createPathAndFile(targetFile)) < 1)
+ return -1;
+
+ do {
+ len = read(sfd, buf, 4096);
+ write(dfd, buf, len);
+ }
+ while(len == 4096);
+ close(dfd);
+ close(sfd);
+
+ return 0;
+}
+
+
+int TMainForm::installModule(const char *modName, InstallSourceTab *ist)
+{
+ SectionMap::iterator module, section;
+ ConfigEntMap::iterator fileBegin;
+ ConfigEntMap::iterator fileEnd;
+ ConfigEntMap::iterator entry;
+ string sourceDir;
+ string buffer;
+ bool aborted = false;
+ bool cipher = false;
+
+ if (ist)
+ sourceDir = "./sources/" + ist->Source;
+ else sourceDir = getLocalDir();
+
+ SWMgr mgr(sourceDir.c_str());
+
+ module = mgr.config->Sections.find(modName);
+
+ if (module != mgr.config->Sections.end()) {
+
+ entry = module->second.find("CipherKey");
+ if (entry != module->second.end())
+ cipher = true;
+
+ fileEnd = module->second.upper_bound("File");
+ fileBegin = module->second.lower_bound("File");
+
+ if (fileBegin != fileEnd) { // copy each file
+ if (ist) {
+ while (fileBegin != fileEnd) { // ftp each file first
+ buffer = sourceDir + "/" + fileBegin->second;
+ if (FTPCopy(ist, fileBegin->second.c_str(), buffer.c_str())) {
+ aborted = true;
+ break; // user aborted
+ }
+ fileBegin++;
+ }
+ fileBegin = module->second.lower_bound("File");
+ }
+
+ if (!aborted) {
+ // DO THE INSTALL
+ while (fileBegin != fileEnd) {
+ copyFileToCWD(sourceDir.c_str(), fileBegin->second.c_str());
+ fileBegin++;
+ }
+ }
+ //---------------
+
+ if (ist) {
+ fileBegin = module->second.lower_bound("File");
+ while (fileBegin != fileEnd) { // delete each tmp ftp file
+ buffer = sourceDir + "/" + fileBegin->second;
+ remove(buffer.c_str());
+ fileBegin++;
+ }
+ }
+ }
+ else { //copy all files in DataPath directory
+ DIR *dir;
+ struct dirent *ent;
+ ConfigEntMap::iterator entry;
+ string modDir;
+ string modFile;
+ string sourceOrig = sourceDir;
+
+ entry = module->second.find("DataPath");
+ if (entry != module->second.end()) {
+ modDir = entry->second.c_str();
+ entry = module->second.find("ModDrv");
+ if (entry != module->second.end()) {
+ if (!strcmp(entry->second.c_str(), "RawLD") || !strcmp(entry->second.c_str(), "RawLD4") || !strcmp(entry->second.c_str(), "zLD") || !strcmp(entry->second.c_str(), "RawGenBook") || !strcmp(entry->second.c_str(), "zGenBook")) {
+ char *buf = new char [ strlen(modDir.c_str()) + 1 ];
+
+ strcpy(buf, modDir.c_str());
+ int end = strlen(buf) - 1;
+ while (end) {
+ if (buf[end] == '/')
+ break;
+ end--;
+ }
+ buf[end] = 0;
+ modDir = buf;
+ delete [] buf;
+ }
+ }
+
+ if (ist) {
+ buffer = sourceDir + "/" + modDir;
+ if (FTPCopy(ist, modDir.c_str(), buffer.c_str(), true)) {
+ aborted = true; // user aborted
+ }
+ }
+ sourceDir += "/";
+ sourceDir += modDir;
+ if (!aborted) {
+ if (dir = opendir(sourceDir.c_str())) {
+ rewinddir(dir);
+ while ((ent = readdir(dir))) {
+ if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
+ modFile = modDir;
+ modFile += "/";
+ modFile += ent->d_name;
+ copyFileToCWD(sourceOrig.c_str(), modFile.c_str());
+ }
+ }
+ closedir(dir);
+ }
+ }
+ if (ist) { // delete tmp ftp files
+ if (dir = opendir(sourceDir.c_str())) {
+ rewinddir(dir);
+ while ((ent = readdir(dir))) {
+ if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
+ modFile = sourceOrig + "/" + modDir;
+ modFile += "/";
+ modFile += ent->d_name;
+ remove(modFile.c_str());
+ }
+ }
+ closedir(dir);
+ }
+ }
+ sourceDir = sourceOrig;
+ sourceDir += "/mods.d/";
+ if (!aborted) {
+ if (dir = opendir(sourceDir.c_str())) { // find and copy .conf file
+ rewinddir(dir);
+ while ((ent = readdir(dir))) {
+ if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
+ modFile = sourceDir;
+ modFile += ent->d_name;
+ SWConfig *config = new SWConfig(modFile.c_str());
+ if (config->Sections.find(modName) != config->Sections.end()) {
+ delete config;
+ string targetFile = manager->configPath; //"./mods.d/";
+ targetFile += "/";
+ targetFile += ent->d_name;
+ copyFile(modFile.c_str(), targetFile.c_str());
+ if (cipher) {
+ CipherForm->modName = modName;
+ CipherForm->confFile = targetFile;
+ if (CipherForm->ShowModal() == mrCancel) {
+ removeModule(modName);
+ aborted = true;
+ }
+ }
+ }
+ else delete config;
+ }
+ }
+ closedir(dir);
+ }
+ }
+ }
+ }
+ return (aborted) ? -1 : 0;
+ }
+ return 1;
+}
+
+
+void TMainForm::fillAllSourceTrees()
+{
+ fillSourceTree(getLocalDir(), localTree);
+ for (int i = 1; i < PageControl1->PageCount; i++) {
+ InstallSourceTab *ist = (InstallSourceTab *) MainForm->PageControl1->Pages[i]->Controls[0];
+ string parent = "./sources/" + ist->Source;
+ fillSourceTree(parent.c_str(), ist->tree);
+ }
+}
+
+
+void __fastcall TMainForm::Button4Click(TObject *Sender) // REMOVE MODULE
+{
+ TTreeNode *node = installTree->Selected;
+ if (node) {
+ if (node->Parent) {
+ removeModule((const char *)node->Data);
+ delete manager;
+ manager = new SWMgr();
+ fillInstallTree();
+ fillAllSourceTrees();
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Button2Click(TObject *Sender) // INSTALL
+{
+ TTreeNode *node;
+ int count = 0;
+ int abort = 0;
+
+ class TWaitCursor {
+ public:
+ TWaitCursor() : oldc(Screen->Cursor) { Screen->Cursor = crHourGlass; }
+ ~TWaitCursor() { Screen->Cursor = oldc; }
+ private:
+ TCursor oldc;
+ } wait; // show hourglass
+
+ TTreeView *tree;
+ for (int i = 0; i < PageControl1->ActivePage->ControlCount; i++) {
+ if (PageControl1->ActivePage->Controls[i]->ClassNameIs("TTreeView")) {
+ tree = (TTreeView*)(PageControl1->ActivePage->Controls[i]);
+ break;
+ }
+ }
+
+ for (node = tree->Items->GetFirstNode(); node; node = node->GetNext()) {
+ if (node->StateIndex == 1)
+ count++;
+ } // do true progress bar
+
+ if (!count) {
+ MessageBox(this->WindowHandle, "Please first choose which modules you would like to install by double-clicking a module in the 'Available' tree.", "Please select modules first.", MB_OK);
+ return; // if nothing is selected, do nothing
+ }
+
+ progressBar->Max = count;
+ progressBar->Position = 0;
+
+ for (node = tree->Items->GetFirstNode(); node; node = node->GetNext()) {
+ if (node->StateIndex == 1) { // if selected for install
+ CipherForm->cipherEdit->Text = "";
+ if ((node->ImageIndex == 2) || (node->ImageIndex == 4)) { // if this is an upgrade
+ removeModule((const char *)node->Data);
+ }
+ // install module
+ statusBar->Caption = "Installing: " + node->Text + "...";
+ statusBar->Repaint();
+ if (tree == localTree)
+ abort = installModule((const char *)node->Data);
+ else abort = installModule((const char *)node->Data, (InstallSourceTab *) PageControl1->ActivePage->Controls[0]);
+ if (abort)
+ break;
+ progressBar->Position++;
+ }
+ }
+ delete manager;
+ manager = new SWMgr();
+ fillInstallTree();
+ fillAllSourceTrees();
+ statusBar->Caption = "";
+ progressBar->Position = 0;
+}
+
+
+int TMainForm::FTPCopy(InstallSourceTab *ist, const char *src, const char *dest, bool dirTransfer, const char *suffix)
+{
+ StatusForm->ist = ist;
+ StatusForm->src = src;
+ StatusForm->dest = dest;
+ StatusForm->suffix = suffix;
+ StatusForm->dirTransfer = dirTransfer;
+ StatusForm->passive = passive;
+ Application->ProcessMessages();
+ if (StatusForm->ShowModal() == mrCancel)
+ return -1;
+ else return 0;
+}
+
+
+void __fastcall TMainForm::RefreshRemoteSource(TObject *Sender)
+{
+ InstallSourceTab *ist = (InstallSourceTab *) MainForm->PageControl1->ActivePage->Controls[0];
+ DIR *dir;
+ struct dirent *ent;
+ ConfigEntMap::iterator entry;
+ string modDir;
+ string modFile;
+ string root = "./sources/";
+ root += ist->Source.c_str();
+ string target = root + "/mods.d";
+
+ if (dir = opendir(target.c_str())) {
+ rewinddir(dir);
+ while ((ent = readdir(dir))) {
+ if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
+ modFile = target;
+ modFile += "/";
+ modFile += ent->d_name;
+ remove(modFile.c_str());
+ }
+ }
+ closedir(dir);
+ }
+
+
+ string archive = root + "/mods.d.tar.gz";
+ if (!FTPCopy(ist, "mods.d.tar.gz", archive.c_str(), false)) {
+ int fd = open(archive.c_str(), O_RDONLY|O_BINARY);
+ untargz(fd, root.c_str());
+ close(fd);
+ }
+ else FTPCopy(ist, "mods.d", target.c_str(), true, ".conf");
+
+ target = "./sources/";
+ target += ist->Source.c_str();
+
+ fillSourceTree(target.c_str(), ist->tree);
+}
+
+
+
+void __fastcall TMainForm::SpeedButton1Click(TObject *Sender)
+{
+ InfoForm->Caption = "W A R N I N G";
+ InfoForm->info = "\\qc {\\b \\fs20 -=+* WARNING *+=- -=+* WARNING *+=-}\\par\\par\\pard ";
+ InfoForm->info += "Although Install Manager provides a convenient way for installing and upgrading SWORD components, it also uses a systematic method for accessing sites which gives packet sniffers a target to lock into for singling out users. \\par\\par ";
+ InfoForm->info += "\\b\\qc IF YOU LIVE IN A PERSECUTED COUNTRY AND DO NOT WISH TO RISK DETECTION, YOU SHOULD *NOT* USE INSTALL MANAGER'S REMOTE SOURCE FEATURES.";
+ InfoForm->ShowModal();
+ if (RemoteMntForm->ShowModal() == mrOk) {
+ delete installConf;
+ installConf = new SWConfig("./InstallMgr.conf");
+
+ refreshPageControl();
+ }
+}
+
+void __fastcall TMainForm::SpeedButton5Click(TObject *Sender)
+{
+ TTreeView *tree;
+ InstallSourceTab *ist = 0;
+ SectionMap::iterator module;
+ ConfigEntMap::iterator entry, entryEnd;
+ string sourceDir;
+
+ if (PageControl1->ActivePage != PageControl1->Pages[0]) {
+ ist = (InstallSourceTab *) PageControl1->ActivePage->Controls[0];
+ tree = ist->tree;
+ }
+ else tree = localTree;
+
+ TTreeNode *node = tree->Selected;
+ if (node) {
+ if (node->Parent) {
+ if (ist)
+ sourceDir = "./sources/" + ist->Source;
+ else sourceDir = getLocalDir();
+ SWMgr *mgr = new SWMgr(sourceDir.c_str());
+
+ module = mgr->config->Sections.find((const char *)node->Data);
+
+ if (module != mgr->config->Sections.end()) {
+ string targetVersion = "0.0";
+ string sourceVersion = "1.0";
+ SectionMap::iterator targetSection;
+
+ entry = module->second.find("Version");
+ if (entry != module->second.end())
+ sourceVersion = entry->second.c_str();
+
+ targetSection = manager->config->Sections.find(module->first);
+ if (targetSection != manager->config->Sections.end()) {
+ targetVersion = "1.0";
+ entry = targetSection->second.find("Version");
+ if (entry != targetSection->second.end())
+ targetVersion = entry->second;
+ }
+ if (VersionInfo(targetVersion.c_str()) < VersionInfo("1.0")) {
+ InfoForm->info = "\\pard{\\b * Additional Module Available for Install. } \\par ";
+ }
+ else {
+ InfoForm->info = "\\pard{\\b + Upgraded Module Available for Install.}\\par\\tab Current Version: \\tab " + targetVersion + " \\par\\tab Upgrade Version:\\tab " + sourceVersion + " \\par ";
+ bool changes = false;
+ for (entry = module->second.begin(); entry != module->second.end(); entry++) {
+ if (!strncmp(entry->first.c_str(), "History_", 8)) {
+ if (VersionInfo(&entry->first.c_str()[8]) > VersionInfo(targetVersion.c_str())) {
+ if (!changes) {
+ changes = true;
+ InfoForm->info += "\\par{\\b Changes: }\\par ";
+ }
+ InfoForm->info += "\\tab ";
+ InfoForm->info += entry->second.c_str();
+ InfoForm->info += "\\par ";
+ }
+ }
+ }
+ }
+
+ entry = module->second.find("About");
+ if (entry != module->second.end()) {
+ InfoForm->info += "\\par{\\b About: } \\par\\par ";
+ InfoForm->info += entry->second.c_str();
+ }
+ InfoForm->Caption = "Module Information";
+ InfoForm->ShowModal();
+ }
+ delete mgr;
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Exit1Click(TObject *Sender)
+{
+ Close();
+}
+//---------------------------------------------------------------------------
+
+
+void TMainForm::deleteAllModules() {
+
+ SWMgr *mgr = new SWMgr();
+
+
+ int count = mgr->Modules.size();
+
+ if (!count)
+ return;
+
+ UninstallForm->Show();
+ UninstallForm->ProgressBar1->Max = count;
+ UninstallForm->ProgressBar1->Position = 0;
+
+ ModMap::iterator it;
+ for (it = mgr->Modules.begin(); it != mgr->Modules.end(); it++) {
+ string label = "Uninstalling: [";
+ label += it->second->Name();
+ label += "] ";
+ label += it->second->Description();
+ UninstallForm->Label1->Caption = label.c_str();
+ UninstallForm->Label1->Repaint();
+ removeModule(it->second->Name());
+ UninstallForm->ProgressBar1->Position = UninstallForm->ProgressBar1->Position + 1;
+ UninstallForm->ProgressBar1->Repaint();
+ }
+ delete mgr;
+ UninstallForm->Hide();
+ return;
+}
+void __fastcall TMainForm::FormShow(TObject *Sender)
+{
+ for (int i=0;i<=ParamCount();i++) {
+ if (LowerCase(ParamStr(i)) == "-uninstall") {
+ deleteAllModules();
+ Application->Terminate();
+ }
+ }
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::LockedModules1Click(TObject *Sender) {
+ LockedModules1->Checked = !(LockedModules1->Checked);
+
+ if (LockedModules1->Checked) {
+ InfoForm->Caption = "About Locked Modules";
+ InfoForm->info = "\\qc {\\b \\fs20 About Locked Modules}\\par\\par\\pard ";
+
+ InfoForm->info += "Unfortunately, we are unable to legally provide these modules to the general public at this time. We are making attempts to gain permission from the copyright holders, but until such an agreement is arranged, these modules are only available to our developers and testers. We hope to be able to provide some of these to you soon. \\par\\par\\pard ";
+ InfoForm->info += "If you would like to contribute to the project by contacting a publisher seeking distribution permission for CrossWire, your efforts would be very appreciated-- especially in regard to non-English texts. Please subscribe to our developers' forum per instructions on our website, following the [Mailing Lists] link, and post a message stating how you would like to help. Thank you. \\par\\par\\pard ";
+ InfoForm->info += "\t-CrossWire Bible Society. ";
+ InfoForm->ShowModal();
+ }
+ fillAllSourceTrees();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Contents1Click(TObject *Sender)
+{
+ SWConfig optionsconf("options.conf");
+ string helpDir;
+ ConfigEntMap::iterator it = optionsconf.Sections["Help"].find("Directory");
+ if (it != optionsconf.Sections["Help"].end())
+ helpDir = (*it).second;
+ else helpDir = ".\\help";
+
+ string helpExe = helpDir + "\\Sword.chm::modulesh.html#instmgr";
+ ShellExecute(this->Handle, "open", "hh", helpExe.c_str(), NULL, SW_SHOWNORMAL);
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/InstallMgr/MainFrm.h b/apps/windoze/CBuilder5/InstallMgr/MainFrm.h
new file mode 100644
index 0000000..47fe65c
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/MainFrm.h
@@ -0,0 +1,146 @@
+//---------------------------------------------------------------------------
+#ifndef MainFrmH
+#define MainFrmH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Dialogs.hpp>
+#include <Menus.hpp>
+#include <ExtCtrls.hpp>
+#include <MPlayer.hpp>
+#include <Graphics.hpp>
+#include <ComCtrls.hpp>
+#include <swmgr.h>
+#include <ImgList.hpp>
+#include <Buttons.hpp>
+#include <NMFtp.hpp>
+#include <NMHttp.hpp>
+#include <Psock.hpp>
+
+
+class VersionInfo {
+ public:
+ int major, minor, minor2, minor3;
+
+ VersionInfo(const char *version);
+ int compare(const VersionInfo &vi) const;
+ bool operator>(const VersionInfo &vi) const {return (compare(vi) > 0);}
+ bool operator<(const VersionInfo &vi) const {return (compare(vi) < 0);}
+ bool operator==(const VersionInfo &vi) const {return (compare(vi) == 0);}
+};
+
+
+class InstallSourceTab : public TControl {
+public:
+ __fastcall InstallSourceTab(TComponent *Owner, const char *confEnt, const char *type);
+ __fastcall ~InstallSourceTab();
+ string Type;
+ string Source;
+ string Directory;
+ string Caption;
+ TTreeView *tree;
+ SWMgr *mgr;
+};
+
+
+//---------------------------------------------------------------------------
+class TMainForm : public TForm
+{
+ class TWebThread;
+ friend class TWebThread;
+__published: // IDE-managed Components
+ TMainMenu *MainMenu1;
+ TMenuItem *File1;
+ TMenuItem *Exit1;
+ TMenuItem *Option1;
+ TMenuItem *LocalPath1;
+ TOpenDialog *localPathDlg;
+ TPanel *Panel1;
+ TMediaPlayer *MediaPlayer1;
+ TImage *Image1;
+ TPanel *pnlAvailable;
+ TPanel *pnlInstalled;
+ TSplitter *Splitter1;
+ TPanel *Panel2;
+ TPanel *Panel5;
+ TPageControl *PageControl1;
+ TTabSheet *TabSheet1;
+ TTreeView *localTree;
+ TPanel *Panel8;
+ TPanel *Panel7;
+ TPanel *Panel6;
+ TTreeView *installTree;
+ TTimer *Timer1;
+ TLabel *Label1;
+ TImageList *ImageList1;
+ TPanel *Panel3;
+ TImageList *ImageList2;
+ TPanel *statusBar;
+ TPanel *Panel4;
+ TProgressBar *progressBar;
+ TSpeedButton *SpeedButton2;
+ TImage *Image2;
+ TLabel *Label2;
+ TMenuItem *ManageRemoteSources1;
+ TSpeedButton *SpeedButton1;
+ TSpeedButton *SpeedButton3;
+ TSpeedButton *SpeedButton4;
+ TSpeedButton *SpeedButton5;
+ TSpeedButton *SpeedButton6;
+ TSpeedButton *SpeedButton7;
+ TMenuItem *View1;
+ TMenuItem *LockedModules1;
+ TMenuItem *Help1;
+ TMenuItem *Contents1;
+ void __fastcall LocalPath1Click(TObject *Sender);
+ void __fastcall FormCreate(TObject *Sender);
+ void __fastcall Button5Click(TObject *Sender);
+ void __fastcall localTreeDblClick(TObject *Sender);
+ void __fastcall Button6Click(TObject *Sender);
+ void __fastcall Image1Click(TObject *Sender);
+ void __fastcall Button4Click(TObject *Sender);
+ void __fastcall Button2Click(TObject *Sender);
+ void __fastcall SpeedButton1Click(TObject *Sender);
+ void __fastcall SpeedButton5Click(TObject *Sender);
+ void __fastcall Exit1Click(TObject *Sender);
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall LockedModules1Click(TObject *Sender);
+ void __fastcall Contents1Click(TObject *Sender);
+
+private: // User declarations
+
+ SWMgr *manager;
+ SWConfig *installConf;
+ const char *getLocalDir();
+ void setLocalDir(const char *idir);
+ void refreshPageControl();
+ void addSource(InstallSourceTab *ist);
+ void fillAllSourceTrees();
+ void deleteAllModules();
+
+public: // User declarations
+ __fastcall TMainForm(TComponent* Owner);
+ __fastcall ~TMainForm();
+ void __fastcall RefreshRemoteSource(TObject *Sender);
+ int selectAll(TTreeView *tree, bool sel);
+ int removeModule(const char *modName);
+ int installModule(const char *modName, InstallSourceTab *ist = 0);
+ static int createParent(const char *pName);
+ int createPathAndFile(const char *fName);
+ int copyFile(const char *sourceFile, const char *targetFile);
+ int copyFileToCWD(const char *sourceDir, const char *fName);
+ int FTPCopy(InstallSourceTab *ist, const char *src, const char *dest, bool dirTransfer = false, const char *suffix = "");
+ SWMgr *localMgr;
+ bool passive;
+
+protected:
+ virtual void fillInstallTree();
+ virtual void fillSourceTree(const char *sourceConf, TTreeView *tree);
+};
+
+//---------------------------------------------------------------------------
+extern PACKAGE TMainForm *MainForm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.cpp b/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.cpp
new file mode 100644
index 0000000..148a7fd
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.cpp
@@ -0,0 +1,160 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "RemoteMntFrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+
+TRemoteMntForm *RemoteMntForm;
+
+
+class TRemoteSource : public TObject {
+public:
+ string name;
+ string machine;
+ string dir;
+ TRemoteSource(const char *confEnt) {
+ char *buf = new char [ strlen(confEnt) + 1 ];
+
+ strcpy(buf, confEnt);
+
+ name = strtok(buf, "|");
+ machine = strtok(0, "|");
+ dir = strtok(0, "|");
+ delete [] buf;
+ }
+ string getConfEnt() {
+ return name +"|" + machine + "|" + dir;
+ }
+};
+
+
+//---------------------------------------------------------------------------
+__fastcall TRemoteMntForm::TRemoteMntForm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TRemoteMntForm::FormShow(TObject *Sender)
+{
+ ConfigEntMap::iterator loop, end;
+ config = new SWConfig("./InstallMgr.conf");
+ ListBox1->Clear();
+ loop = config->Sections["Sources"].lower_bound("FTPSource");
+ end = config->Sections["Sources"].upper_bound("FTPSource");
+ while (loop != end) {
+ TRemoteSource *rs = new TRemoteSource(loop->second.c_str());
+ ListBox1->Items->AddObject(rs->name.c_str(), rs);
+ loop++;
+ }
+ ListBox1->ItemIndex = 0;
+ ListBox1Click(0);
+ CheckBox1->Checked = (!stricmp((*config)["General"]["PassiveFTP"].c_str(), "true"));
+ checkDisabled();
+}
+
+
+void TRemoteMntForm::checkDisabled() {
+ bool enabled = ListBox1->Items->Count;
+ NameEdit->Enabled = enabled;
+ MachineEdit->Enabled = enabled;
+ DirEdit->Enabled = enabled;
+}
+
+
+//---------------------------------------------------------------------------
+void __fastcall TRemoteMntForm::FormClose(TObject *Sender,
+ TCloseAction &Action)
+{
+ delete config;
+}
+
+
+void __fastcall TRemoteMntForm::SpeedButton4Click(TObject *Sender)
+{
+ ModalResult = mrCancel;
+}
+
+
+void __fastcall TRemoteMntForm::ListBox1Click(TObject *Sender)
+{
+ if (ListBox1->ItemIndex >= 0) {
+ TRemoteSource *rs = (TRemoteSource *)ListBox1->Items->Objects[ListBox1->ItemIndex];
+
+ NameEdit->Text = rs->name.c_str();
+ MachineEdit->Text = rs->machine.c_str();
+ DirEdit->Text = rs->dir.c_str();
+ }
+ else {
+ NameEdit->Text = "";
+ MachineEdit->Text = "";
+ DirEdit->Text = "";
+ }
+}
+
+
+void __fastcall TRemoteMntForm::NameEditChange(TObject *Sender)
+{
+ if (ListBox1->ItemIndex < 0)
+ return;
+ TRemoteSource *rs = (TRemoteSource *)ListBox1->Items->Objects[ListBox1->ItemIndex];
+ rs->name = NameEdit->Text.c_str();
+ ListBox1->Items->Strings[ListBox1->ItemIndex] = rs->name.c_str();
+}
+
+
+void __fastcall TRemoteMntForm::MachineEditChange(TObject *Sender)
+{
+ if (ListBox1->ItemIndex < 0)
+ return;
+ TRemoteSource *rs = (TRemoteSource *)ListBox1->Items->Objects[ListBox1->ItemIndex];
+ rs->machine = MachineEdit->Text.c_str();
+}
+
+
+void __fastcall TRemoteMntForm::DirEditChange(TObject *Sender)
+{
+ if (ListBox1->ItemIndex < 0)
+ return;
+ TRemoteSource *rs = (TRemoteSource *)ListBox1->Items->Objects[ListBox1->ItemIndex];
+ rs->dir = DirEdit->Text.c_str();
+}
+
+void __fastcall TRemoteMntForm::SpeedButton2Click(TObject *Sender)
+{
+ if (ListBox1->ItemIndex < 0)
+ return;
+ int delItem = ListBox1->ItemIndex;
+ ListBox1->Items->Delete(delItem);
+ ListBox1->ItemIndex = (delItem < ListBox1->Items->Count) ? delItem : delItem - 1;
+ checkDisabled();
+ ListBox1Click(0);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TRemoteMntForm::SpeedButton1Click(TObject *Sender)
+{
+ TRemoteSource *rs = new TRemoteSource("[New Remote Site]|ftp.domain.org|/pub/sword/raw/");
+ ListBox1->ItemIndex = ListBox1->Items->AddObject(rs->name.c_str(), rs);
+
+ checkDisabled();
+ ListBox1Click(0);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TRemoteMntForm::SpeedButton3Click(TObject *Sender)
+{
+ TRemoteSource *rs;
+ config->Sections["Sources"].erase("FTPSource");
+ for (int i = 0; i < ListBox1->Items->Count; i++) {
+ rs = (TRemoteSource *)ListBox1->Items->Objects[i];
+ config->Sections["Sources"].insert(ConfigEntMap::value_type("FTPSource", rs->getConfEnt().c_str()));
+ }
+ (*config)["General"]["PassiveFTP"] = (CheckBox1->Checked) ? "true" : "false";
+ config->Save();
+ ModalResult = mrOk;
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.h b/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.h
new file mode 100644
index 0000000..67c825d
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.h
@@ -0,0 +1,52 @@
+//---------------------------------------------------------------------------
+#ifndef RemoteMntFrmH
+#define RemoteMntFrmH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <ExtCtrls.hpp>
+#include <swconfig.h>
+//---------------------------------------------------------------------------
+class TRemoteMntForm : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TPanel *Panel2;
+ TPanel *Panel3;
+ TListBox *ListBox1;
+ TSpeedButton *SpeedButton1;
+ TSpeedButton *SpeedButton2;
+ TEdit *NameEdit;
+ TEdit *MachineEdit;
+ TEdit *DirEdit;
+ TPanel *Panel4;
+ TSpeedButton *SpeedButton3;
+ TSpeedButton *SpeedButton4;
+ TLabel *Label1;
+ TLabel *Label2;
+ TLabel *Label3;
+ TCheckBox *CheckBox1;
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
+ void __fastcall NameEditChange(TObject *Sender);
+ void __fastcall SpeedButton4Click(TObject *Sender);
+ void __fastcall ListBox1Click(TObject *Sender);
+ void __fastcall MachineEditChange(TObject *Sender);
+ void __fastcall DirEditChange(TObject *Sender);
+ void __fastcall SpeedButton2Click(TObject *Sender);
+ void __fastcall SpeedButton1Click(TObject *Sender);
+ void __fastcall SpeedButton3Click(TObject *Sender);
+private: // User declarations
+ SWConfig *config;
+ void checkDisabled();
+
+public: // User declarations
+ __fastcall TRemoteMntForm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TRemoteMntForm *RemoteMntForm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/InstallMgr/StatusFrm.cpp b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.cpp
new file mode 100644
index 0000000..0abc9da
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.cpp
@@ -0,0 +1,273 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "StatusFrm.h"
+#include "MainFrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+//#pragma link "IdBaseComponent"
+//#pragma link "IdComponent"
+//#pragma link "IdFTP"
+//#pragma link "IdTCPClient"
+//#pragma link "IdTCPConnection"
+#pragma resource "*.dfm"
+TStatusForm *StatusForm;
+
+
+
+
+struct FtpFile {
+ char *filename;
+ FILE *stream;
+};
+
+int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
+{
+ struct FtpFile *out=(struct FtpFile *)stream;
+ if(out && !out->stream) {
+ /* open file for writing */
+ out->stream=fopen(out->filename, "wb");
+ if(!out->stream)
+ return -1; /* failure, can't open file to write */
+ }
+ return fwrite(buffer, size, nmemb, out->stream);
+}
+
+
+
+
+
+//---------------------------------------------------------------------------
+__fastcall TStatusForm::TStatusForm(TComponent* Owner)
+ : TForm(Owner) {
+ suffix = "";
+ passive = false;
+ curl_global_init(CURL_GLOBAL_DEFAULT);
+}
+
+
+__fastcall TStatusForm::~TStatusForm() {
+ curl_global_cleanup();
+}
+
+
+//---------------------------------------------------------------------------
+void __fastcall TStatusForm::FormShow(TObject *Sender)
+{
+ abort = false;
+ ftpThread = new TFTPThread(ist, src.c_str(), dest.c_str(), dirTransfer, passive, true, suffix.c_str());
+ ftpThread->OnTerminate = Cleanup;
+ ftpThread->Resume();
+}
+//---------------------------------------------------------------------------
+__fastcall TStatusForm::TFTPThread::TFTPThread(InstallSourceTab *iist, const char *isrc, const char *idest, bool idirTransfer, bool CreateSuspended, bool ipassive, const char *isuffix)
+ : TThread(CreateSuspended)
+{
+ ist = iist;
+ src = isrc;
+ dest = idest;
+ suffix = isuffix;
+ dirTransfer = idirTransfer;
+ Priority = tpNormal;
+ passive = ipassive;
+ FreeOnTerminate = true;
+ Synchronize((TThreadMethod)&CreateFTPObject);
+}
+
+__fastcall TStatusForm::TFTPThread::~TFTPThread()
+{
+}
+
+
+void __fastcall TStatusForm::TFTPThread::Execute()
+{
+ CURL *curl;
+ CURLcode res;
+ struct FtpFile ftpfile={
+ "curl.tar.gz", /* name to store the file as if succesful */
+ NULL
+ };
+
+ Synchronize((TThreadMethod)&PreConnect);
+ StatusForm->ftpCon->Host = ist->Source.c_str();
+ StatusForm->ftpCon->Username = "ftp";
+ StatusForm->ftpCon->Password = "installmgr@user.com";
+ StatusForm->ftpCon->Passive = passive;
+
+
+ curl = curl_easy_init();
+
+ if (curl) {
+ /* Get curl 7.9.2 from sunet.se's FTP site: */
+ curl_easy_setopt(curl, CURLOPT_URL,
+ "ftp://ftp.sunet.se/pub/www/utilities/curl/curl-7.9.2.tar.gz");
+ /* Define our callback to get called when there's data to be written */
+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
+ /* Set a pointer to our struct to pass to the callback */
+ curl_easy_setopt(curl, CURLOPT_FILE, &ftpfile);
+
+ /* Switch on full protocol/debug output */
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE);
+
+ res = curl_easy_perform(curl);
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+
+ if(CURLE_OK != res) {
+ /* we failed */
+ fprintf(stderr, "curl told us %d\n", res);
+ }
+ }
+
+ if(ftpfile.stream)
+ fclose(ftpfile.stream); /* close the local file */
+
+/*
+ try {
+ StatusForm->ftpCon->Connect(true, -1);
+ StatusForm->ftpCon->TransferType = ftBinary;
+ StatusForm->ftpCon->ChangeDir(ist->Directory.c_str());
+ }
+ catch(...) {
+ MessageBox(0, "Can't connect. Please check your configuration.", "Connection Error", MB_OK);
+ StatusForm->Button1Click(0); // abort thread
+ }
+
+ if (!Terminated) {
+ if (dirTransfer) {
+ StatusForm->ftpCon->ChangeDir(src.c_str());
+ TStringList *dirText = new TStringList();
+ StatusForm->ftpCon->List(dirText, "*", true);
+ TIdFTPListItems *dirList = StatusForm->ftpCon->DirectoryListing;
+ for (int i = 0; i < dirList->Count; i++) {
+ if (dirList->Items[i]->ItemType != ditDirectory) {
+ buffer = dest + "/" + (dirList->Items[i]->FileName.c_str());
+// files->Strings[i].c_str();
+ if (!strcmp(&buffer.c_str()[buffer.length()-suffix.length()], suffix.c_str())) {
+ buffer2 = "Downloading (";
+ buffer2 += IntToStr(i+1).c_str();
+ buffer2 += " of ";
+ buffer2 += IntToStr(dirList->Count).c_str();
+ buffer2 += "): ";
+ buffer2 += (dirList->Items[i]->FileName.c_str());
+ // SWLog::systemlog->LogInformation("%s", buffer.c_str());
+ TMainForm::createParent(buffer.c_str()); // make sure parent directory exists
+ Synchronize((TThreadMethod)&PreDownload1);
+ try {
+ StatusForm->currentFileSize = dirList->Items[i]->Size;
+ StatusForm->ftpCon->Get(dirList->Items[i]->FileName.c_str(), buffer.c_str(), true, false);
+ }
+ catch(...) {
+ MessageBox(0, "Can't download file. If you have not done so recently, you might try pressing the Refresh from Remote Source button.", "Download Error", MB_OK);
+ StatusForm->Button1Click(0); // abort thread
+ }
+ if (Terminated)
+ break;
+ }
+ }
+ }
+ }
+ else {
+ Synchronize((TThreadMethod)&PreDownload2);
+ try {
+ StatusForm->ftpCon->Get(src.c_str(), dest.c_str(), true, false);
+ }
+ catch(...) {StatusForm->abort = true;}
+ }
+ try {
+ StatusForm->ftpCon->Disconnect();
+ }
+ catch(...){}
+ }
+*/
+}
+
+
+void __fastcall TStatusForm::TFTPThread::FTPLinkPacketRecvd(TObject *Sender)
+{
+// Synchronize((TThreadMethod)&UpdateBytes);
+}
+
+
+//void __fastcall TStatusForm::TFTPThread::UpdateBytes(void) {
+void __fastcall TStatusForm::UpdateBytes(void) {
+ StatusForm->statusBar->Caption = IntToStr(StatusForm->currentByteCount) + " bytes out of " + IntToStr(StatusForm->currentFileSize) + " transferred (" + IntToStr((int)((float)(StatusForm->currentByteCount + 1) / (float)(StatusForm->currentFileSize + 1) * 100)) + "%)";
+ StatusForm->statusBar->Repaint();
+}
+
+
+void __fastcall TStatusForm::TFTPThread::CreateFTPObject(void)
+{
+// FTPLink = new TNMFTP(0);
+}
+
+
+void __fastcall TStatusForm::TFTPThread::PreConnect(void)
+{
+ buffer = "Connecting to server at ";
+ buffer += ist->Source.c_str();
+ buffer += "...";
+ StatusForm->actionBar->Caption = buffer.c_str();
+ StatusForm->statusBar->Caption = "";
+ StatusForm->Repaint();
+}
+
+
+void __fastcall TStatusForm::TFTPThread::PreDownload1(void)
+{
+// SWLog::systemlog->LogInformation("Creating parent dir: %s", buffer.c_str());
+// SWLog::systemlog->LogInformation("Return: %d", ret);
+ StatusForm->actionBar->Caption = buffer2.c_str();
+ StatusForm->statusBar->Caption = "";
+ StatusForm->Repaint();
+}
+
+
+void __fastcall TStatusForm::TFTPThread::PreDownload2(void)
+{
+ buffer = "Downloading: ";
+ buffer += src.c_str();
+ StatusForm->actionBar->Caption = buffer.c_str();
+ StatusForm->statusBar->Caption = "";
+ StatusForm->Repaint();
+ MainForm->createParent(dest.c_str()); // make sure parent directory exists
+}
+
+
+void __fastcall TStatusForm::Cleanup(TObject *Sender)
+//void __fastcall TStatusForm::TFTPThread::Cleanup()
+{
+ if (abort)
+ StatusForm->ModalResult = mrCancel;
+ else StatusForm->ModalResult = mrOk;
+// StatusForm->Close();
+}
+
+void __fastcall TStatusForm::FormClose(TObject *Sender, TCloseAction &Action)
+{
+ suffix = "";
+ MainForm->SetFocus();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TStatusForm::Button1Click(TObject *Sender)
+{
+ abort = true;
+// ftpCon->Abort();
+ ftpThread->Terminate();
+}
+//---------------------------------------------------------------------------
+
+/*
+void __fastcall TStatusForm::ftpConWork(TObject *Sender,
+ TWorkMode AWorkMode, const int AWorkCount)
+{
+ currentByteCount = AWorkCount;
+// Synchronize((TThreadMethod)&UpdateBytes);
+ UpdateBytes();
+}
+*/
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm
new file mode 100644
index 0000000..bf8609e
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/InstallMgr/StatusFrm.h b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.h
new file mode 100644
index 0000000..d4b2094
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.h
@@ -0,0 +1,89 @@
+//---------------------------------------------------------------------------
+#ifndef StatusFrmH
+#define StatusFrmH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+//#include <NMFtp.hpp>
+#include "MainFrm.h"
+//#include "IdBaseComponent.hpp"
+//#include "IdComponent.hpp"
+//#include "IdFTP.hpp"
+//#include "IdTCPClient.hpp"
+//#include "IdTCPConnection.hpp"
+#include <curl/curl.h>
+#include <curl/types.h>
+#include <curl/easy.h>
+//---------------------------------------------------------------------------
+
+class TFTPCon {
+public:
+ string Host;
+ string Username;
+ string Password;
+ bool Passive;
+ string cwd;
+
+};
+
+class TStatusForm : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TPanel *Panel2;
+ TButton *Button1;
+ TPanel *statusBar;
+ TPanel *Panel3;
+ TPanel *actionBar;
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall Cleanup(TObject *Sender);
+ void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
+ void __fastcall Button1Click(TObject *Sender);
+// void __fastcall ftpConWork(TObject *Sender, TWorkMode AWorkMode,
+// const int AWorkCount);
+private: // User declarations
+ class TFTPThread : public TThread {
+ bool abort;
+ InstallSourceTab *ist;
+ string src;
+ string dest;
+ string buffer;
+ string buffer2;
+ string suffix;
+ bool dirTransfer;
+ bool passive;
+ protected:
+ void __fastcall Execute();
+ public:
+// TNMFTP *FTPLink;
+ __fastcall TFTPThread(InstallSourceTab *iist, const char *isrc, const char *idest, bool idirTransfer = false, bool CreateSuspended = false, bool ipassive = false, const char *suffix = "");
+ __fastcall TFTPThread::~TFTPThread();
+ void __fastcall FTPLinkPacketRecvd(TObject *Sender);
+ void __fastcall CreateFTPObject(void);
+ void __fastcall PreConnect(void);
+ void __fastcall PreDownload1(void);
+ void __fastcall PreDownload2(void);
+// void __fastcall Cleanup(void);
+ } *ftpThread;
+public: // User declarations
+ TFTPCon *ftpCon;
+ long currentByteCount;
+ long currentFileSize;
+ InstallSourceTab *ist;
+ string src;
+ string dest;
+ string suffix;
+ bool dirTransfer;
+ bool passive;
+ bool abort;
+ void __fastcall UpdateBytes();
+ __fastcall TStatusForm(TComponent* Owner);
+ __fastcall ~TStatusForm();
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TStatusForm *StatusForm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp b/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp
new file mode 100644
index 0000000..5b77797
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp
@@ -0,0 +1,67 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "cipherfrm.h"
+#include <swmgr.h>
+#include <swconfig.h>
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TCipherForm *CipherForm;
+//---------------------------------------------------------------------------
+__fastcall TCipherForm::TCipherForm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TCipherForm::Button2Click(TObject *Sender)
+{
+ SectionMap::iterator section;
+ ConfigEntMap::iterator entry;
+ SWConfig *modconf = new SWConfig(confFile.c_str());
+ string tmpBuf;
+
+ section = modconf->Sections.find(modName);
+ if (section != modconf->Sections.end()) {
+ entry = section->second.find("CipherKey");
+ if (entry != section->second.end()) {
+ entry->second = CipherForm->cipherEdit->Text.c_str();
+ modconf->Save();
+ delete modconf; // close file
+ modconf = 0;
+ SWMgr *mgr = new SWMgr();
+ SWModule *mod = mgr->Modules[modName];
+ mod->SetKey("Ipet 2:12");
+ tmpBuf = mod->StripText();
+ mod->SetKey("gen 1:10");
+ tmpBuf += "\r\n\r\n";
+ tmpBuf += mod->StripText();
+ Memo1->Text = tmpBuf.c_str();
+ delete mgr;
+ }
+ }
+ if (modconf)
+ delete modconf;
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TCipherForm::FormShow(TObject *Sender)
+{
+ string tmpCaption;
+ tmpCaption = "Cipher Key: [";
+ tmpCaption += modName;
+ tmpCaption += "]";
+ Caption = tmpCaption.c_str();
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TCipherForm::FormClose(TObject *Sender,
+ TCloseAction &Action)
+{
+ Memo1->Text = "";
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/InstallMgr/installmgr.conf b/apps/windoze/CBuilder5/InstallMgr/installmgr.conf
new file mode 100644
index 0000000..04a349b
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/installmgr.conf
@@ -0,0 +1,8 @@
+
+[General]
+PassiveFTP=true
+
+[Sources]
+FTPSource=crosswire|ftp.crosswire.org|/pub/sword/raw/
+LocalPath=C:\tmp
+
diff --git a/apps/windoze/CBuilder5/InstallMgr/zlib.bpr b/apps/windoze/CBuilder5/InstallMgr/zlib.bpr
new file mode 100644
index 0000000..635316b
--- /dev/null
+++ b/apps/windoze/CBuilder5/InstallMgr/zlib.bpr
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="zlib.lib"/>
+ <OBJFILES value="..\..\..\..\src\utilfuns\zlib\adler32.obj
+ ..\..\..\..\src\utilfuns\zlib\compress.obj
+ ..\..\..\..\src\utilfuns\zlib\crc32.obj
+ ..\..\..\..\src\utilfuns\zlib\deflate.obj
+ ..\..\..\..\src\utilfuns\zlib\gzio.obj
+ ..\..\..\..\src\utilfuns\zlib\infblock.obj
+ ..\..\..\..\src\utilfuns\zlib\infcodes.obj
+ ..\..\..\..\src\utilfuns\zlib\inffast.obj
+ ..\..\..\..\src\utilfuns\zlib\inflate.obj
+ ..\..\..\..\src\utilfuns\zlib\inftrees.obj
+ ..\..\..\..\src\utilfuns\zlib\infutil.obj
+ ..\..\..\..\src\utilfuns\zlib\maketree.obj
+ ..\..\..\..\src\utilfuns\zlib\trees.obj
+ ..\..\..\..\src\utilfuns\zlib\uncompr.obj
+ ..\..\..\..\src\utilfuns\zlib\untgz.obj
+ ..\..\..\..\src\utilfuns\zlib\zutil.obj"/>
+ <RESFILES value=""/>
+ <IDLFILES value=""/>
+ <IDLGENFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES)"/>
+ <LIBFILES value=""/>
+ <LIBRARIES value=""/>
+ <PACKAGES value=""/>
+ <PATHCPP value=".;..\..\..\..\src\utilfuns\zlib"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <LINKER value="TLib"/>
+ <USERDEFINES value=""/>
+ <SYSDEFINES value="_RTLDLL;NO_STRICT"/>
+ <MAINSOURCE value="zlib.bpf"/>
+ <INCLUDEPATH value="..\..\..\..\src\utilfuns\zlib;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include"/>
+ <LIBPATH value="..\..\..\..\src\utilfuns\zlib;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par"/>
+ <LISTFILE value=""/>
+ </MACROS>
+ <OPTIONS>
+ <IDLCFLAGS value="-I..\..\..\..\src\utilfuns\zlib -I$(BCB)\include -I$(BCB)\include\vcl
+ -I..\..\..\..\include -src_suffix cpp -boa"/>
+ <CFLAG1 value="-O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tW -tWM"/>
+ <PFLAGS value="-$Y- -$L- -$D- -v -JPHNE -M"/>
+ <AFLAGS value="/mx /w2 /zn"/>
+ <LFLAGS value=""/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="$(OBJFILES)"/>
+ <ALLLIB value=""/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=2
+Item0=..\..\..\..\src\utilfuns\zlib;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item1=..\..\..\..\src\utilfuns\zlib;$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=1
+Item0=..\..\..\..\src\utilfuns\zlib;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=1
+Item0=_DEBUG
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[CORBA]
+AddServerUnit=1
+AddClientUnit=1
+PrecompiledHeaders=1
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/CommentPanel.cpp b/apps/windoze/CBuilder5/prototype/CommentPanel.cpp
new file mode 100644
index 0000000..dbf8adf
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/CommentPanel.cpp
@@ -0,0 +1,222 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#include <vcl/clipbrd.hpp>
+#pragma hdrstop
+
+#include "CommentPanel.h"
+#pragma package(smart_init)
+#include "swdisprtfchap.h"
+#include <swconfig.h>
+#include <swmodule.h>
+#include "Greek2Greek.h"
+#include <utilfuns.h>
+#include <swmgr.h>
+#include <shellapi.h>
+
+class RTFDisp : public SWDisplay {
+ SWDispRTF *edit;
+public:
+ RTFDisp(SWDispRTF *iedit) { edit = iedit; }
+ RTFDisp() {}
+ char Display(SWModule &imodule) {
+ edit->Display(imodule);
+ }
+};
+
+class DispExternal : public SWDisplay {
+public:
+ DispExternal() {}
+ char Display(SWModule &imodule) {
+ SHELLEXECUTEINFO info;
+ info.cbSize = sizeof(SHELLEXECUTEINFO);
+ info.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_CLASSNAME;
+ info.hwnd = GetFocus();
+ info.lpVerb = "open";
+ info.lpFile = (char *)imodule;
+ info.lpParameters = NULL;
+ info.lpDirectory = NULL;
+ info.nShow = 0;
+// info.lpClass = ".html";
+ ShellExecuteEx(&info);
+// ShellExecute(edit->Handle, "open", (char *)imodule, NULL, NULL, SW_SHOWNORMAL);
+ }
+};
+
+//---------------------------------------------------------------------------
+// ValidCtrCheck is used to assure that the components created do not have
+// any pure virtual functions.
+//
+
+static inline void ValidCtrCheck(TCommentPanel *)
+{
+ new TCommentPanel(NULL);
+}
+//---------------------------------------------------------------------------
+__fastcall TCommentPanel::TCommentPanel(TComponent* Owner, SWModule *mod, SWMgr *imgr)
+ : TPanel(Owner)
+{
+ module = mod;
+ mgr = imgr;
+ this->font = 0;
+ stdstr(&(this->font), font);
+ menu = new TPopupMenu(this);
+ menu->OnPopup = PopupMenuPopup;
+
+ TMenuItem * newitem;
+ newitem = new TMenuItem(menu);
+ newitem->Caption = "&Copy";
+ newitem->Hint = "Copy text to clipboard";
+ newitem->Default = false;
+ newitem->OnClick = Copy1Click;
+ menu->Items->Add(newitem);
+ if (!strcmp(mod->Name(), "N27U4")) {
+ newitem = new TMenuItem(menu);
+ newitem->Caption = "Copy as &B-Greek Transliteration";
+ newitem->Hint = "Copy text to clipboard as B-Greek Transliteration";
+ newitem->Default = false;
+ newitem->OnClick = CopyasBGreekTransliteration1Click;
+ menu->Items->Add(newitem);
+ }
+ newitem = new TMenuItem(menu);
+ newitem->Caption = "Dictionary Lookup";
+ newitem->Hint = "Send text to dictionary key for lookup";
+ newitem->Default = false;
+ newitem->OnClick = DictionaryLookup1Click;
+ menu->Items->Add(newitem);
+}
+
+
+void __fastcall TCommentPanel::CreateWnd() {
+ TPanel::CreateWnd();
+
+ TWinControl *newrtf;
+
+ if (mgr->config->Sections[module->Name()]["ModDrv"] == "HREFCom") {
+// if (mainmgr->config->Sections[mod->Name()]["External"] == "1") {
+ newrtf = new TPanel(this);
+ ((TPanel *)newrtf)->Caption = "Syncronizing to External Viewer";
+ display = new DispExternal();
+ module->Disp(display);
+/*
+ }
+ else {
+ // newrtf = new THTML(this->Handle);
+ // newrtf = new SWDispRTF(this);
+ newrtf = HTML1;
+ newrtf->Visible = true;
+ mod->Disp(*displays.insert(displays.begin(), new HREFDisp((THTML *)newrtf)));
+ // mod->Disp(*displays.insert(displays.begin(), new RTFDisp((SWDispRTF *)newrtf)));
+ }
+*/
+ }
+ else {
+ newrtf = new SWDispRTF(this);
+ display = new RTFDisp((SWDispRTF *)newrtf);
+ module->Disp(display);
+ ((SWDispRTF *)newrtf)->ScrollBars = ssVertical;
+ ((SWDispRTF *)newrtf)->ReadOnly = true;
+ if (mgr->config->Sections[module->Name()]["ModDrv"] == "RawFiles") {
+// ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu3;
+ ((SWDispRTF *)newrtf)->ExpandNewLine = false;
+ }
+// else ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2;
+ ((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown;
+ }
+
+ newrtf->Parent = this;
+ newrtf->Align = alClient;
+
+// mod->SetKey(DefaultVSKey);
+// return 0;
+
+
+}
+__fastcall TCommentPanel::~TCommentPanel() {
+ delete display;
+ if (font)
+ delete font;
+}
+//---------------------------------------------------------------------------
+namespace Commentpanel
+{
+ void __fastcall PACKAGE Register()
+ {
+ TComponentClass classes[1] = {__classid(TCommentPanel)};
+ RegisterComponents("Samples", classes, 0);
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TCommentPanel::PopupMenuPopup(TObject *Sender)
+{
+}
+void TCommentPanel::BuildRTFHeader(char *buf, char *font, int max)
+{
+ char buf1[1024], buf2[1024];
+ SectionMap::iterator sit;
+
+ sprintf(buf1, "{\\rtf1\\ansi");
+ if (font)
+ sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 %s;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f2\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f3\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}", font);
+ else sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}");
+ strcat(buf1, buf2);
+
+// if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) {
+// sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red%d\\green%d\\blue%d;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;}",
+// atoi((*sit).second["CurrentVSColorRed"].c_str()),
+// atoi((*sit).second["CurrentVSColorGreen"].c_str()),
+// atoi((*sit).second["CurrentVSColorBlue"].c_str()));
+// }
+// else
+ sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;}");
+ strcat(buf1, buf2);
+ memset(buf, 0, max);
+ strncpy(buf, buf1, max);
+}
+
+
+void __fastcall TCommentPanel::CopyasBGreekTransliteration1Click(TObject *Sender)
+{
+ char *retbuf;
+ int len;
+ TClipboard *clip = new TClipboard();
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ len = rtf->SelText.Length() * 2;
+ retbuf = new char [ len ];
+ if (!Greek2bGreek(retbuf, rtf->SelText.c_str(), len)) {
+ clip->SetTextBuf(retbuf);
+ }
+ delete clip;
+}
+
+void __fastcall TCommentPanel::Copy1Click(TObject *Sender)
+{
+ int wordstart;
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ if (!rtf->SelLength) {
+ for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--);
+ rtf->SelStart = (wordstart > -1) ? wordstart: 0;
+ for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++);
+ rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length() - 1) - rtf->SelStart - 1;
+ }
+ rtf->CopyToClipboard();
+}
+void __fastcall TCommentPanel::DictionaryLookup1Click(TObject *Sender)
+{
+ int wordstart;
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ if (!rtf->SelLength) {
+ for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--);
+ rtf->SelStart = (wordstart > -1) ? wordstart: 0;
+ for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++);
+ rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length() - 1) - rtf->SelStart - 1;
+ }
+// DictKeyEdit->Text = Trim(rtf->SelText);
+}
+void __fastcall TCommentPanel::RTFMouseDown(TObject *Sender, TMouseButton Button,
+ TShiftState Shift, int X, int Y)
+{
+ ((TWinControl *)Sender)->SetFocus();
+}
diff --git a/apps/windoze/CBuilder5/prototype/biblecsmgr.cpp b/apps/windoze/CBuilder5/prototype/biblecsmgr.cpp
new file mode 100644
index 0000000..5532081
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/biblecsmgr.cpp
@@ -0,0 +1,88 @@
+//---------------------------------------------------------------------------
+#include "BibleCSMGR.h"
+#include <swconfig.h>
+#include <gbfrtf.h>
+#include <rwprtf.h>
+#include <rawgbf.h>
+#include <thmlrtf.h>
+//---------------------------------------------------------------------------
+BibleCSMGR::BibleCSMGR(TModInstFrm *iModInstFrm) : SWMgr(0, 0, false)
+{
+ gbftortf = new GBFRTF();
+ rwptortf = new RWPRTF();
+ thmltortf = new ThMLRTF();
+ ModInstFrm = iModInstFrm;
+ Load();
+}
+
+
+BibleCSMGR::~BibleCSMGR()
+{
+ if (gbftortf)
+ delete gbftortf;
+
+ if (rwptortf)
+ delete rwptortf;
+
+ if (thmltortf)
+ delete thmltortf;
+}
+
+
+void BibleCSMGR::AddRenderFilters(SWModule *module, ConfigEntMap &section)
+{
+ string sourceformat;
+ ConfigEntMap::iterator entry;
+
+ sourceformat = ((entry = section.find("SourceType")) != section.end()) ? (*entry).second : (string)"";
+ // Temporary: To support old module types
+// if (sourceformat.empty()) {
+// try {
+// if (dynamic_cast<RawGBF *>(module))
+// sourceformat = "GBF";
+// }
+// catch ( ... ) {}
+// }
+//
+ if (!stricmp(sourceformat.c_str(), "GBF")) {
+ module->AddRenderFilter(gbftortf);
+ }
+
+ if (!stricmp(module->Name(), "RWP"))
+ module->AddRenderFilter(rwptortf);
+
+ if (!stricmp(sourceformat.c_str(), "THML"))
+ module->AddRenderFilter(thmltortf);
+}
+
+
+char BibleCSMGR::AddModToConfig(int conffd, const char *fname)
+{
+ SWConfig modconf(fname);
+ SectionMap::iterator section;
+ AnsiString abouttext = "";
+ bool logflag;
+ TMemoryStream *RTFStream = new TMemoryStream();
+ char retval;
+
+ section = modconf.Sections.begin();
+
+ ModInstFrm->ModText->Caption = "";
+ ModInstFrm->ModText->Caption = ModInstFrm->ModText->Caption + "Found new module [ " + (*(*section).second.find("Description")).second.c_str() + " ]. Installing...";
+
+ abouttext = abouttext + "{\\fs20\\cf0 " + (*(*section).second.find("About")).second.c_str() + " }";
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(abouttext.c_str(), abouttext.Length());
+ RTFStream->Position = 0;
+ ModInstFrm->AboutText->Lines->LoadFromStream(RTFStream);
+ delete RTFStream;
+
+ ModInstFrm->ShowModal();
+
+ logflag = SWLog::systemlog->log;
+ SWLog::systemlog->log = false;
+ retval = SWMgr::AddModToConfig(conffd, fname);
+ SWLog::systemlog->log = logflag;
+
+ return retval;
+}
diff --git a/apps/windoze/CBuilder5/prototype/editentryfrm.cpp b/apps/windoze/CBuilder5/prototype/editentryfrm.cpp
new file mode 100644
index 0000000..e9404f8
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/editentryfrm.cpp
@@ -0,0 +1,332 @@
+#include <vcl.h>
+#pragma hdrstop
+#include <windows.hpp>
+#include <stdlib.h>
+#include <stdio.h>
+#include "editentryfrm.h"
+#include <swdisprtf.h>
+
+const float RulerAdj = 4.0/3.0;
+const int GutterWid = 6;
+//----------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TEditEntry *EditEntry;
+//----------------------------------------------------------------------------
+__fastcall TEditEntry::TEditEntry(TComponent *Owner)
+ : TForm(Owner)
+{
+ ResultBuf = 0;
+}
+
+
+__fastcall TEditEntry::~TEditEntry()
+{
+ if (ResultBuf)
+ delete [] ResultBuf;
+}
+
+
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::SelectionChange(TObject */*Sender*/)
+{
+ char sizebuf[6];
+
+ try {
+ FUpdating = True;
+ FirstInd->Left = int(RichEdit1->Paragraph->FirstIndent*RulerAdj)-
+ 4+GutterWid;
+ LeftInd->Left = int((RichEdit1->Paragraph->LeftIndent+
+ RichEdit1->Paragraph->FirstIndent)*RulerAdj)-
+ 4+GutterWid;
+ RightInd->Left = Ruler->ClientWidth-6-int(
+ (RichEdit1->Paragraph->RightIndent+GutterWid)*RulerAdj);
+
+ BoldButton->Down = RichEdit1->SelAttributes->Style.Contains(fsBold);
+ ItalicButton->Down = RichEdit1->SelAttributes->Style.Contains(fsItalic);
+ UnderlineButton->Down = RichEdit1->SelAttributes->Style.Contains(fsUnderline);
+
+ BulletsButton->Down = bool(RichEdit1->Paragraph->Numbering);
+
+ FontSize->Text = itoa(RichEdit1->SelAttributes->Size, sizebuf, 10);
+
+ switch((int)RichEdit1->Paragraph->Alignment)
+ { case 0: LeftAlign->Down = True; break;
+ case 1: RightAlign->Down = True; break;
+ case 2: CenterAlign->Down = True; break;
+ }
+ }
+ catch (...) {
+ FUpdating = False;
+ }
+ FUpdating = False;
+}
+//----------------------------------------------------------------------------
+TTextAttributes *__fastcall TEditEntry::CurrText(void)
+{
+ return RichEdit1->SelAttributes;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::CheckFileSave(void)
+{
+ if ( RichEdit1->Modified ) {
+ switch(MessageBox(Handle, "Save Changes?","Modify Comment",MB_YESNOCANCEL | MB_ICONQUESTION)) {
+ case ID_YES : ExtractRTF(); break;
+ case ID_CANCEL : Abort(); break;
+ default:
+ if (ResultBuf)
+ delete [] ResultBuf;
+ ResultBuf = 0;
+ break;
+ };
+ }
+}
+
+
+void __fastcall TEditEntry::SetupRuler(void)
+{ int iCtr = 1;
+ char sTmp[201];
+ while (iCtr < 200) {
+ sTmp[iCtr] = 9;
+ iCtr++;
+ sTmp[iCtr] = '|';
+ iCtr++;
+ }
+ Ruler->Caption = (AnsiString)sTmp;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::SetEditRect(void)
+{ TRect Rct = Rect(GutterWid, 0, RichEdit1->ClientWidth-GutterWid,
+ ClientHeight);
+ SendMessage(RichEdit1->Handle, EM_SETRECT, 0, long(&Rct));
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::FormCreate(TObject* /*Sender*/)
+{ Application->OnHint = &ShowHint;
+ SetupRuler();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::ShowHint(TObject* /*Sender*/)
+{ StatusBar->SimpleText = Application->Hint;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::EditUndoClick(TObject* /*Sender*/)
+{ if ( RichEdit1->HandleAllocated() )
+ SendMessage(RichEdit1->Handle, EM_UNDO, 0, 0);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::EditCutClick(TObject* /*Sender*/)
+{ RichEdit1->CutToClipboard();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::EditCopyClick(TObject* /*Sender*/)
+{ RichEdit1->CopyToClipboard();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::EditPasteClick(TObject* /*Sender*/)
+{ RichEdit1->PasteFromClipboard();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::RulerResize(TObject* /*Sender*/)
+{ RulerLine->Width = (int)Ruler->ClientWidth - (RulerLine->Left*2);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::FormResize(TObject* Sender)
+{ SetEditRect();
+ SelectionChange(Sender);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::FormPaint(TObject* /*Sender*/)
+{ SetEditRect();
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::BoldButtonClick(TObject* /*Sender*/)
+{ if ( !FUpdating )
+ { if ( BoldButton->Down )
+ CurrText()->Style = CurrText()->Style << fsBold;
+ else
+ CurrText()->Style = CurrText()->Style >> fsBold;
+ }
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::ItalicButtonClick(TObject* /*Sender*/)
+{ if ( !FUpdating )
+ {
+ if ( ItalicButton->Down )
+ CurrText()->Style = CurrText()->Style << fsItalic;
+ else
+ CurrText()->Style = CurrText()->Style >> fsItalic;
+ }
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::UnderlineButtonClick(TObject* /*Sender*/)
+{
+ if ( !FUpdating ) {
+ if ( UnderlineButton->Down )
+ CurrText()->Style = CurrText()->Style << fsUnderline;
+ else CurrText()->Style = CurrText()->Style >> fsUnderline;
+ }
+}
+
+
+void __fastcall TEditEntry::FontSizeChange(TObject* /*Sender*/)
+{
+ int fontsize = atoi(FontSize->Text.c_str());
+
+ if ((!FUpdating) && (fontsize)) {
+ if (fontsize < 1) {
+ ShowMessage("Please Enter a Number betweek 1 and 1638");
+ FontSize->Text = 1;
+ }
+ else if (fontsize > 1638) {
+ ShowMessage("Please Enter a Number betweek 1 and 1638");
+ FontSize->Text = 1638;
+ }
+ CurrText()->Size = atoi(FontSize->Text.c_str());
+ }
+}
+
+
+void __fastcall TEditEntry::AlignClick(TObject* Sender)
+{
+ if ( !FUpdating ) {
+ TControl *oAliBtn = (TControl*)(Sender);
+ RichEdit1->Paragraph->Alignment = (TAlignment)oAliBtn->Tag;
+ }
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::BulletsButtonClick(TObject* /*Sender*/)
+{ if ( !FUpdating )
+ RichEdit1->Paragraph->Numbering = (TNumberingStyle)BulletsButton->Down;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::FormCloseQuery(TObject* /*Sender*/,
+ bool & CanClose)
+{ try {
+ CheckFileSave();
+ }
+ catch (...) {
+ CanClose = False;
+ }
+}
+//----------------------------------------------------------------------------
+
+//***************************
+//***Ruler Indent Dragging***
+//***************************
+
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::RulerItemMouseDown(TObject * Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{ TLabel * oTmpLabel = (TLabel *)Sender;
+ FDragOfs = oTmpLabel->Width / 2;
+ oTmpLabel->Left = oTmpLabel->Left+X-FDragOfs;
+ FDragging = True;
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::RulerItemMouseMove(TObject *Sender, TShiftState Shift, int X, int /*Y*/) {
+ if (FDragging) {
+ TLabel *oTmpLabel = (TLabel *)Sender;
+ oTmpLabel->Left = oTmpLabel->Left+X-FDragOfs;
+ oTmpLabel->Left -= oTmpLabel->Left % 10;
+ }
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::FirstIndMouseUp(TObject *Sender, TMouseButton
+ Button, TShiftState Shift, int X, int Y)
+{ FDragging = False;
+ RichEdit1->Paragraph->FirstIndent = int((FirstInd->Left+FDragOfs-GutterWid) / RulerAdj);
+ LeftIndMouseUp(Sender, Button, Shift, X, Y);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::LeftIndMouseUp(TObject *Sender, TMouseButton
+ /*Button*/, TShiftState /*Shift*/, int /*X*/, int /*Y*/)
+{ FDragging = False;
+ RichEdit1->Paragraph->LeftIndent = int((LeftInd->Left+FDragOfs-GutterWid)/
+ RulerAdj)-RichEdit1->Paragraph->FirstIndent;
+ SelectionChange(Sender);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::RightIndMouseUp(TObject *Sender, TMouseButton
+ /*Button*/, TShiftState /*Shift*/, int /*X*/, int /*Y*/)
+{ FDragging = False;
+ RichEdit1->Paragraph->RightIndent =
+ int((Ruler->ClientWidth-RightInd->Left+FDragOfs-2) /
+ RulerAdj)-2*GutterWid;
+ SelectionChange(Sender);
+}
+//----------------------------------------------------------------------------
+void __fastcall TEditEntry::FormActivate(TObject *Sender)
+{
+ System::AnsiString newtext, tmptext;
+
+ if (Module) {
+ TMemoryStream *RTFStream = new TMemoryStream();
+ newtext = RTFDisplay->RTFHeader;
+ Module->Error(); // clear error;
+ newtext = newtext + "\\pard \\nowidctlpar \\cf0 ";
+ (char *)*Module; // force key to snap to entry before pulling out the text of the key
+ tmptext = (char *)*Module;
+
+ newtext = newtext + RTFDisplay->RTFVersePre + " " + tmptext + RTFDisplay->RTFVersePost;
+ newtext = newtext + RTFDisplay->RTFTrailer;
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
+ RTFStream->Position = 0;
+ RichEdit1->Lines->LoadFromStream(RTFStream);
+ delete RTFStream;
+ }
+ SelectionChange(this);
+ RichEdit1->SetFocus();
+ if (ResultBuf)
+ delete [] ResultBuf;
+ ResultBuf = 0;
+}
+//---------------------------------------------------------------------
+
+void TEditEntry::ExtractRTF()
+{
+ System::AnsiString newtext, tmptext;
+ TMemoryStream *RTFStream = new TMemoryStream();
+ char *tmpbuf, *datastart;
+
+ RTFStream->Clear();
+ RichEdit1->Lines->SaveToStream(RTFStream);
+ RTFStream->Position = 0;
+ if (ResultBuf)
+ delete [] ResultBuf;
+ tmpbuf = new char [ RTFStream->Size + 1];
+ RTFStream->ReadBuffer(tmpbuf, RTFStream->Size);
+ tmpbuf[RTFStream->Size] = 0;
+ strtok(strstr(tmpbuf, "colortbl"), "}");
+ datastart = strtok(NULL, "");
+ ResultBuf = new char [ strlen(datastart) + 2 ];
+ ResultBuf[0] = '{';
+ strcpy(ResultBuf+1, datastart);
+ delete [] tmpbuf;
+ delete RTFStream;
+ //-------- Change all fonts to \f1
+ for (int i = 0; i < strlen(ResultBuf)-4; i++) {
+ if (ResultBuf[i] == '\\') {
+ if (ResultBuf[i+1] == '\\') { // skip a real '\' character
+ i += 1;
+ continue;
+ }
+ if (ResultBuf[i+1] == 'f') {
+ if (isdigit(ResultBuf[i+2])) {
+ ResultBuf[i+2] = '1';
+ if (isdigit(ResultBuf[i+3])) {
+ memmove(&ResultBuf[i+3], &ResultBuf[i+4], strlen(&ResultBuf[i+3]));
+ }
+ }
+ }
+ }
+ }
+}
+
+
+__fastcall TCharsetObject::TCharsetObject(int FCharset)
+ : TObject()
+{
+ Charset = FCharset;
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/prototype/mainfrm.cpp b/apps/windoze/CBuilder5/prototype/mainfrm.cpp
new file mode 100644
index 0000000..cfe753e
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/mainfrm.cpp
@@ -0,0 +1,825 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#include <vcl/clipbrd.hpp>
+#pragma hdrstop
+
+#include "mainfrm.h"
+#include "swdisprtfchap.h"
+#include "searchfrm.h"
+#include "swwinlog.h"
+#include "AboutBoxfrm.h"
+#include "ModInstForm.h"
+#include "biblecsmgr.h"
+#include "Greek2Greek.h"
+#include "bookmarkfrm.h"
+#include "optionfrm.h"
+#include "vrslstfrm.h"
+#include <utilstr.h>
+#include <filemgr.h>
+#include "editentryfrm.h"
+#include "versesel.h"
+#include "ModTabPanel.h"
+
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TForm1 *Form1;
+//---------------------------------------------------------------------------
+
+
+__fastcall TForm1::TForm1(TComponent* Owner)
+ : TForm(Owner)
+{
+ optionsconf = new SWConfig("./options.conf");
+
+ Lookup->Text = "[ SWORD DDE Lookup ]";
+ Search->Text = "[ SWORD DDE Search ]";
+ Application->OnHint = DisplayHint;
+}
+
+void __fastcall TForm1::DisplayHint(TObject* Sender)
+{
+ StatusBar1->SimpleText = Application->Hint;
+}
+
+//---------------------------------------------------------------------------
+__fastcall TForm1::~TForm1()
+{
+ list <SWDisplay *>::iterator it;
+ int loop;
+
+ if (mainmgr)
+ delete mainmgr;
+ for (it = displays.begin(); it != displays.end(); it++)
+ delete *it;
+ if (layoutconf)
+ delete layoutconf;
+
+ if (optionsconf)
+ delete optionsconf;
+
+// for (loop = 0; loop < 10; loop++) {
+// if (ctrlstates[loop]);
+// delete ctrlstates[loop];
+// }
+}
+//---------------------------------------------------------------------------
+void TForm1::BuildRTFHeader(char *buf, char *font, int max)
+{
+ char buf1[1024], buf2[1024];
+ SectionMap::iterator sit;
+
+ sprintf(buf1, "{\\rtf1\\ansi");
+ if (font)
+ sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 %s;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f2\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f3\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}", font);
+ else sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}");
+ strcat(buf1, buf2);
+
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) {
+ sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red%d\\green%d\\blue%d;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;}",
+ atoi((*sit).second["CurrentVSColorRed"].c_str()),
+ atoi((*sit).second["CurrentVSColorGreen"].c_str()),
+ atoi((*sit).second["CurrentVSColorBlue"].c_str()));
+ }
+ else sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;}");
+ strcat(buf1, buf2);
+ memset(buf, 0, max);
+ strncpy(buf, buf1, max);
+}
+
+char TForm1::CreateTextPane(SWModule *mod, char *font) {
+ TTabSheet *newtab = new TTabSheet(this);
+ SWDispRTFChap *newrtf = new SWDispRTFChap(this);
+ TTextPanel *panel = new TTextPanel(this, mod, font);
+ char buf[512];
+ SectionMap::iterator sit;
+
+ newtab->Caption = mod->Name();
+ newtab->Hint = mod->Description();
+// newtab->PageControl = PageControl1;
+ panel->Parent = newtab;
+/*
+ newrtf->Align = alClient;
+ newrtf->ScrollBars = ssVertical;
+ newrtf->ReadOnly = true;
+ newrtf->PopupMenu = (strcmp(mod->Name(), "N27U4")) ? PopupMenu2 : PopupMenu1;
+ newrtf->OnMouseDown = RTFMouseDown;
+
+ BuildRTFHeader(buf, font, 512);
+ newrtf->RTFHeader = buf;
+
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) {
+ newrtf->MarkCurrentVerse = (atoi((*sit).second["AutoVSColor"].c_str())) ? true:false;
+ }
+
+ mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf)));
+ mod->SetKey(DefaultVSKey);
+*/
+ return 0;
+}
+//---------------------------------------------------------------------------
+char TForm1::CreateCommentPane(SWModule *mod) {
+ TTabSheet *newtab = new TTabSheet(this);
+ TWinControl *newrtf;
+
+ if (mainmgr->config->Sections[mod->Name()]["ModDrv"] == "HREFCom") {
+// if (mainmgr->config->Sections[mod->Name()]["External"] == "1") {
+ newrtf = new TPanel(this);
+ ((TPanel *)newrtf)->Caption = "Syncronizing to External Viewer";
+ mod->Disp(*displays.insert(displays.begin(), new DispExternal()));
+/*
+ }
+ else {
+ // newrtf = new THTML(this->Handle);
+ // newrtf = new SWDispRTF(this);
+ newrtf = HTML1;
+ newrtf->Visible = true;
+ mod->Disp(*displays.insert(displays.begin(), new HREFDisp((THTML *)newrtf)));
+ // mod->Disp(*displays.insert(displays.begin(), new RTFDisp((SWDispRTF *)newrtf)));
+ }
+*/
+ }
+ else {
+ newrtf = new SWDispRTF(this);
+ mod->Disp(*displays.insert(displays.begin(), new RTFDisp((SWDispRTF *)newrtf)));
+ ((SWDispRTF *)newrtf)->ScrollBars = ssVertical;
+ ((SWDispRTF *)newrtf)->ReadOnly = true;
+ if (mainmgr->config->Sections[mod->Name()]["ModDrv"] == "RawFiles") {
+ ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu3;
+ ((SWDispRTF *)newrtf)->ExpandNewLine = false;
+ }
+ else ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2;
+ ((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown;
+ }
+
+ newtab->Caption = mod->Name();
+ newtab->Hint = mod->Description();
+ newtab->PageControl = PageControl2;
+ newrtf->Parent = newtab;
+ newrtf->Align = alClient;
+
+ mod->SetKey(DefaultVSKey);
+ return 0;
+}
+//---------------------------------------------------------------------------
+char TForm1::CreateLDPane(SWModule *mod) {
+ TTabSheet *newtab = new TTabSheet(this);
+ SWDispRTF *newrtf = new SWDispRTF(this);
+
+ newtab->Caption = mod->Name();
+ newtab->Hint = mod->Description();
+ newtab->PageControl = PageControl3;
+ newrtf->Parent = newtab;
+ newrtf->Align = alClient;
+ newrtf->ScrollBars = ssVertical;
+ newrtf->ReadOnly = true;
+ newrtf->PopupMenu = PopupMenu2;
+ newrtf->OnMouseDown = RTFMouseDown;
+
+ mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf)));
+ mod->SetKey(DefaultStrKey);
+ return 0;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::PageControl1Change(TObject *Sender)
+{
+// RefreshActiveSheet(PageControl1);
+// Form1->ActiveControl = PageControl1;
+}
+//---------------------------------------------------------------------------
+void TForm1::RefreshActiveSheet(TPageControl *pc)
+{
+ ModMap::iterator it;
+
+ it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ (*it).second->Display();
+ if (logmodstate)
+ modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, (*it).second->KeyText()));
+ }
+}
+
+
+void TForm1::TextKeyChanged()
+{
+ cbBook->ItemIndex = cbBook->Items->IndexOf(DefaultVSKey.books[DefaultVSKey.Testament()-1][DefaultVSKey.Book()-1].name);
+ CHBox->Text = DefaultVSKey.Chapter();
+ VSBox->Text = DefaultVSKey.Verse();
+ freeHandLookup->Text = (const char *)DefaultVSKey;
+ textTabs->RefreshActiveSheet();
+ logmodstate = false; // only log state once
+ RefreshActiveSheet(PageControl2);
+ logmodstate = true;
+}
+
+
+void __fastcall TForm1::btnLookupClick(TObject *Sender)
+{
+ if (!(StrToInt(CHBox->Text)) || (!StrToInt(VSBox->Text)))
+ DefaultVSKey.AutoNormalize(0);
+
+ if (StrToInt(CHBox->Text) < 0)
+ CHBox->Text = StrToInt(CHBox->Text) + 1;
+ if (StrToInt(VSBox->Text) < 0)
+ VSBox->Text = StrToInt(VSBox->Text) + 1;
+
+ DefaultVSKey = (cbBook->Text + " " + CHBox->Text + ":" + VSBox->Text).c_str();
+ TextKeyChanged();
+ DefaultVSKey.AutoNormalize(1);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::PageControl2Change(TObject *Sender)
+{
+ RefreshActiveSheet(PageControl2);
+ Form1->ActiveControl = PageControl2;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::DictKeyEditChange(TObject *Sender)
+{
+ if (DictKeyEdit->Modified) {
+ DefaultStrKey = DictKeyEdit->Text.c_str();
+ RefreshActiveSheet(PageControl3);
+ DictKeyEdit->Modified = false;
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::PageControl3Change(TObject *Sender)
+{
+ RefreshActiveSheet(PageControl3);
+ Form1->ActiveControl = PageControl3;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::NewSearchWindow1Click(TObject *Sender)
+{
+ Form2->Show();
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Exit1Click(TObject *Sender)
+{
+ Close();
+}
+
+void __fastcall TForm1::About1Click(TObject *Sender)
+{
+ AboutBox->ShowModal();
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::DictionaryLookup1Click(TObject *Sender)
+{
+ int wordstart;
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ if (!rtf->SelLength) {
+ for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--);
+ rtf->SelStart = (wordstart > -1) ? wordstart: 0;
+ for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++);
+ rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length() - 1) - rtf->SelStart - 1;
+ }
+ DictKeyEdit->Text = Trim(rtf->SelText);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::SaveLayout1Click(TObject *Sender)
+{
+ ConfigEntMap sit;
+
+ sit = layoutconf->Sections["Screen"];
+ sit["MainTop"] = IntToStr(Form1->Top).c_str();
+ sit["MainLeft"] = IntToStr(Form1->Left).c_str();
+ sit["MainHeight"] = IntToStr(Form1->Height).c_str();
+ sit["MainWidth"] = IntToStr(Form1->Width).c_str();
+ sit["TextComHeight"] = IntToStr(pnlTextCom->Height).c_str();
+ sit["TextWidth"] = IntToStr(pnlText->Width).c_str();
+ layoutconf->Sections["Screen"] = sit;
+ layoutconf->Save();
+}
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FormCreate(TObject *Sender)
+{
+ ModMap::iterator it;
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit;
+ AnsiString s1;
+ char *font;
+ int val;
+ int loop;
+ int maxFiles;
+
+ mainmgr = new BibleCSMGR(ModInstFrm);
+// textTabs = new TModTabPanel(this, mainmgr, "Biblical Texts");
+// textTabs->Align = alClient;
+// textTabs->Parent = pnlText;
+// logmodstate = true;
+// freshdict = true;
+// if ((maxFiles = atoi(optionsconf->Sections["System"]["MaxFiles"].c_str()))) {
+// FileMgr::systemFileMgr.maxFiles = maxFiles;
+// }
+
+// DefaultVSKey = TOP;
+// DefaultVSKey = "Genesis 1:1";
+// cbBook->Clear();
+/*
+ while (!DefaultVSKey.Error()) {
+ s1 = (const char *)DefaultVSKey;
+ s1.SetLength(s1.Length() - 4);
+ cbBook->Items->Add(s1);
+ DefaultVSKey.Book(DefaultVSKey.Book() + 1);
+ }
+ cbBook->ItemIndex = cbBook->Items->IndexOf("James");
+
+ DefaultVSKey.Persist(1); // when set to a module, make the module hold on to this actual key and not a copy
+ DefaultVSKey = "James 1:19"; // set to our standard starting verse
+ DefaultStrKey.Persist(1);
+ DefaultStrKey = "";
+ Hint = "";
+ ShowHint = true;
+ Application->ShowHint = true;
+ if (SWLog::systemlog)
+ delete SWLog::systemlog;
+ SWLog::systemlog = new SWWinLog(this->Handle); // set the system logger to our MSWindows specific SWLog class
+ layoutconf = new SWConfig("./layout.conf");
+
+ if ((sit = layoutconf->Sections.find("Screen")) != layoutconf->Sections.end()) {
+ if (val = atoi((*sit).second["MainTop"].c_str()))
+ Form1->Top = val;
+ if (val = atoi((*sit).second["MainLeft"].c_str()))
+ Form1->Left = val;
+ if (val = atoi((*sit).second["MainHeight"].c_str()))
+ Form1->Height = val;
+ if (val = atoi((*sit).second["MainWidth"].c_str()))
+ Form1->Width = val;
+ if (val = atoi((*sit).second["TextComHeight"].c_str()))
+ pnlTextCom->Height = val;
+ if (val = atoi((*sit).second["TextWidth"].c_str()))
+ pnlText->Width = val;
+ }
+
+ for (loop = 0; loop < 10; loop++)
+ ctrlstates.insert(ctrlstates.begin(), 0);
+
+ ImageList1->Add(BackBtnImage->Picture->Bitmap, NULL);
+ ImageList1->Add(SearchBtnImage->Picture->Bitmap, NULL);
+ ImageList2->Add(BookmarkBtnImage->Picture->Bitmap, NULL);
+*/
+}
+
+
+//void __fastcall TForm1::CreateWnd() {
+// TForm::CreateWnd();
+
+/*
+ for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) {
+ if (!strcmp((*it).second->Type(), "Biblical Texts")) {
+ font = 0;
+ if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) {
+ if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) {
+ font = (char *)(*eit).second.c_str();
+ }
+ }
+ CreateTextPane((*it).second, font);
+ }
+ if (!strcmp((*it).second->Type(), "Commentaries"))
+ CreateCommentPane((*it).second);
+ if (!strcmp((*it).second->Type(), "Lexicons / Dictionaries"))
+ CreateLDPane((*it).second);
+ }
+*/
+//}
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::LookupPokeData(TObject *Sender)
+{
+ char buf[255];
+ char *token;
+ ModMap::iterator it;
+
+ strncpy(buf, Lookup->Text.c_str(), 254);
+ buf[254] = 0;
+ token = strtok(buf, " ");
+ if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) {
+ token = strtok(NULL, "");
+ (*it).second->SetKey(token);
+ Lookup->Text = (const char *)(*(*it).second);
+ }
+ else Lookup->Text = "";
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::SearchPokeData(TObject *Sender)
+{
+ char buf[255];
+ char *token;
+ ModMap::iterator it;
+ AnsiString retval = "";
+
+ strncpy(buf, Search->Text.c_str(), 254);
+ buf[254] = 0;
+ token = strtok(buf, " ");
+ if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) {
+ token = strtok(NULL, "");
+ ListKey &results = (*it).second->Search(token, REG_ICASE);
+ while (!results.Error()) {
+ retval = retval + (const char *)results + "; ";
+ results++;
+ }
+ Search->Text = retval;
+ }
+ else Search->Text = "";
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::UpDown3Click(TObject *Sender, TUDBtnType Button)
+{
+ ModMap::iterator it;
+
+ it = mainmgr->Modules.find(PageControl3->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ if (Button == btNext)
+ (*((*it).second))++;
+ else (*((*it).second))--;
+ DictKeyEdit->Text = ((*it).second)->KeyText();
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::UpDown1Click(TObject *Sender, TUDBtnType Button)
+{
+ btnLookupClick(Sender);
+}
+//---------------------------------------------------------------------------
+
+void TForm1::RestoreState(ModState *state)
+{
+ if (state) {
+ state->pc->ActivePage = state->ap;
+// if ((state->pc == PageControl1) || (state->pc == PageControl2)) {
+// DefaultVSKey = state->key;
+// TextKeyChanged();
+// }
+ if (state->pc == PageControl3) {
+ DictKeyEdit->Text = (const char *)state->key;
+ }
+ if (state->pc->ActivePage->ControlCount)
+ Form1->ActiveControl = (TWinControl *)state->pc->ActivePage->Controls[0];
+ }
+}
+
+
+void __fastcall TForm1::BackbtnClick(TObject *Sender)
+{
+ list <ModState *>::iterator it;
+
+ logmodstate = false;
+ it = modstates.begin();
+ if (it != modstates.end()) {
+ it++;
+
+ if (it != modstates.end()) {
+ RestoreState(*it);
+ delete *modstates.begin();
+ modstates.erase(modstates.begin(), it);
+ }
+ }
+ logmodstate = true;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Button1Click(TObject *Sender)
+{
+/*
+ list <ModState *>::iterator it;
+ ListBox1->Clear();
+ for (it = modstates.begin(); it != modstates.end(); it++) {
+ ListBox1->Items->Add((*it)->ap->Caption.c_str());
+ }
+*/
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::CopyasBGreekTransliteration1Click(TObject *Sender)
+{
+ char *retbuf;
+ int len;
+ TClipboard *clip = new TClipboard();
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ len = rtf->SelText.Length() * 2;
+ retbuf = new char [ len ];
+ if (!Greek2bGreek(retbuf, rtf->SelText.c_str(), len)) {
+ clip->SetTextBuf(retbuf);
+ }
+ delete clip;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Copy1Click(TObject *Sender)
+{
+ int wordstart;
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ if (!rtf->SelLength) {
+ for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--);
+ rtf->SelStart = (wordstart > -1) ? wordstart: 0;
+ for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++);
+ rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length() - 1) - rtf->SelStart - 1;
+ }
+ rtf->CopyToClipboard();
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::BookmarkItemClick(TObject *Sender)
+{
+ TMenuItem *menuchoice = (TMenuItem *)Sender;
+ DefaultVSKey = menuchoice->Caption.c_str();
+ TextKeyChanged();
+}
+
+void __fastcall TForm1::AddBookmark1Click(TObject *Sender)
+{
+// TMenuItem *newitem;
+
+ Bookmarksfrm->bmtree->Items->AddChild(Bookmarksfrm->bmtree->Items->Item[0], (const char *)DefaultVSKey);
+}
+
+void TForm1::AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree)
+{
+ TMenuItem *newitem;
+
+ for (tree = tree->getFirstChild(); tree; tree = tree->getNextSibling()) {
+ newitem = new TMenuItem(menu);
+ newitem->Caption = tree->Text;
+ if (!tree->getFirstChild())
+ newitem->OnClick = BookmarkItemClick;
+ item->Add(newitem);
+ AddSectionToMenu(menu, newitem, tree);
+ }
+}
+
+void TForm1::RefreshBookmarksMenu(TMenu *menu, TTreeView *treeview)
+{
+ TMenuItem *newitem;
+ TTreeNode *tree = 0;
+
+ if (treeview->Items->Count)
+ tree = treeview->Items->Item[0];
+
+ while (menu->Items->Count > 3)
+ menu->Items->Delete(3);
+
+ for (;tree;tree = tree->getNextSibling()) {
+ newitem = new TMenuItem(menu);
+ newitem->Caption = tree->Text;
+ menu->Items->Add(newitem);
+ AddSectionToMenu(menu, newitem, tree);
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::BookmarkbtnClick(TObject *Sender)
+{
+ TPoint menup;
+ TPoint point;
+ point.x = 0;
+ point.y = Bookmarkbtn->Height;
+ menup = Bookmarkbtn->ClientToScreen(point);
+ RefreshBookmarksMenu(BookmarkPopup, Bookmarksfrm->bmtree);
+ BookmarkPopup->Popup(menup.x, menup.y);
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::EditBookmarks1Click(TObject *Sender)
+{
+ Bookmarksfrm->Show();
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key,
+ TShiftState Shift)
+{
+ char buf[5];
+ int val;
+ ModMap::iterator it;
+ TPageControl *pc = textTabs->pageControl;
+
+ if ((Shift.Contains(ssCtrl)) && (!Shift.Contains(ssAlt))) {
+ if ((Key >= '0') && (Key <= '9')) {
+ sprintf(buf, "%c", Key);
+ val = atoi(buf);
+
+ if (!Shift.Contains(ssShift)) {
+ if ((Screen->ActiveControl == PageControl2) || (IsChild(PageControl2->Handle, Screen->ActiveControl->Handle)))
+ pc = PageControl2;
+ if ((Screen->ActiveControl == PageControl3) || (IsChild(PageControl3->Handle, Screen->ActiveControl->Handle)))
+ pc = PageControl3;
+
+ it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
+ if (it != mainmgr->Modules.end()) {
+ if (ctrlstates[val])
+ delete ctrlstates[val];
+
+ ctrlstates[val] = new ModState(pc, pc->ActivePage, (*it).second->KeyText());
+ }
+ }
+ else RestoreState(ctrlstates[val]);
+ }
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Options1Click(TObject *Sender)
+{
+ ModMap::iterator it;
+ SectionMap::iterator sit;
+ ConfigEntMap emap;
+ int color;
+
+ if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) {
+ Optionsfrm->CurrentVSColor->Brush->Color = atoi((*sit).second["CurrentVSColorRed"].c_str())
+ | (atoi((*sit).second["CurrentVSColorGreen"].c_str()) << 8)
+ | (atoi((*sit).second["CurrentVSColorBlue"].c_str()) << 16);
+ Optionsfrm->AutoVSColor->Checked = ((atoi((*sit).second["AutoVSColor"].c_str()))?true:false);
+ }
+
+ if ((sit = optionsconf->Sections.find("Bookmarks")) != optionsconf->Sections.end()) {
+ Optionsfrm->AutoBMPersonal->Checked = ((atoi((*sit).second["AutoSavePersonal"].c_str()))?true:false);
+ Optionsfrm->AutoBMOther->Checked = ((atoi((*sit).second["AutoSaveOther"].c_str()))?true:false);
+ }
+
+ if (Optionsfrm->ShowModal() == mrOk) {
+ emap = optionsconf->Sections["Appearance"];
+ color = Optionsfrm->CurrentVSColor->Brush->Color;
+ emap["CurrentVSColorRed"] = IntToStr(color & 0xFF).c_str();
+ emap["CurrentVSColorGreen"] = IntToStr((color >> 8) & 0xFF).c_str();
+ emap["CurrentVSColorBlue"] = IntToStr((color >> 16) & 0xFF).c_str();
+ emap["AutoVSColor"] = IntToStr((Optionsfrm->AutoVSColor->Checked)?1:0).c_str();
+ optionsconf->Sections["Appearance"] = emap;
+
+ emap = optionsconf->Sections["Bookmarks"];
+ emap["AutoSavePersonal"] = IntToStr((Optionsfrm->AutoBMPersonal->Checked)?1:0).c_str();
+ emap["AutoSaveOther"] = IntToStr((Optionsfrm->AutoBMOther->Checked)?1:0).c_str();
+ optionsconf->Sections["Bookmarks"] = emap;
+
+ optionsconf->Save();
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::cbBookChange(TObject *Sender)
+{
+ CHBox->Text = "1";
+ VSBox->Text = "1";
+ if (Screen->ActiveControl == cbBook)
+ btnLookupClick(Sender);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::PopupMenuPopup(TObject *Sender)
+{
+
+ int versestart, verseend;
+ TMenuItem * newitem;
+ TPopupMenu *menu = (TPopupMenu *)Sender;
+ int staticMenuItemsCount = 0;
+
+ if (menu == PopupMenu1)
+ staticMenuItemsCount = 3;
+ else if (menu == PopupMenu2)
+ staticMenuItemsCount = 2;
+ else if (menu == PopupMenu3)
+ staticMenuItemsCount = 6;
+
+ while (menu->Items->Count > staticMenuItemsCount)
+ menu->Items->Delete(staticMenuItemsCount);
+
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ if (!rtf->SelLength) {
+ for (versestart = rtf->SelStart; ((versestart)&&(rtf->Text[versestart] != '#')); versestart--);
+ if (versestart) {
+ for (verseend = versestart; ((verseend < rtf->Text.Length())&&(rtf->Text[verseend] != '|')); verseend++);
+ if ((verseend < rtf->Text.Length()) && (verseend > rtf->SelStart)) {
+ int len = (verseend - versestart) + 1;
+ char *buf = new char [ len + 1 ];
+ memset(buf, 0 , len + 1);
+ strncpy(buf, &rtf->Text.c_str()[versestart], len - 2); // strip the # and | from the string
+ tmpVerseList = DefaultVSKey.ParseVerseList(buf, DefaultVSKey);
+
+ ModMap::iterator target;
+ target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ char *keytext = 0; // check for and remove return at end of keytext
+ stdstr(&keytext, (*(*target).second).KeyText());
+ if (keytext[strlen(keytext)-1] == '\r')
+ keytext[strlen(keytext)-1] = 0;
+
+ tmpVerseListCaption = String("VerseList from- ") + (*target).first.c_str() + ": " + keytext;
+ delete [] keytext; // ---------------------------------
+ }
+ delete [] buf;
+ newitem = new TMenuItem(menu);
+ newitem->Caption = "-";
+ menu->Items->Add(newitem);
+ newitem = new TMenuItem(menu);
+ newitem->Caption = "Create Verse List";
+ newitem->Hint = "Create a New Verse List Window";
+ newitem->Default = true;
+ newitem->OnClick = createVerseList;
+ menu->Items->Add(newitem);
+ versestart = 3;
+ while (!tmpVerseList.Error()) {
+ versestart++;
+ newitem = new TMenuItem(menu);
+ newitem->Caption = (const char *)tmpVerseList;
+ newitem->OnClick = BookmarkItemClick;
+ if (!(versestart%15))
+ newitem->Break = mbBreak;
+ menu->Items->Add(newitem);
+ tmpVerseList++;
+ }
+ }
+ }
+ }
+
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::createVerseList(TObject *Sender)
+{
+ TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList);
+ tmpForm->Caption = tmpVerseListCaption;
+ tmpForm->Show();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::freeHandLookupKeyPress(TObject *Sender, char &Key)
+{
+ if (Key == '\r') {
+ ListKey tmpVerseList = DefaultVSKey.ParseVerseList(freeHandLookup->Text.c_str(), DefaultVSKey);
+ if (tmpVerseList.Count() > 1) {
+ TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList);
+ tmpForm->Caption = "User Verse List";
+ tmpForm->Show();
+ }
+ if (tmpVerseList.Count()) {
+ tmpVerseList = TOP;
+ DefaultVSKey = tmpVerseList;
+ TextKeyChanged();
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::RTFMouseDown(TObject *Sender, TMouseButton Button,
+ TShiftState Shift, int X, int Y)
+{
+ ((TWinControl *)Sender)->SetFocus();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::EditEntry1Click(TObject *Sender)
+{
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ SWModule *module = 0;
+// EditEntry->RichEdit1->Text = rtf->Text;
+ ModMap::iterator target;
+ target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ EditEntry->Module = module = (*target).second;
+ EditEntry->RTFDisplay = rtf;
+ }
+ else EditEntry->Module = module = 0;
+ EditEntry->ShowModal();
+ if (EditEntry->ResultBuf) {
+ if (module)
+// DictKeyEdit->Text = EditEntry->ResultBuf; // for testing purposes
+ *module << EditEntry->ResultBuf;
+ }
+ RefreshActiveSheet(PageControl2);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::DeleteEntry1Click(TObject *Sender)
+{
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ SWModule *module = 0;
+ ModMap::iterator target;
+
+ target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ module = (*target).second;
+ module->deleteEntry();
+ }
+ RefreshActiveSheet(PageControl2);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::LinktoVerse1Click(TObject *Sender)
+{
+ if (VerseSelFrm->ShowModal() == mrOk) {
+ SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
+ SWModule *module = 0;
+ ModMap::iterator target;
+ SWKey *linkkey = new VerseKey(VerseSelFrm->Panel2->Caption.c_str());
+
+ target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ module = (*target).second;
+ *module << linkkey;
+ }
+ RefreshActiveSheet(PageControl2);
+ }
+}
+//---------------------------------------------------------------------------
+
+
+
diff --git a/apps/windoze/CBuilder5/prototype/mainfrm.h b/apps/windoze/CBuilder5/prototype/mainfrm.h
new file mode 100644
index 0000000..c24ca52
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/mainfrm.h
@@ -0,0 +1,238 @@
+//---------------------------------------------------------------------------
+#ifndef mainfrmH
+#define mainfrmH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ExtCtrls.hpp>
+#include <vcl\ComCtrls.hpp>
+#include <swmgr.h>
+#include <swtext.h>
+#include <strkey.h>
+#include <regex.h>
+#include <listkey.h>
+#include "swdisprtfchap.h"
+#include <vcl\Buttons.hpp>
+#include <vcl\Menus.hpp>
+#include <vcl\DdeMan.hpp>
+//#include <NMHTML.hpp>
+#include <OleCtrls.hpp>
+#include <ToolWin.hpp>
+//#include <vcl\isp.hpp>
+#include <shellapi.h>
+#include <Graphics.hpp>
+#include <ImgList.hpp>
+#include <list>
+#include <vector>
+#include "TextPanel.h"
+#include "ModTabPanel.h"
+
+class RTFDisp : public SWDisplay {
+ SWDispRTF *edit;
+public:
+ RTFDisp(SWDispRTF *iedit) { edit = iedit; }
+ RTFDisp() {}
+ char Display(SWModule &imodule) {
+ edit->Display(imodule);
+ }
+};
+
+/*
+class HREFDisp : public SWDisplay {
+ THTML *edit;
+public:
+ HREFDisp(THTML *iedit) { edit = iedit; }
+ HREFDisp() {}
+ char Display(SWModule &imodule) {
+ edit->RequestDoc((char *)imodule);
+ }
+};
+*/
+
+class DispExternal : public SWDisplay {
+public:
+ DispExternal() {}
+ char Display(SWModule &imodule) {
+ SHELLEXECUTEINFO info;
+ info.cbSize = sizeof(SHELLEXECUTEINFO);
+ info.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_CLASSNAME;
+ info.hwnd = GetFocus();
+ info.lpVerb = "open";
+ info.lpFile = (char *)imodule;
+ info.lpParameters = NULL;
+ info.lpDirectory = NULL;
+ info.nShow = 0;
+// info.lpClass = ".html";
+ ShellExecuteEx(&info);
+// ShellExecute(edit->Handle, "open", (char *)imodule, NULL, NULL, SW_SHOWNORMAL);
+ }
+};
+
+
+class ModState {
+public:
+ ModState(TPageControl *ipc, TTabSheet *iap, SWKey ikey) { pc = ipc; ap = iap; key = ikey; }
+ ModState();
+ TPageControl *pc;
+ TTabSheet* ap;
+ SWKey key;
+};
+
+//---------------------------------------------------------------------------
+class TForm1 : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *pnlTextCom;
+ TSplitter *Splitter2;
+ TPanel *pnlText;
+ TPanel *pnlComment;
+ TSplitter *Splitter1;
+ TPanel *pnlDict;
+ TPageControl *PageControl2;
+ TStatusBar *StatusBar1;
+ TPageControl *PageControl3;
+
+ TPanel *pnlDictHeader;
+ TLabel *Label1;
+ TRichEdit *DictKeyEdit;
+ TMainMenu *MainMenu1;
+ TMenuItem *Search1;
+ TMenuItem *NewSearchWindow1;
+ TMenuItem *Help1;
+ TMenuItem *About1;
+ TPopupMenu *PopupMenu2;
+ TMenuItem *DictionaryLookup1;
+ TMenuItem *File1;
+ TMenuItem *SaveLayout1;
+ TMenuItem *Exit1;
+ TMenuItem *N1;
+ TDdeServerItem *Search;
+ TDdeServerItem *Lookup;
+ TDdeServerConv *Bible;
+ TPopupMenu *PopupMenu1;
+ TMenuItem *MenuItem1;
+ TMenuItem *Copy1;
+ TMenuItem *CopyasBGreekTransliteration1;
+ TMenuItem *Copy2;
+ TMenuItem *Edit1;
+ TMenuItem *Copy3;
+ TPopupMenu *BookmarkPopup;
+ TMenuItem *AddBookmark1;
+ TMenuItem *N2;
+ TMenuItem *EditBookmarks1;
+ TMenuItem *Options1;
+ TCoolBar *CoolBar1;
+ TImageList *ImageList1;
+ TImage *BackBtnImage;
+ TImage *SearchBtnImage;
+ TToolBar *ToolBar2;
+ TToolButton *ToolButton3;
+ TToolButton *ToolButton4;
+ TPanel *pnlSpeed;
+ TPanel *Panel1;
+ TComboBox *cbBook;
+ TEdit *CHBox;
+ TUpDown *UpDown1;
+ TEdit *VSBox;
+ TUpDown *UpDown2;
+ TSpeedButton *btnLookup;
+ TToolBar *ToolBar1;
+ TImageList *ImageList2;
+ TImage *BookmarkBtnImage;
+ TSpeedButton *Bookmarkbtn;
+ TPopupMenu *PopupMenu3;
+ TMenuItem *MenuItem2;
+ TMenuItem *MenuItem3;
+ TMenuItem *N3;
+ TMenuItem *EditEntry1;
+ TMenuItem *DeleteEntry1;
+ TMenuItem *LinktoVerse1;
+ TUpDown *UpDown3;
+ TComboBox *freeHandLookup;
+ void __fastcall PageControl1Change(TObject *Sender);
+ void __fastcall btnLookupClick(TObject *Sender);
+ void __fastcall PageControl2Change(TObject *Sender);
+
+
+
+ void __fastcall DictKeyEditChange(TObject *Sender);
+ void __fastcall PageControl3Change(TObject *Sender);
+ void __fastcall NewSearchWindow1Click(TObject *Sender);
+
+ void __fastcall Exit1Click(TObject *Sender);
+ void __fastcall About1Click(TObject *Sender);
+ void __fastcall DictionaryLookup1Click(TObject *Sender);
+ void __fastcall SaveLayout1Click(TObject *Sender);
+
+ void __fastcall LookupPokeData(TObject *Sender);
+
+ void __fastcall SearchPokeData(TObject *Sender);
+ void __fastcall UpDown3Click(TObject *Sender, TUDBtnType Button);
+ void __fastcall UpDown1Click(TObject *Sender, TUDBtnType Button);
+
+
+ void __fastcall BackbtnClick(TObject *Sender);
+ void __fastcall Button1Click(TObject *Sender);
+ void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender);
+ void __fastcall Copy1Click(TObject *Sender);
+
+
+
+ void __fastcall AddBookmark1Click(TObject *Sender);
+ void __fastcall BookmarkItemClick(TObject *Sender);
+ void __fastcall BookmarkbtnClick(TObject *Sender);
+ void __fastcall EditBookmarks1Click(TObject *Sender);
+
+ void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
+ void __fastcall Options1Click(TObject *Sender);
+ void __fastcall cbBookChange(TObject *Sender);
+
+ void __fastcall FormCreate(TObject *Sender);
+ void __fastcall DisplayHint(TObject* Sender) ;
+ void __fastcall PopupMenuPopup(TObject *Sender);
+ void __fastcall createVerseList(TObject *Sender);
+ void __fastcall freeHandLookupKeyPress(TObject *Sender, char &Key);
+ void __fastcall RTFMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall EditEntry1Click(TObject *Sender);
+ void __fastcall DeleteEntry1Click(TObject *Sender);
+ void __fastcall LinktoVerse1Click(TObject *Sender);
+
+private: // User declarations
+ list <SWDisplay *> displays; // so we can delete each display we create
+ list <ModState *> modstates;
+ vector <ModState *> ctrlstates;
+ bool logmodstate;
+ bool freshdict;
+
+ char CreateTextPane(SWModule *mod, char *font = 0);
+ char CreateCommentPane(SWModule *mod);
+ char CreateLDPane(SWModule *mod);
+ void PushState();
+ void BackState();
+ void ForwardState();
+ void BuildRTFHeader(char *buf, char *font, int max);
+ void AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree);
+
+public: // User declarations
+ TModTabPanel *textTabs;
+ VerseKey DefaultVSKey;
+ SWKey DefaultStrKey;
+ SWMgr *mainmgr;
+ SWConfig *layoutconf;
+ SWConfig *optionsconf;
+ __fastcall TForm1(TComponent* Owner);
+ __fastcall ~TForm1();
+// virtual void __fastcall CreateWnd();
+ void RefreshActiveSheet(TPageControl *ts);
+ void TextKeyChanged(); // updates dependents on TextKeyChanged
+ void RefreshBookmarksMenu(TMenu *menu, TTreeView *tree);
+ void RestoreState(ModState *state);
+ ListKey tmpVerseList;
+ String tmpVerseListCaption;
+};
+//---------------------------------------------------------------------------
+extern TForm1 *Form1;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/sword.bpr b/apps/windoze/CBuilder5/prototype/sword.bpr
new file mode 100644
index 0000000..f325f9a
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/sword.bpr
@@ -0,0 +1,124 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="sword.exe"/>
+ <OBJFILES value="sword.obj mainfrm.obj ModInstForm.obj ..\..\swdisprtf.obj
+ ..\..\swdisprtfchap.obj ..\..\swwinlog.obj ..\..\tbdisp.obj searchfrm.obj
+ editentryfrm.obj biblecsmgr.obj bookmarkfrm.obj AboutBoxfrm.obj
+ optionfrm.obj vrslstfrm.obj versesel.obj newbmfilefrm.obj CommentPanel.obj
+ ModTabPanel.obj AppBar.obj BookMarkPanel.obj TextPanel.obj LDPanel.obj
+ DeskTopNameForm.obj DockCanvas.obj"/>
+ <RESFILES value="sword.res"/>
+ <IDLFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES) mainfrm.dfm ModInstForm.dfm searchfrm.dfm editentryfrm.dfm
+ bookmarkfrm.dfm AboutBoxfrm.dfm optionfrm.dfm vrslstfrm.dfm versesel.dfm
+ newbmfilefrm.dfm AppBar.dfm DeskTopNameForm.dfm DockCanvas.dfm"/>
+ <LIBFILES value="swordlib.lib"/>
+ <LIBRARIES value="vclx50.lib vcl50.lib"/>
+ <SPARELIBS value="vcl50.lib vclx50.lib"/>
+ <PACKAGES value="vcl50.bpi vclx50.bpi vcljpg50.bpi vclmid50.bpi vcldb50.bpi vclbde50.bpi
+ bcbsmp50.bpi vcldbx50.bpi qrpt50.bpi teeui50.bpi teedb50.bpi tee50.bpi
+ dss50.bpi ibsmp50.bpi nmfast50.bpi inetdb50.bpi inet50.bpi dclocx50.bpi"/>
+ <PATHCPP value=".;..\..\..\windoze"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+ <RELEASELIBPATH value="$(BCB)\lib\release"/>
+ <LINKER value="ilink32"/>
+ <USERDEFINES value="_DEBUG"/>
+ <SYSDEFINES value="NO_STRICT;_VIS_NOLIB"/>
+ <MAINSOURCE value="sword.cpp"/>
+ <INCLUDEPATH value="&quot;C:\Program Files\Common Files\Borland Shared\Images\Buttons\&quot;;..\..\..\windoze;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include"/>
+ <LIBPATH value="&quot;C:\Program Files\Common Files\Borland Shared\Images\Buttons\&quot;;$(BCB)\Projects\Lib;&quot;C:\program files\borland\cbuilder4\Lib\&quot;;..\..\..\windoze;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par -w-8027 -w-8026"/>
+ <WARNOPTSTR value=""/>
+ </MACROS>
+ <OPTIONS>
+ <IDLCFLAGS value="-I&quot;..\..\..\..\..\..\..\Program Files\Common Files\Borland Shared\Images\Buttons&quot;
+ -I..\.. -I$(BCB)\include -I$(BCB)\include\vcl -I..\..\..\..\include
+ -src_suffix cpp -boa"/>
+ <CFLAG1 value="-Od -H=c:\PROGRA~1\BORLAND\CBUILD~1\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8
+ -b- -k -y -v -vi- -c -tW -tWM"/>
+ <PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zi"/>
+ <LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn -v"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/>
+ <ALLRES value="$(RESFILES)"/>
+ <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=5
+Item0=C:\Program Files\Common Files\Borland Shared\Images\Buttons\;..\..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item1=C:\Program Files\Common Files\Borland Shared\Images\Buttons\;..\..\..\windoze;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item2=..\..\..\..\..\..\..\Program Files\Common Files\Borland Shared\Images\Buttons;..\..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item3=..\..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include
+Item4=$(BCB)\include;$(BCB)\include\vcl;../../../../include
+
+[HistoryLists\hlLibraryPath]
+Count=5
+Item0=C:\Program Files\Common Files\Borland Shared\Images\Buttons\;$(BCB)\Projects\Lib;C:\program files\borland\cbuilder4\Lib\;..\..;$(BCB)\lib\obj;$(BCB)\lib
+Item1=C:\Program Files\Common Files\Borland Shared\Images\Buttons\;$(BCB)\Projects\Lib;C:\program files\borland\cbuilder4\Lib\;..\..\..\windoze;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\..\..\..\..\..\..\Program Files\Common Files\Borland Shared\Images\Buttons;$(BCB)\Projects\Lib;..\..\..\..\..\..\..\program files\borland\cbuilder4\Lib;..\..;$(BCB)\lib\obj;$(BCB)\lib
+Item3=..\..;$(BCB)\lib\obj;$(BCB)\lib
+Item4=$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/sword.cpp b/apps/windoze/CBuilder5/prototype/sword.cpp
new file mode 100644
index 0000000..113f717
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/sword.cpp
@@ -0,0 +1,47 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+USERES("sword.res");
+USEFORM("mainfrm.cpp", Form1);
+USELIB("swordlib.lib");
+USEFORM("ModInstForm.cpp", ModInstFrm);
+USEUNIT("..\..\swdisprtf.cpp");
+USEUNIT("..\..\swdisprtfchap.cpp");
+USEUNIT("..\..\swwinlog.cpp");
+USEUNIT("..\..\tbdisp.cpp");
+USEFORM("searchfrm.cpp", Form2);
+USEFORM("editentryfrm.cpp", EditEntry);
+USEUNIT("biblecsmgr.cpp");
+USEFORM("bookmarkfrm.cpp", Bookmarksfrm);
+USEFORM("AboutBoxfrm.cpp", AboutBox);
+USEFORM("optionfrm.cpp", Optionsfrm);
+USEFORM("vrslstfrm.cpp", VerseListFrm);
+USEFORM("versesel.cpp", VerseSelFrm);
+USEFORM("newbmfilefrm.cpp", NewBMfrm);
+USEUNIT("CommentPanel.cpp");
+USEUNIT("ModTabPanel.cpp");
+USEFORM("AppBar.cpp", AppBarFrm);
+USEUNIT("BookMarkPanel.cpp");
+USEUNIT("TextPanel.cpp");
+USEUNIT("LDPanel.cpp");
+USEFORM("DeskTopNameForm.cpp", DeskTopNameFrm);
+USEFORM("DockCanvas.cpp", DockCanvasFrm);
+//---------------------------------------------------------------------------
+WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
+{
+ try
+ {
+ Application->Initialize();
+ Application->CreateForm(__classid(TAppBarFrm), &AppBarFrm);
+ Application->CreateForm(__classid(TDeskTopNameFrm), &DeskTopNameFrm);
+ Application->CreateForm(__classid(TDockCanvasFrm), &DockCanvasFrm);
+ Application->Run();
+ }
+ catch (Exception &exception)
+ {
+ Application->ShowException(&exception);
+ }
+ return 0;
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/prototype/swordlib.bpr b/apps/windoze/CBuilder5/prototype/swordlib.bpr
new file mode 100644
index 0000000..3948c15
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/swordlib.bpr
@@ -0,0 +1,168 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.05.03"/>
+ <PROJECT value="swordlib.lib"/>
+ <OBJFILES value="swordlib.obj ..\..\..\..\src\keys\versekey.obj
+ ..\..\..\..\src\keys\swkey.obj ..\..\..\..\src\keys\listkey.obj
+ ..\..\..\..\src\keys\strkey.obj ..\..\..\..\src\mgr\swmgr.obj
+ ..\..\..\..\src\mgr\swconfig.obj
+ ..\..\..\..\src\modules\comments\rawcom\rawcom.obj
+ ..\..\..\..\src\modules\comments\swcom.obj
+ ..\..\..\..\src\modules\common\rawverse.obj
+ ..\..\..\..\src\modules\common\rawstr.obj
+ ..\..\..\..\src\modules\filters\rwprtf.obj
+ ..\..\..\..\src\modules\filters\gbfrtf.obj
+ ..\..\..\..\src\modules\filters\gbfplain.obj
+ ..\..\..\..\src\modules\lexdict\rawld\rawld.obj
+ ..\..\..\..\src\modules\lexdict\swld.obj
+ ..\..\..\..\src\modules\texts\rawgbf\rawgbf.obj
+ ..\..\..\..\src\modules\texts\rawtext\rawtext.obj
+ ..\..\..\..\src\modules\texts\swtext.obj
+ ..\..\..\..\src\modules\swmodule.obj ..\..\tbdisp.obj
+ ..\..\swdisprtfchap.obj ..\..\swwinlog.obj ..\..\swdisprtf.obj
+ ..\..\..\..\src\modules\comments\hrefcom\hrefcom.obj
+ ..\..\..\..\src\mgr\filemgr.obj
+ ..\..\..\..\src\modules\comments\rawfiles\rawfiles.obj
+ ..\..\..\..\src\utilfuns\utilstr.obj ..\..\..\..\src\utilfuns\utilconf.obj
+ ..\..\..\..\src\utilfuns\Greek2Greek.obj
+ ..\..\..\..\src\utilfuns\regex.obj ..\..\..\..\src\frontend\swlog.obj
+ ..\..\..\..\src\frontend\swdisp.obj
+ ..\..\..\..\src\modules\filters\gbfstrongs.obj
+ ..\..\..\..\src\modules\filters\gbffootnotes.obj
+ ..\..\..\..\src\modules\filters\cipherfil.obj
+ ..\..\..\..\src\modules\common\sapphire.obj
+ ..\..\..\..\src\modules\common\swcipher.obj
+ ..\..\..\..\src\mgr\swlocale.obj ..\..\..\..\src\mgr\localemgr.obj
+ ..\..\..\..\src\modules\common\lzsscomprs.obj
+ ..\..\..\..\src\modules\common\zverse.obj
+ ..\..\..\..\src\modules\common\swcomprs.obj
+ ..\..\..\..\src\modules\texts\ztext\ztext.obj
+ ..\..\..\..\src\modules\filters\thmlrtf.obj
+ ..\..\..\..\src\modules\filters\gbfhtml.obj
+ ..\..\..\..\src\modules\filters\gbfthml.obj
+ ..\..\..\..\src\modules\filters\plainfootnotes.obj
+ ..\..\..\..\src\modules\filters\plainhtml.obj
+ ..\..\..\..\src\modules\filters\rtfhtml.obj
+ ..\..\..\..\src\modules\filters\rwphtml.obj
+ ..\..\..\..\src\modules\filters\thmlgbf.obj
+ ..\..\..\..\src\modules\filters\thmlhtml.obj
+ ..\..\..\..\src\modules\filters\thmlplain.obj"/>
+ <RESFILES value=""/>
+ <IDLFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES)"/>
+ <LIBFILES value=""/>
+ <LIBRARIES value="nmfast50.lib vclx50.lib vcl50.lib"/>
+ <SPARELIBS value="vcl50.lib vclx50.lib nmfast50.lib"/>
+ <PACKAGES value=""/>
+ <PATHCPP value=".;..\..\..\..\src\keys;..\..\..\..\src\mgr;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\common;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts;..\..\..\..\src\modules;..\..\..\windoze;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\utilfuns;..\..\..\..\src\frontend;..\..\..\..\src\modules\texts\ztext"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value=""/>
+ <RELEASELIBPATH value=""/>
+ <LINKER value="TLib"/>
+ <USERDEFINES value="_DEBUG"/>
+ <SYSDEFINES value="NO_STRICT;_NO_VCL"/>
+ <MAINSOURCE value="swordlib.cpp"/>
+ <INCLUDEPATH value="..\..\..\windoze;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl"/>
+ <LIBPATH value="..\..\..\windoze;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys"/>
+ <WARNINGS value="-w-par -w-8027 -w-8026"/>
+ <WARNOPTSTR value=""/>
+ <LISTFILE value=""/>
+ </MACROS>
+ <OPTIONS>
+ <CFLAG1 value="-Od -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -RT- -X- -r-
+ -a8 -4 -b- -k -y -v -vi- -c -g0 -tWM"/>
+ <PFLAGS value="-$Y+ -$W -$O- -v -M -JPHNE"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zi"/>
+ <LFLAGS value="/P128"/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="$(OBJFILES)"/>
+ <ALLRES value=""/>
+ <ALLLIB value="cg32.lib"/>
+ </LINKER>
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=13
+Item0=..\..;..\..\..\..\src\modules\texts\ztext;..\..\..\windoze;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item1=..\..\..\..\src\modules\texts\ztext;..\..;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item2=..\..\..\..\src\modules\texts\ztext;..\..\..\windoze;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item3=..\..;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item4=..\..;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item5=..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item6=..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item7=..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item8=..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item9=..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item10=..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl
+Item11=c:\usr\troy\src\sword\include;c:\usr\troy\src\sword\frontend;c:\usr\troy\src\sword\frontend\windoze;c:\usr\troy\src\sword\utilfuns;c:\usr\troy\src\sword\modules;c:\usr\troy\src\sword\modules\texts;c:\usr\troy\src\sword\modules\texts\rawtext;c:\usr\troy\src\sword\modules\texts\rawgbf;c:\usr\troy\src\sword\modules\lexdict;c:\usr\troy\src\sword\modules\lexdict\rawld;c:\usr\troy\src\sword\modules\filters;c:\usr\troy\src\sword\modules\common;c:\usr\troy\src\sword\modules\comments;c:\usr\troy\src\sword\modules\comments\rawcom;c:\usr\troy\src\sword\mgr;c:\usr\troy\src\sword\keys;$(BCB)\include;$(BCB)\include\vcl
+Item12=c:\usr\src\sword\include;c:\usr\troy\src\sword\frontend;c:\usr\troy\src\sword\frontend\windoze;c:\usr\troy\src\sword\utilfuns;c:\usr\troy\src\sword\modules;c:\usr\troy\src\sword\modules\texts;c:\usr\troy\src\sword\modules\texts\rawtext;c:\usr\troy\src\sword\modules\texts\rawgbf;c:\usr\troy\src\sword\modules\lexdict;c:\usr\troy\src\sword\modules\lexdict\rawld;c:\usr\troy\src\sword\modules\filters;c:\usr\troy\src\sword\modules\common;c:\usr\troy\src\sword\modules\comments;c:\usr\troy\src\sword\modules\comments\rawcom;c:\usr\troy\src\sword\mgr;c:\usr\troy\src\sword\keys;$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=2
+Item0=_DEBUG
+Item1=_NO_VCL
+
+[HistoryLists\hlTlibPageSize]
+Count=3
+Item0=0x0080
+Item1=128
+Item2=0x0040
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=1
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/swordlib.cpp b/apps/windoze/CBuilder5/prototype/swordlib.cpp
new file mode 100644
index 0000000..fb5ebe2
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/swordlib.cpp
@@ -0,0 +1,61 @@
+//---------------------------------------------------------------------------
+#include <condefs.h>
+#pragma hdrstop
+USEUNIT("..\..\..\..\src\keys\versekey.cpp");
+USEUNIT("..\..\..\..\src\keys\swkey.cpp");
+USEUNIT("..\..\..\..\src\keys\listkey.cpp");
+USEUNIT("..\..\..\..\src\keys\strkey.cpp");
+USEUNIT("..\..\..\..\src\mgr\swmgr.cpp");
+USEUNIT("..\..\..\..\src\mgr\swconfig.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\rawcom\rawcom.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\swcom.cpp");
+USEUNIT("..\..\..\..\src\modules\common\rawverse.cpp");
+USEUNIT("..\..\..\..\src\modules\common\rawstr.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\rwprtf.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfrtf.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfplain.cpp");
+USEUNIT("..\..\..\..\src\modules\lexdict\rawld\rawld.cpp");
+USEUNIT("..\..\..\..\src\modules\lexdict\swld.cpp");
+USEUNIT("..\..\..\..\src\modules\texts\rawgbf\rawgbf.cpp");
+USEUNIT("..\..\..\..\src\modules\texts\rawtext\rawtext.cpp");
+USEUNIT("..\..\..\..\src\modules\texts\swtext.cpp");
+USEUNIT("..\..\..\..\src\modules\swmodule.cpp");
+USEUNIT("..\..\tbdisp.cpp");
+USEUNIT("..\..\swdisprtfchap.cpp");
+USEUNIT("..\..\swwinlog.cpp");
+USEUNIT("..\..\swdisprtf.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\hrefcom\hrefcom.cpp");
+USEUNIT("..\..\..\..\src\mgr\filemgr.cpp");
+USEUNIT("..\..\..\..\src\modules\comments\rawfiles\rawfiles.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\utilstr.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\utilconf.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\Greek2Greek.cpp");
+USEUNIT("..\..\..\..\src\utilfuns\regex.c");
+USEUNIT("..\..\..\..\src\frontend\swlog.cpp");
+USEUNIT("..\..\..\..\src\frontend\swdisp.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfstrongs.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbffootnotes.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\cipherfil.cpp");
+USEUNIT("..\..\..\..\src\modules\common\sapphire.cpp");
+USEUNIT("..\..\..\..\src\modules\common\swcipher.cpp");
+USEUNIT("..\..\..\..\src\mgr\swlocale.cpp");
+USEUNIT("..\..\..\..\src\mgr\localemgr.cpp");
+USEUNIT("..\..\..\..\src\modules\common\lzsscomprs.cpp");
+USEUNIT("..\..\..\..\src\modules\common\zverse.cpp");
+USEUNIT("..\..\..\..\src\modules\common\swcomprs.cpp");
+USEUNIT("..\..\..\..\src\modules\texts\ztext\ztext.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlrtf.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfhtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\gbfthml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\plainfootnotes.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\plainhtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\rtfhtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\rwphtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlgbf.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlhtml.cpp");
+USEUNIT("..\..\..\..\src\modules\filters\thmlplain.cpp");
+//---------------------------------------------------------------------------
+#define Library
+
+// To add a file to the library use the Project menu 'Add to Project'.
+
diff --git a/apps/windoze/CBuilder5/prototype/swordprj.bpg b/apps/windoze/CBuilder5/prototype/swordprj.bpg
new file mode 100644
index 0000000..0333c75
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/swordprj.bpg
@@ -0,0 +1,23 @@
+#------------------------------------------------------------------------------
+VERSION = BWS.01
+#------------------------------------------------------------------------------
+!ifndef ROOT
+ROOT = $(MAKEDIR)\..
+!endif
+#------------------------------------------------------------------------------
+MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
+DCC = $(ROOT)\bin\dcc32.exe $**
+BRCC = $(ROOT)\bin\brcc32.exe $**
+#------------------------------------------------------------------------------
+PROJECTS = swordlib.lib sword.exe
+#------------------------------------------------------------------------------
+default: $(PROJECTS)
+#------------------------------------------------------------------------------
+
+swordlib.lib: swordlib.bpr
+ $(MAKE)
+
+sword.exe: sword.bpr
+ $(MAKE)
+
+
diff --git a/apps/windoze/CBuilder6/BibleCS/sword.bpr b/apps/windoze/CBuilder6/BibleCS/sword.bpr
new file mode 100644
index 0000000..e941b25
--- /dev/null
+++ b/apps/windoze/CBuilder6/BibleCS/sword.bpr
@@ -0,0 +1,221 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+ <MACROS>
+ <VERSION value="BCB.06.00"/>
+ <PROJECT value="&quot;C:\Documents and Settings\dtrotzjr\My Documents\My Projects\The Sword Project\Stage_Sword\sword.exe&quot;"/>
+ <OBJFILES value="obj\sword.obj obj\swdisprtfchap.obj obj\swdisprtf.obj obj\AboutBoxfrm.obj
+ obj\biblecsmgr.obj obj\bookmarkfrm.obj obj\DevOfTheDay.obj
+ obj\editentryfrm.obj obj\FontSel.obj obj\mainfrm.obj obj\ModInstForm.obj
+ obj\ModVisFrm.obj obj\newbmfilefrm.obj obj\optionfrm.obj
+ obj\RangeMaintFrm.obj obj\searchfrm.obj obj\splashfrm.obj
+ obj\SplashPage.obj obj\StudyProfessor.obj obj\versesel.obj obj\vrslstfrm.obj"/>
+ <RESFILES value="..\..\CBuilder5\BibleCS\sword.res"/>
+ <IDLFILES value=""/>
+ <IDLGENFILES value=""/>
+ <DEFFILE value=""/>
+ <RESDEPEN value="$(RESFILES) ..\..\CBuilder5\BibleCS\AboutBoxfrm.dfm
+ ..\..\CBuilder5\BibleCS\bookmarkfrm.dfm
+ ..\..\CBuilder5\BibleCS\DevOfTheDay.dfm
+ ..\..\CBuilder5\BibleCS\editentryfrm.dfm
+ ..\..\CBuilder5\BibleCS\FontSel.dfm ..\..\CBuilder5\BibleCS\mainfrm.dfm
+ ..\..\CBuilder5\BibleCS\ModInstForm.dfm
+ ..\..\CBuilder5\BibleCS\ModVisFrm.dfm
+ ..\..\CBuilder5\BibleCS\newbmfilefrm.dfm
+ ..\..\CBuilder5\BibleCS\optionfrm.dfm
+ ..\..\CBuilder5\BibleCS\RangeMaintFrm.dfm
+ ..\..\CBuilder5\BibleCS\searchfrm.dfm
+ ..\..\CBuilder5\BibleCS\splashfrm.dfm ..\..\CBuilder5\BibleCS\SplashPage.dfm
+ ..\..\CBuilder5\BibleCS\StudyProfessor.dfm
+ ..\..\CBuilder5\BibleCS\versesel.dfm ..\..\CBuilder5\BibleCS\vrslstfrm.dfm"/>
+ <LIBFILES value="swordlib.lib C:\icu-sword\as_is\borland\icucommon.lib
+ C:\icu-sword\as_is\borland\icudatab.lib
+ C:\icu-sword\as_is\borland\icui18n.lib"/>
+ <LIBRARIES value="bcbie.lib nmfast.lib bdertl.lib vcldb.lib dbrtl.lib vclx.lib vcl.lib rtl.lib"/>
+ <SPARELIBS value="rtl.lib vcl.lib vclx.lib dbrtl.lib vcldb.lib bdertl.lib nmfast.lib bcbie.lib"/>
+ <PACKAGES value="rtl.bpi vcl.bpi vclx.bpi bcbsmp.bpi qrpt.bpi dbrtl.bpi vcldb.bpi
+ bdertl.bpi ibsmp.bpi vcldbx.bpi teeui.bpi teedb.bpi tee.bpi teeqr.bpi
+ ibxpress.bpi bcbie.bpi vclie.bpi inetdb.bpi inet.bpi nmfast.bpi dclocx.bpi
+ bcb2kaxserver.bpi"/>
+ <PATHCPP value=".;..\..;..\..;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS"/>
+ <PATHPAS value=".;"/>
+ <PATHRC value=".;"/>
+ <PATHASM value=".;"/>
+ <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+ <RELEASELIBPATH value="$(BCB)\lib\release"/>
+ <LINKER value="ilink32"/>
+ <USERDEFINES value="_USE_OLD_RW_STL;_DEBUG"/>
+ <SYSDEFINES value="NO_STRICT"/>
+ <MAINSOURCE value="sword.cpp"/>
+ <INCLUDEPATH value="..\..;..\..\..\..\include;C:\sword\apps\windoze\CBuilder5\BibleCS;&quot;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units&quot;;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\include;$(BCB)\include\vcl"/>
+ <LIBPATH value="..\..\CBuilder5\BibleCS;obj;&quot;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units&quot;;..\..;..\..\..\..\lib;$(BCB)\Projects\Lib;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib"/>
+ <WARNINGS value="-w-par -w-8027 -w-8026"/>
+ <WARNOPTSTR value=""/>
+ <OTHERFILES value=""/>
+ </MACROS>
+ <OPTIONS>
+ <IDLCFLAGS value="-I..\..\..\..\..\icu-sword\source\common
+ -I..\..\..\..\..\icu-sword\source\i18n -I..\..
+ -I&quot;C:\Program Files\Borland\CBuilder5\RX\Units\.&quot; -I..\..\..\..\include
+ -I$(BCB)\include -I$(BCB)\include\vcl -Irxlib -src_suffix cpp -D_ICU_
+ -D_DEBUG"/>
+ <CFLAG1 value="-Od -Vx -Ve -X- -r- -a8 -5 -b- -k -y -v -vi- -c -tW -tWM"/>
+ <PFLAGS value="-N2obj -N0obj -$Y+ -$W -$O- -$A8 -v -M -JPHNE"/>
+ <RFLAGS value=""/>
+ <AFLAGS value="/mx /w2 /zi"/>
+ <LFLAGS value="-Iobj -D&quot;&quot; -aa -Tpe -GD -s -Gn -v"/>
+ <OTHERFILES value=""/>
+ </OPTIONS>
+ <LINKER>
+ <ALLOBJ value="c0w32.obj $(OBJFILES)"/>
+ <ALLRES value="$(RESFILES)"/>
+ <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
+ <OTHERFILES value=""/>
+ </LINKER>
+ <FILELIST>
+ <FILE FILENAME="sword.cpp" FORMNAME="" UNITNAME="sword" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="swordlib.lib" FORMNAME="" UNITNAME="swordlib" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\swdisprtfchap.cpp" FORMNAME="" UNITNAME="swdisprtfchap" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\swdisprtf.cpp" FORMNAME="" UNITNAME="swdisprtf" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="C:\icu-sword\as_is\borland\icucommon.lib" FORMNAME="" UNITNAME="icucommon" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="C:\icu-sword\as_is\borland\icudatab.lib" FORMNAME="" UNITNAME="icudatab" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="C:\icu-sword\as_is\borland\icui18n.lib" FORMNAME="" UNITNAME="icui18n" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\AboutBoxfrm.cpp" FORMNAME="AboutBox" UNITNAME="AboutBoxfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\biblecsmgr.cpp" FORMNAME="" UNITNAME="biblecsmgr.cpp" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\bookmarkfrm.cpp" FORMNAME="Bookmarksfrm" UNITNAME="bookmarkfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\DevOfTheDay.cpp" FORMNAME="DevOfTheDay2" UNITNAME="DevOfTheDay" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\editentryfrm.cpp" FORMNAME="EditEntry" UNITNAME="editentryfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\FontSel.cpp" FORMNAME="FontSelFrm" UNITNAME="FontSel" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\mainfrm.cpp" FORMNAME="Form1" UNITNAME="mainfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\ModInstForm.cpp" FORMNAME="ModInstFrm" UNITNAME="ModInstForm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\ModVisFrm.cpp" FORMNAME="ModVisForm" UNITNAME="ModVisFrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\newbmfilefrm.cpp" FORMNAME="NewBMfrm" UNITNAME="newbmfilefrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\optionfrm.cpp" FORMNAME="Optionsfrm" UNITNAME="optionfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\RangeMaintFrm.cpp" FORMNAME="RangeMaintForm" UNITNAME="RangeMaintFrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\searchfrm.cpp" FORMNAME="Form2" UNITNAME="searchfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\splashfrm.cpp" FORMNAME="splashForm" UNITNAME="splashfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\SplashPage.cpp" FORMNAME="SplashPg" UNITNAME="SplashPage" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\StudyProfessor.cpp" FORMNAME="Form3" UNITNAME="StudyProfessor" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\versesel.cpp" FORMNAME="VerseSelFrm" UNITNAME="versesel" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\vrslstfrm.cpp" FORMNAME="VerseListFrm" UNITNAME="vrslstfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
+ <FILE FILENAME="..\..\CBuilder5\BibleCS\sword.res" FORMNAME="" UNITNAME="sword.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
+ </FILELIST>
+ <BUILDTOOLS>
+ </BUILDTOOLS>
+
+ <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=1
+AutoIncBuild=1
+MajorVer=1
+MinorVer=5
+Release=3
+Build=49
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=CrossWire Software &amp; Bible Society
+FileDescription=Windows 32bit User Interface to The SWORD Project
+FileVersion=1.5.3.49
+InternalName=biblecs
+LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License
+LegalTrademarks=
+OriginalFilename=
+ProductName=The SWORD Project
+ProductVersion=1.5.3
+Comments=Seek Him and you will find Him
+
+[HistoryLists\hlIncludePath]
+Count=16
+Item0=..\..;..\..\..\..\include;C:\sword\apps\windoze\CBuilder5\BibleCS;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\include;$(BCB)\include\vcl
+Item1=..\..;C:\sword\apps\windoze\CBuilder5\BibleCS;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item2=..\..;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item3=C:\Program Files\Borland\CBuilder6\Projects\Rx6\Units;..\..;C:\sword\apps\windoze\CBuilder6\BibleCS\rxlib;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item4=..\..;C:\sword\apps\windoze\CBuilder6\BibleCS\rxlib;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;C:\Program Files\Borland\CBuilder6\Projects\Rx6\Units
+Item5=..\..;C:\sword\apps\windoze\CBuilder6\BibleCS\rxlib;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item6=..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item7=..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item8=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item9=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item10=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib;C:\Program Files\Borland\CBuilder6\Projects\Rx6\Units
+Item11=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item12=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item13=..\..\..\..\..\icu-sword\source\common\;..\..\..\..\..\icu-sword\source\i18n\;..\..;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item14=C:\icu-sword\source\common\;C:\icu-sword\source\i18n\;..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+Item15=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib
+
+[HistoryLists\hlLibraryPath]
+Count=13
+Item0=..\..\CBuilder5\BibleCS;obj;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..;..\..\..\..\lib;$(BCB)\Projects\Lib;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item1=obj;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..;..\..\..\..\lib;$(BCB)\Projects\Lib;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\..\CBuilder5\BibleCS;..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item3=..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item4=..\..;C:\sword\apps\windoze\CBuilder6\BibleCS\rxlib;..\..\..\..\lib;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item5=..\..;$(BCB)\Projects\Rx6\Units;..\..\..\..\lib;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item6=..\..;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\lib;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item7=$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\lib;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item8=..\..\..\windoze;..\..\..\..\lib;$(BCB)\Projects\Rx6\Units;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item9=..\..\..\windoze;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item10=..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item11=..\..;..\..\..\..\lib\;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+Item12=..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=6
+Item0=_USE_OLD_RW_STL;_DEBUG
+Item1=_USE_OLD_RW_STL
+Item2=_ICU_;_USE_OLD_RW_STL
+Item3=_ICU_;_USE_OLD_RW_STL;_DEBUG
+Item4=_ICU_
+Item5=_ICU_;_DEBUG
+
+[HistoryLists\hlIntOutputDir]
+Count=2
+Item0=obj
+Item1=C:\sword\apps\windoze\CBuilder5\BibleCS\obj
+
+[HistoryLists\hlFinalOutputDir]
+Count=6
+Item0=C:\Documents and Settings\dtrotzjr\My Documents\My Projects\The Sword Project\Stage_Sword\
+Item1=C:\Documents and Settings\dtrotzjr\My Documents\My Projects\The Sword Project\Stage_Sword
+Item2=stage\
+Item3=C:\Documents and Settings\Michelle Trotz\My Documents\My Projects\The Sword Project\Stage_Sword\
+Item4=C:\Documents and Settings\Michelle Trotz\My Documents\My Projects\The Sword Project\Stage_Sword
+Item5=C:\sword\apps\windoze\CBuilder5\BibleCS\stage
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=
+Launcher=
+UseLauncher=0
+DebugCWD=
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteLauncher=
+RemoteCWD=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+ </IDEOPTIONS>
+</PROJECT> \ No newline at end of file
diff --git a/apps/windoze/CBuilder6/BibleCS/sword.cpp b/apps/windoze/CBuilder6/BibleCS/sword.cpp
new file mode 100644
index 0000000..f474a29
--- /dev/null
+++ b/apps/windoze/CBuilder6/BibleCS/sword.cpp
@@ -0,0 +1,133 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+#include "SplashPage.h"
+#include <winreg.h>
+#include <dir.h>
+#include "sword.h"
+
+USEFORM("..\..\CBuilder5\BibleCS\AboutBoxfrm.cpp", AboutBox);
+USEFORM("..\..\CBuilder5\BibleCS\bookmarkfrm.cpp", Bookmarksfrm);
+USEFORM("..\..\CBuilder5\BibleCS\DevOfTheDay.cpp", DevOfTheDay2);
+USEFORM("..\..\CBuilder5\BibleCS\editentryfrm.cpp", EditEntry);
+USEFORM("..\..\CBuilder5\BibleCS\FontSel.cpp", FontSelFrm);
+USEFORM("..\..\CBuilder5\BibleCS\mainfrm.cpp", Form1);
+USEFORM("..\..\CBuilder5\BibleCS\ModInstForm.cpp", ModInstFrm);
+USEFORM("..\..\CBuilder5\BibleCS\ModVisFrm.cpp", ModVisForm);
+USEFORM("..\..\CBuilder5\BibleCS\newbmfilefrm.cpp", NewBMfrm);
+USEFORM("..\..\CBuilder5\BibleCS\optionfrm.cpp", Optionsfrm);
+USEFORM("..\..\CBuilder5\BibleCS\RangeMaintFrm.cpp", RangeMaintForm);
+USEFORM("..\..\CBuilder5\BibleCS\searchfrm.cpp", Form2);
+USEFORM("..\..\CBuilder5\BibleCS\splashfrm.cpp", splashForm);
+USEFORM("..\..\CBuilder5\BibleCS\SplashPage.cpp", SplashPg);
+USEFORM("..\..\CBuilder5\BibleCS\StudyProfessor.cpp", Form3);
+USEFORM("..\..\CBuilder5\BibleCS\versesel.cpp", VerseSelFrm);
+USEFORM("..\..\CBuilder5\BibleCS\vrslstfrm.cpp", VerseListFrm);
+//---------------------------------------------------------------------------
+WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
+
+ LONG result;
+
+ result = Application->ExeName.Length();
+ char * dir = new char[result + 1];
+ strcpy (dir, Application->ExeName.c_str());
+ for (;result > 0 && dir[result] != '\\'; result--) {
+ dir[result] = 0;
+ }
+ chdir(dir);
+ delete [] dir;
+
+ try {
+ HKEY hkey;
+ HWND otherInst;
+
+ // see if there's a previous instance running
+ otherInst = ::FindWindow(NULL, "The SWORD Project for Windows");
+ // if so, and we have an argument, send the argument to the other instance
+ if (otherInst && *lpCmdLine) {
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\OpenVerse", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, lpCmdLine, strlen(lpCmdLine) + 1);
+ result = RegCloseKey(hkey);
+
+ PostMessage(otherInst, WM_VERSE, NULL, NULL);
+ return 0;
+ }
+
+ // adjust the registry for our private protocol using the current path
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1);
+ result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1);
+ result = RegCloseKey(hkey);
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1);
+ result = RegCloseKey(hkey);
+ AnsiString opencommand = Application->ExeName + " \"%1\"";
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1);
+ result = RegCloseKey(hkey);
+
+
+ /*
+ // don't override Logos' setting if it exists
+ result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "libronixdls", 0, KEY_READ | KEY_WRITE, &hkey);
+ if (!result) {
+ char* libStr = new char[32];
+ unsigned long libSize = 32;
+ result = RegQueryValueEx(hkey, NULL, NULL, NULL, libStr, &libSize);
+ if (!result) {
+ if (strstr(libStr, "SWORD")) {
+ result = 1;
+ }
+ }
+ }
+ if (result) {
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1);
+ result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1);
+ result = RegCloseKey(hkey);
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1);
+ result = RegCloseKey(hkey);
+ AnsiString opencommand = Application->ExeName + " \"%1\"";
+ result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
+ result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1);
+ result = RegCloseKey(hkey);
+ }
+ */
+ }
+ catch (Exception &exception) {
+ Application->ShowException(&exception);
+ }
+
+ try {
+ Application->Initialize();
+ Application->Title = "The SWORD Project";
+ Application->CreateForm(__classid(TAboutBox), &AboutBox);
+ Application->CreateForm(__classid(TBookmarksfrm), &Bookmarksfrm);
+ Application->CreateForm(__classid(TDevOfTheDay2), &DevOfTheDay2);
+ Application->CreateForm(__classid(TEditEntry), &EditEntry);
+ Application->CreateForm(__classid(TFontSelFrm), &FontSelFrm);
+ Application->CreateForm(__classid(TForm1), &Form1);
+ Application->CreateForm(__classid(TModInstFrm), &ModInstFrm);
+ Application->CreateForm(__classid(TModVisForm), &ModVisForm);
+ Application->CreateForm(__classid(TNewBMfrm), &NewBMfrm);
+ Application->CreateForm(__classid(TOptionsfrm), &Optionsfrm);
+ Application->CreateForm(__classid(TRangeMaintForm), &RangeMaintForm);
+ Application->CreateForm(__classid(TForm2), &Form2);
+ Application->CreateForm(__classid(TsplashForm), &splashForm);
+ Application->CreateForm(__classid(TSplashPg), &SplashPg);
+ Application->CreateForm(__classid(TForm3), &Form3);
+ Application->CreateForm(__classid(TVerseSelFrm), &VerseSelFrm);
+ Application->CreateForm(__classid(TVerseListFrm), &VerseListFrm);
+ SplashPg = new TSplashPg(static_cast<void*>(NULL));
+ SplashPg->Show();
+ Application->ProcessMessages();
+ Application->Run();
+ delete SplashPg;
+ }
+ catch (Exception &exception) {
+ Application->ShowException(&exception);
+ }
+ return 0;
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/swdisprtf.cpp b/apps/windoze/swdisprtf.cpp
new file mode 100644
index 0000000..3a725af
--- /dev/null
+++ b/apps/windoze/swdisprtf.cpp
@@ -0,0 +1,113 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "swdisprtf.h"
+#include <unicodertf.h>
+
+
+
+//---------------------------------------------------------------------------
+__fastcall SWDispRTF::SWDispRTF(TWinControl *Owner)
+ : TRxRichEditX(Owner) {
+ RTFStream = new TMemoryStream();
+
+ ExpandNewLine = true;
+ this->AutoURLDetect = true;
+}
+
+__fastcall SWDispRTF::~SWDispRTF()
+{
+ if (RTFStream)
+ delete RTFStream;
+}
+
+
+void __fastcall SWDispRTF::Loaded(void)
+{
+ TRxRichEditX::Loaded();
+}
+
+
+int __fastcall SWDispRTF::GetMySelStart() {
+ CHARRANGE cr;
+
+ SendMessage(Handle, EM_EXGETSEL, 0, (long)&cr);
+ return cr.cpMin;
+}
+
+
+void __fastcall SWDispRTF::SetMySelStart(int iselstart) {
+ CHARRANGE cr;
+
+ cr.cpMin = iselstart;
+ cr.cpMax = iselstart;
+ SendMessage(Handle, EM_EXSETSEL, 0, (long)&cr);
+}
+
+// Display for Comm and LD
+char SWDispRTF::Display(SWModule &Module) {
+ System::AnsiString newtext, tmptext;
+ static UnicodeRTF filter;
+ char buf[255];
+
+ module = &Module;
+ type = "Default";
+
+ recalcAppearance();
+
+ newtext = RTFHeader;
+ newtext = newtext + RTFHeadMargin;
+ Module.Error(); // clear error;
+ newtext = newtext + "\\pard \\nowidctlpar \\cf7\\f0 ";
+ (const char *)Module; // force key to snap to entry before pulling out the text of the key
+ strcpy(buf, Module.KeyText());
+ SWKey *key = Module;
+
+ // VerseKey locales are not yet UTF8, so don't try to convert them.
+ if (!SWDYNAMIC_CAST(VerseKey, key))
+ filter.ProcessText(buf, 253, Module, &Module);
+
+ newtext = newtext + RTFHeadingPre + buf + RTFHeadingPost + ":\\par ";
+ tmptext = "";
+
+ tmptext = (const char *)Module;
+
+ newtext = newtext + RTFVersePre + " " + tmptext + RTFVersePost;
+ newtext = newtext + RTFTrailer;
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
+ RTFStream->Position = 0;
+ Lines->LoadFromStream(RTFStream);
+
+ // make links
+ while (true) {
+ int start, len, foundAt, endAt;
+
+ start = (SelLength) ? SelStart + SelLength : 0;
+ len = Text.Length() - start;
+ foundAt = this->SearchText("<a href=\"\">", start, len, TRichSearchTypes());
+ if (foundAt == -1)
+ break;
+
+ SelStart = foundAt;
+ SelLength = 11;
+ this->SelText = "";
+ endAt = this->SearchText("</a>", foundAt, len, TRichSearchTypes());
+ if (foundAt == -1)
+ break;
+ SelStart = endAt;
+ SelLength = 4;
+ this->SelText = "";
+ SelStart = foundAt;
+ SelLength = endAt - foundAt;
+ this->SelAttributes->Link = true;
+ }
+ SelLength = 0;
+
+ return 0;
+}
+
+//---------------------------------------------------------------------------
+
+
diff --git a/apps/windoze/swdisprtfchap.cpp b/apps/windoze/swdisprtfchap.cpp
new file mode 100644
index 0000000..8af96d4
--- /dev/null
+++ b/apps/windoze/swdisprtfchap.cpp
@@ -0,0 +1,143 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "biblecsmgr.h"
+#include "swdisprtfchap.h"
+
+
+//---------------------------------------------------------------------------
+static inline SWDispRTFChap *ValidCtrCheck()
+{
+ return new SWDispRTFChap(NULL);
+}
+
+char SWDispRTFChap::platformID = 0;
+
+class SWDispRTFChap_init {
+public:
+ SWDispRTFChap_init() {
+ OSVERSIONINFO osvi;
+ memset(&osvi, 0, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osvi);
+ SWDispRTFChap::platformID = osvi.dwPlatformId;
+ }
+} SWDispRTFChap::_init;
+
+
+//---------------------------------------------------------------------------
+__fastcall SWDispRTFChap::SWDispRTFChap(TWinControl *Owner)
+ : SWDispRTF(Owner)
+{
+}
+
+__fastcall SWDispRTFChap::~SWDispRTFChap()
+{
+}
+
+
+void __fastcall SWDispRTFChap::Loaded(void)
+{
+ SWDispRTF::Loaded();
+}
+
+// Display for biblical text
+char SWDispRTFChap::Display(SWModule &Module) {
+ int testmt, book, chap, verse, versepos;
+ System::AnsiString newtext, tmptext, tmptext2;
+ VerseKey *key = (VerseKey *)(SWKey *)Module;
+ testmt = key->Testament();
+ chap = key->Chapter();
+ book = key->Book();
+ verse = key->Verse();
+ key->Verse(1);
+
+ module = &Module;
+ type = "Default";
+
+ recalcAppearance();
+
+
+ newtext = RTFHeader;
+ newtext = newtext + RTFChapterMarkPre + IntToStr(chap) + RTFChapterMarkPost;
+ newtext = newtext + "\\pard\\f0\\nowidctlpar\\cf7 ";
+ if (Module.Direction() == DIRECTION_RTL) {
+ newtext = newtext + "\\qr ";
+ }
+ if (Module.Direction() == DIRECTION_RTL && (platformID == WINNT && (!strnicmp(Module.Lang(), "he", 2) || !strnicmp(Module.Lang(), "ar", 2)))) {
+ newtext = newtext + "\\rtlpar ";
+ }
+
+ Module.Error(); // clear error;
+ while ((key->Book() == book) && (key->Chapter() == chap) && (Module.Error() == 0)) {
+ newtext = newtext + "{";
+
+ tmptext = "";
+ for (const char *loop = (const char *)Module; *loop; loop++) {
+ if (*loop == '\n') {
+ tmptext += "\\par ";
+ }
+ else tmptext += *loop;
+ }
+ if (tmptext.Length() > 3) { // make sure we have an entry
+ if (Module.Direction() == DIRECTION_RTL && (platformID == WIN9X || (Module.Lang() && strnicmp(Module.Lang(), "he", 2) && strnicmp(Module.Lang(), "ar", 2)))) {
+ newtext = newtext + RTFVersePre;
+ if ((key->Verse() == verse) && (dispAttribs.markCurrentVerse)) {
+ newtext = newtext + "\\cf2 "; // \cf2 = second color in color table
+ }
+ newtext += tmptext + RTFVersePost;
+ newtext = newtext + RTFVerseMarkPre + IntToStr(key->Verse()) + RTFVerseMarkPost;
+ newtext = newtext + "\\par ";
+ }
+ else {
+ newtext = newtext + RTFVerseMarkPre + IntToStr(key->Verse()) + RTFVerseMarkPost;
+ newtext = newtext + RTFVersePre;
+ if ((key->Verse() == verse) && (dispAttribs.markCurrentVerse)) {
+ newtext = newtext + "\\cf2 "; // \cf2 = second color in color table
+ }
+ newtext += tmptext + RTFVersePost;
+ }
+ }
+ if (key->Verse() == verse) {
+ tmptext = newtext + RTFTrailer + "}";
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(tmptext.c_str(), tmptext.Length());
+ RTFStream->Position = 0;
+ Lines->LoadFromStream(RTFStream);
+ versepos = GetTextLen() - 3;
+ }
+ newtext = newtext + "}";
+ Module++;
+ }
+ newtext = newtext + RTFTrailer;
+ key->Verse(1); //{ When setting chapter: if (verse <> new chapter range) don't autonormalize. (we could've just turned the autonormalize option off then back on, but this is cooler) }
+ key->Chapter(1);
+ key->Book(1);
+ key->Testament(testmt);
+ key->Book(book);
+ key->Chapter(chap);
+ key->Verse(verse);
+ RTFStream->Clear();
+ RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
+ RTFStream->Position = 0;
+ Lines->LoadFromStream(RTFStream);
+
+ //{ Position control text at current verse }
+ this->SetFocus();
+ SelStart = versepos;
+ SendMessage(Handle, EM_SCROLLCARET, 0, 0);
+ return 0;
+}
+
+
+//---------------------------------------------------------------------------
+namespace Swdisprtfchap
+{
+ void __fastcall Register()
+ {
+ TComponentClass classes[1] = {__classid(SWDispRTFChap)};
+ RegisterComponents("SWORD", classes, 0);
+ }
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/swwinlog.cpp b/apps/windoze/swwinlog.cpp
new file mode 100644
index 0000000..cf7d8e8
--- /dev/null
+++ b/apps/windoze/swwinlog.cpp
@@ -0,0 +1,74 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "swwinlog.h"
+#include <stdio.h>
+#include <conio.h>
+#include <stdarg.h>
+//---------------------------------------------------------------------------
+
+SWWinLog::SWWinLog(HWND iparent) : SWLog() {
+ parent = iparent;
+}
+
+
+void SWWinLog::LogWarning(char *fmt, ...)
+{
+ char msg[2048];
+ va_list argptr;
+
+ if (logLevel >= 2) {
+ va_start(argptr, fmt);
+ vsprintf(msg, fmt, argptr);
+ va_end(argptr);
+
+ MessageBox(NULL, msg, "Warning", MB_OK);
+ }
+}
+
+
+void SWWinLog::LogError(char *fmt, ...)
+{
+ char msg[2048];
+ va_list argptr;
+
+ if (logLevel) {
+ va_start(argptr, fmt);
+ vsprintf(msg, fmt, argptr);
+ va_end(argptr);
+
+ MessageBox(NULL, msg, "Error", MB_OK);
+ }
+}
+
+
+void SWWinLog::LogTimedInformation(char *fmt, ...)
+{
+ char msg[2048];
+ va_list argptr;
+
+ if (logLevel >= 4) {
+ va_start(argptr, fmt);
+ vsprintf(msg, fmt, argptr);
+ va_end(argptr);
+
+ MessageBox(NULL, msg, "Information...", MB_OK);
+
+ }
+}
+
+
+void SWWinLog::LogInformation(char *fmt, ...)
+{
+ char msg[2048];
+ va_list argptr;
+
+ if (logLevel >= 3) {
+ va_start(argptr, fmt);
+ vsprintf(msg, fmt, argptr);
+ va_end(argptr);
+
+ MessageBox(NULL, msg, "Information", MB_OK);
+ }
+}
diff --git a/apps/windoze/tbdisp.cpp b/apps/windoze/tbdisp.cpp
new file mode 100644
index 0000000..45de2bd
--- /dev/null
+++ b/apps/windoze/tbdisp.cpp
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * tbdisp.cpp - code for class 'tbdisp'. tbdisp writes module output to a
+ * MSWindows TextBox (or any other control that takes a
+ * SetDialogItemText
+ */
+
+#include <swmodule.h>
+#include <tbdisp.h>
+#include <windows.h>
+#include <string.h>
+
+
+/******************************************************************************
+ * TBDisp Constructor - sets up an instance of TBDisp for use
+ *
+ * ENT: iwnd - window id on which control resides
+ * ictrlid - control id in which to display module text
+ */
+
+TBDisp::TBDisp(HWND iwnd, int ictrlid)
+{
+ wnd = iwnd;
+ ctrlid = ictrlid;
+}
+
+
+/******************************************************************************
+ * SWDisplay::Display - casts a module to a character pointer and displays it in
+ * an MSWindows control
+ *
+ * ENT: imodule - module to display
+ *
+ * RET: error status
+ */
+
+char TBDisp::Display(SWModule &imodule)
+{
+ char *buf, *to;
+ const char *mtext;
+
+ mtext = (const char *)imodule;
+
+ buf = new char [ strlen(mtext) + 100 ];
+
+ for (to = buf; *mtext; mtext++) {
+ if (*mtext == '\n')
+ *to++ = '\r';
+ *to++ = *mtext;
+ }
+ *to = 0;
+
+ SetDlgItemText(wnd, ctrlid, buf);
+ delete [] buf;
+ return 0;
+}