summaryrefslogtreecommitdiff
path: root/apps/windoze/CBuilder5/prototype
diff options
context:
space:
mode:
Diffstat (limited to 'apps/windoze/CBuilder5/prototype')
-rw-r--r--apps/windoze/CBuilder5/prototype/AboutBoxfrm.cpp85
-rw-r--r--apps/windoze/CBuilder5/prototype/AboutBoxfrm.dfmbin0 -> 2778 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/AboutBoxfrm.h36
-rw-r--r--apps/windoze/CBuilder5/prototype/AppBar.cpp234
-rw-r--r--apps/windoze/CBuilder5/prototype/AppBar.dfmbin0 -> 10405 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/AppBar.h94
-rw-r--r--apps/windoze/CBuilder5/prototype/Bitmap1.bmpbin0 -> 5318 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/BookMarkPanel.cpp352
-rw-r--r--apps/windoze/CBuilder5/prototype/BookMarkPanel.h39
-rw-r--r--apps/windoze/CBuilder5/prototype/CommentPanel.cpp222
-rw-r--r--apps/windoze/CBuilder5/prototype/CommentPanel.h39
-rw-r--r--apps/windoze/CBuilder5/prototype/DeskTopNameForm.cpp15
-rw-r--r--apps/windoze/CBuilder5/prototype/DeskTopNameForm.dfmbin0 -> 868 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/DeskTopNameForm.h27
-rw-r--r--apps/windoze/CBuilder5/prototype/DockCanvas.cpp16
-rw-r--r--apps/windoze/CBuilder5/prototype/DockCanvas.dfm18
-rw-r--r--apps/windoze/CBuilder5/prototype/DockCanvas.h21
-rw-r--r--apps/windoze/CBuilder5/prototype/LDPanel.cpp174
-rw-r--r--apps/windoze/CBuilder5/prototype/LDPanel.h39
-rw-r--r--apps/windoze/CBuilder5/prototype/ModInstForm.cpp14
-rw-r--r--apps/windoze/CBuilder5/prototype/ModInstForm.dfmbin0 -> 1457 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/ModInstForm.h27
-rw-r--r--apps/windoze/CBuilder5/prototype/ModTabPanel.cpp114
-rw-r--r--apps/windoze/CBuilder5/prototype/ModTabPanel.h30
-rw-r--r--apps/windoze/CBuilder5/prototype/TextPanel.cpp183
-rw-r--r--apps/windoze/CBuilder5/prototype/TextPanel.h34
-rw-r--r--apps/windoze/CBuilder5/prototype/back.bmpbin0 -> 780 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/biblecsmgr.cpp88
-rw-r--r--apps/windoze/CBuilder5/prototype/biblecsmgr.h23
-rw-r--r--apps/windoze/CBuilder5/prototype/bookmark.bmpbin0 -> 758 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/bookmarkfrm.cpp222
-rw-r--r--apps/windoze/CBuilder5/prototype/bookmarkfrm.dfmbin0 -> 1627 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/bookmarkfrm.h48
-rw-r--r--apps/windoze/CBuilder5/prototype/bookmarks/personal.conf7
-rw-r--r--apps/windoze/CBuilder5/prototype/desktop.bmpbin0 -> 374 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/desktop2.bmpbin0 -> 246 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/editentryfrm.cpp332
-rw-r--r--apps/windoze/CBuilder5/prototype/editentryfrm.dfmbin0 -> 22859 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/editentryfrm.h108
-rw-r--r--apps/windoze/CBuilder5/prototype/mainfrm.cpp825
-rw-r--r--apps/windoze/CBuilder5/prototype/mainfrm.dfmbin0 -> 10684 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/mainfrm.h238
-rw-r--r--apps/windoze/CBuilder5/prototype/newbmfilefrm.cpp14
-rw-r--r--apps/windoze/CBuilder5/prototype/newbmfilefrm.dfmbin0 -> 1638 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/newbmfilefrm.h27
-rw-r--r--apps/windoze/CBuilder5/prototype/optionfrm.cpp20
-rw-r--r--apps/windoze/CBuilder5/prototype/optionfrm.dfmbin0 -> 2521 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/optionfrm.h39
-rw-r--r--apps/windoze/CBuilder5/prototype/options.conf15
-rw-r--r--apps/windoze/CBuilder5/prototype/search.bmpbin0 -> 780 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/searchfrm.cpp95
-rw-r--r--apps/windoze/CBuilder5/prototype/searchfrm.dfmbin0 -> 2304 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/searchfrm.h44
-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/sword.resbin0 -> 876 bytes
-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/CBuilder5/prototype/versesel.cpp22
-rw-r--r--apps/windoze/CBuilder5/prototype/versesel.dfmbin0 -> 677 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/versesel.h27
-rw-r--r--apps/windoze/CBuilder5/prototype/vrslstfrm.cpp50
-rw-r--r--apps/windoze/CBuilder5/prototype/vrslstfrm.dfmbin0 -> 561 bytes
-rw-r--r--apps/windoze/CBuilder5/prototype/vrslstfrm.h29
65 files changed, 4509 insertions, 0 deletions
diff --git a/apps/windoze/CBuilder5/prototype/AboutBoxfrm.cpp b/apps/windoze/CBuilder5/prototype/AboutBoxfrm.cpp
new file mode 100644
index 0000000..39ca670
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/AboutBoxfrm.cpp
@@ -0,0 +1,85 @@
+//---------------------------------------------------------------------
+#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"};
+
+ AnsiString newtext, tmptext;
+ ModMap::iterator it;
+ SectionMap::iterator it2;
+ 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 < 3; 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 ";
+ newtext = newtext + "{\\fs20\\cf0 " + (*it2).second["About"].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 += "All the people at The Outpost in Scottsdale for testing and suggestions; The Bible Foundation: Jerry Kingery, Jerry Hastings; Geoffrey W. Hastings; William Dicks; Everyone on b-greek@virginia.edu; Michael Paul Johnson; Roland Nygren; Bill Kincaid; Mark Fuller; Larry Pierce; Franklin Bratcher; Gregory Hall; Luis Cortes\\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;
+
+
+}
+//---------------------------------------------------------------------------
+
+
+
+
diff --git a/apps/windoze/CBuilder5/prototype/AboutBoxfrm.dfm b/apps/windoze/CBuilder5/prototype/AboutBoxfrm.dfm
new file mode 100644
index 0000000..4911690
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/AboutBoxfrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/AboutBoxfrm.h b/apps/windoze/CBuilder5/prototype/AboutBoxfrm.h
new file mode 100644
index 0000000..77da4f8
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/AboutBoxfrm.h
@@ -0,0 +1,36 @@
+//----------------------------------------------------------------------------
+#ifndef AboutBoxfrmH
+#define AboutBoxfrmH
+//----------------------------------------------------------------------------
+#include <vcl\System.hpp>
+#include <vcl\Windows.hpp>
+#include <vcl\SysUtils.hpp>
+#include <vcl\Classes.hpp>
+#include <vcl\Graphics.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Buttons.hpp>
+#include <vcl\ExtCtrls.hpp>
+#include <vcl\ComCtrls.hpp>
+//----------------------------------------------------------------------------
+class TAboutBox : public TForm
+{
+__published:
+ TPanel *Panel1;
+ TImage *ProgramIcon;
+ TLabel *ProductName;
+ TLabel *Version;
+ TLabel *Copyright;
+ TButton *OKButton;
+ TRichEdit *CreditAbout;
+ TRichEdit *ModulesAbout;
+ void __fastcall FormShow(TObject *Sender);
+private:
+public:
+ virtual __fastcall TAboutBox(TComponent* AOwner);
+};
+//----------------------------------------------------------------------------
+extern TAboutBox *AboutBox;
+//----------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/AppBar.cpp b/apps/windoze/CBuilder5/prototype/AppBar.cpp
new file mode 100644
index 0000000..8d7cf98
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/AppBar.cpp
@@ -0,0 +1,234 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "AppBar.h"
+#include "DockCanvas.h"
+#include "ModTabPanel.h"
+#include "biblecsmgr.h"
+#include "BookMarkPanel.h"
+#include "DeskTopNameForm.h"
+#include <versekey.h>
+#include "vrslstfrm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+//#pragma link "MenuBar"
+#pragma resource "*.dfm"
+TAppBarFrm *AppBarFrm;
+//---------------------------------------------------------------------------
+__fastcall TAppBarFrm::TAppBarFrm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TAppBarFrm::FormCreate(TObject *Sender)
+{
+ ImageList1->Add(BackBtnImage->Picture->Bitmap, NULL);
+ ImageList1->Add(SearchBtnImage->Picture->Bitmap, NULL);
+ mainmgr = new BibleCSMGR(ModInstFrm);
+ commonVK = new VerseKey();
+ commonVK->Persist(true);
+ commonSK = new SWKey();
+ commonSK->Persist(true);
+ *commonVK = "Jas 1:19";
+ fillVKeySelector(commonVK);
+ ModMap::iterator it;
+ SWKey *tryKey;
+ for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) {
+ tryKey = it->second->CreateKey();
+ const SWClass *keyClass = tryKey->getClass();
+ bool yes = (keyClass->isAssignableFrom("VerseKey"));
+ SWKey *vkey = (yes) ? commonVK:commonSK;
+ it->second->SetKey(vkey);
+ delete tryKey;
+ }
+ activeDesktop = 0;
+ TextKeyChanged();
+}
+//---------------------------------------------------------------------------
+void __fastcall TAppBarFrm::SpeedButton2Click(TObject *Sender)
+{
+ if (activeDesktop) {
+ TModTabPanel *textTabs = new TModTabPanel(activeDesktop, mainmgr, "Biblical Texts");
+ textTabs->ManualDock(activeDesktop, NULL, alLeft);
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TAppBarFrm::SpeedButton5Click(TObject *Sender)
+{
+ if (activeDesktop) {
+ TBookMarkPanel *bookmarks = new TBookMarkPanel(activeDesktop);
+ bookmarks->ManualDock(activeDesktop, NULL, alLeft);
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TAppBarFrm::SpeedButton3Click(TObject *Sender)
+{
+ if (activeDesktop) {
+ TModTabPanel *textTabs = new TModTabPanel(activeDesktop, mainmgr, "Commentaries");
+ textTabs->ManualDock(activeDesktop, NULL, alLeft);
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TAppBarFrm::SpeedButton4Click(TObject *Sender)
+{
+ if (activeDesktop) {
+ TModTabPanel *textTabs = new TModTabPanel(activeDesktop, mainmgr, "Lexicons / Dictionaries");
+ textTabs->ManualDock(activeDesktop, NULL, alLeft);
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TAppBarFrm::TabControl1Change(TObject *Sender)
+{
+ int index = TabControl1->TabIndex;
+ if (index > -1) {
+ activeDesktop = ((TForm *)(TabControl1->Tabs->Objects[index]));
+ activeDesktop->Show();
+ }
+ else activeDesktop = 0;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TAppBarFrm::SpeedButton1Click(TObject *Sender)
+{
+ DeskTopNameFrm->ShowModal();
+ activeDesktop = new TDockCanvasFrm(this);
+ activeDesktop->OnClose = FormClose;
+ activeDesktop->OnActivate = FormActivate;
+ activeDesktop->Caption = DeskTopNameFrm->desktopName->Text;
+ TabControl1->Tabs->AddObject(activeDesktop->Caption, activeDesktop);
+ if (activeDesktop->Top < (this->Top + this->Height))
+ activeDesktop->Top = this->Top + this->Height + 1;
+ activeDesktop->Show();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TAppBarFrm::FormClose(TObject *Sender,
+ TCloseAction &Action)
+{
+ int index = TabControl1->Tabs->IndexOfObject(Sender);
+ TabControl1->Tabs->Delete(index);
+ TabControl1->TabIndex = 0;
+ TabControl1Change(Sender);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TAppBarFrm::FormActivate(TObject *Sender)
+{
+ int index = TabControl1->Tabs->IndexOfObject(Sender);
+ TabControl1->TabIndex = index;
+ TabControl1Change(Sender);
+}
+//---------------------------------------------------------------------------
+
+void TAppBarFrm::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 __fastcall TAppBarFrm::FormDestroy(TObject *Sender)
+{
+ delete commonVK;
+ delete commonSK;
+}
+void TAppBarFrm::RefreshActiveSheet(TPageControl *pc)
+{
+ ModMap::iterator it;
+ if (mainmgr) {
+ 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 TAppBarFrm::TextKeyChanged()
+{
+ cbBook->ItemIndex = cbBook->Items->IndexOf(commonVK->books[commonVK->Testament()-1][commonVK->Book()-1].name);
+ CHBox->Text = commonVK->Chapter();
+ VSBox->Text = commonVK->Verse();
+ freeHandLookup->Text = (const char *)*commonVK;
+
+ if (activeDesktop) {
+ for (int i = 0; i < activeDesktop->DockClientCount; i++) {
+ TPanel *panel = dynamic_cast<TPanel *>(activeDesktop->DockClients[i]);
+ if (panel) {
+ TPageControl *pc = dynamic_cast<TPageControl *>(panel->Controls[0]);
+ if (pc)
+ RefreshActiveSheet(pc);
+ }
+ }
+ }
+
+// RefreshActiveSheet(PageControl1);
+// logmodstate = false; // only log state once
+// RefreshActiveSheet(PageControl2);
+// logmodstate = true;
+}
+void __fastcall TAppBarFrm::btnLookupClick(TObject *Sender)
+{
+ if (!(StrToInt(CHBox->Text)) || (!StrToInt(VSBox->Text)))
+ commonVK->AutoNormalize(0);
+
+ if (StrToInt(CHBox->Text) < 0)
+ CHBox->Text = StrToInt(CHBox->Text) + 1;
+ if (StrToInt(VSBox->Text) < 0)
+ VSBox->Text = StrToInt(VSBox->Text) + 1;
+
+ *commonVK = (cbBook->Text + " " + CHBox->Text + ":" + VSBox->Text).c_str();
+ TextKeyChanged();
+ commonVK->AutoNormalize(1);
+}
+
+void __fastcall TAppBarFrm::UpDown1Click(TObject *Sender,
+ TUDBtnType Button)
+{
+ btnLookupClick(Sender);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TAppBarFrm::freeHandLookupKeyPress(TObject *Sender,
+ char &Key)
+{
+ if (Key == '\r') {
+ ListKey tmpVerseList = commonVK->ParseVerseList(freeHandLookup->Text.c_str(), *commonVK);
+
+ 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 = "User Verse List";
+ tmpForm->Show();
+ }
+
+ tmpVerseList = TOP;
+ *commonVK = tmpVerseList;
+ TextKeyChanged();
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
diff --git a/apps/windoze/CBuilder5/prototype/AppBar.dfm b/apps/windoze/CBuilder5/prototype/AppBar.dfm
new file mode 100644
index 0000000..f11d879
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/AppBar.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/AppBar.h b/apps/windoze/CBuilder5/prototype/AppBar.h
new file mode 100644
index 0000000..4839b2f
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/AppBar.h
@@ -0,0 +1,94 @@
+//---------------------------------------------------------------------------
+#ifndef AppBarH
+#define AppBarH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <ComCtrls.hpp>
+#include <ExtCtrls.hpp>
+#include <Graphics.hpp>
+#include <ToolWin.hpp>
+#include <Menus.hpp>
+//#include <MenuBar.hpp>
+#include <ImgList.hpp>
+//#include <DockCanvas.h>
+class SWMgr;
+class VerseKey;
+class SWKey;
+//---------------------------------------------------------------------------
+class TAppBarFrm : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TPanel *Panel2;
+ TTabControl *TabControl1;
+ TCoolBar *CoolBar1;
+ TImage *BackBtnImage;
+ TImage *SearchBtnImage;
+ TToolBar *ToolBar2;
+ TToolButton *ToolButton3;
+ TToolButton *ToolButton4;
+ TPanel *Panel3;
+ TSpeedButton *btnLookup;
+ TComboBox *cbBook;
+ TEdit *CHBox;
+ TUpDown *UpDown1;
+ TEdit *VSBox;
+ TUpDown *UpDown2;
+ TToolBar *ToolBar1;
+ TSpeedButton *Bookmarkbtn;
+ TPanel *pnlSpeed;
+ TCoolBar *CoolBar2;
+ TMainMenu *MainMenu2;
+ TMenuItem *File1;
+ TMenuItem *Options1;
+ TMenuItem *SaveLayout1;
+ TMenuItem *N1;
+ TMenuItem *Exit1;
+ TMenuItem *Edit2;
+ TMenuItem *Copy3;
+ TMenuItem *Search3;
+ TMenuItem *NewSearchWindow1;
+ TMenuItem *Help4;
+ TMenuItem *About1;
+ TImageList *ImageList1;
+ TImage *Image2;
+ TImage *Image1;
+ TPanel *Panel4;
+ TSpeedButton *SpeedButton1;
+ TSpeedButton *SpeedButton2;
+ TSpeedButton *SpeedButton3;
+ TSpeedButton *SpeedButton4;
+ TSpeedButton *SpeedButton5;
+ TComboBox *freeHandLookup;
+ void __fastcall FormCreate(TObject *Sender);
+ void __fastcall SpeedButton2Click(TObject *Sender);
+ void __fastcall SpeedButton5Click(TObject *Sender);
+ void __fastcall SpeedButton3Click(TObject *Sender);
+ void __fastcall SpeedButton4Click(TObject *Sender);
+ void __fastcall TabControl1Change(TObject *Sender);
+ void __fastcall SpeedButton1Click(TObject *Sender);
+ void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
+ void __fastcall FormActivate(TObject *Sender);
+ void __fastcall btnLookupClick(TObject *Sender);
+ void __fastcall FormDestroy(TObject *Sender);
+ void __fastcall UpDown1Click(TObject *Sender, TUDBtnType Button);
+ void __fastcall freeHandLookupKeyPress(TObject *Sender, char &Key);
+private: // User declarations
+ void RefreshActiveSheet(TPageControl *pc);
+ void TextKeyChanged();
+ void fillVKeySelector(VerseKey *vk);
+ VerseKey *commonVK;
+ SWKey *commonSK;
+public: // User declarations
+ __fastcall TAppBarFrm(TComponent* Owner);
+ SWMgr *mainmgr;
+ TForm *activeDesktop;
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TAppBarFrm *AppBarFrm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/Bitmap1.bmp b/apps/windoze/CBuilder5/prototype/Bitmap1.bmp
new file mode 100644
index 0000000..cab8e28
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/Bitmap1.bmp
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/BookMarkPanel.cpp b/apps/windoze/CBuilder5/prototype/BookMarkPanel.cpp
new file mode 100644
index 0000000..78dd615
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/BookMarkPanel.cpp
@@ -0,0 +1,352 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "BookMarkPanel.h"
+#pragma package(smart_init)
+#include "newbmfilefrm.h"
+//#include <dir.h>
+#include <io.h>
+#include <dirent.h>
+#include <swconfig.h>
+//---------------------------------------------------------------------------
+// ValidCtrCheck is used to assure that the components created do not have
+// any pure virtual functions.
+//
+
+static inline void ValidCtrCheck(TBookMarkPanel *)
+{
+ new TBookMarkPanel(NULL);
+}
+//---------------------------------------------------------------------------
+__fastcall TBookMarkPanel::TBookMarkPanel(TComponent* Owner)
+ : TPanel(Owner)
+{
+ BMPopup = new TPopupMenu(this);
+ TMenuItem * newitem;
+ newitem = new TMenuItem(BMPopup);
+ newitem->Caption = "&Add Child";
+ newitem->OnClick = AddChild1Click;
+ BMPopup->Items->Add(newitem);
+ newitem = new TMenuItem(BMPopup);
+ newitem->Caption = "&Delete";
+ newitem->OnClick = Delete1Click;
+ BMPopup->Items->Add(newitem);
+ newitem = new TMenuItem(BMPopup);
+ newitem->Caption = "&Rename";
+ newitem->OnClick = Rename1Click;
+ BMPopup->Items->Add(newitem);
+ newitem = new TMenuItem(BMPopup);
+ newitem->Caption = "-";
+ BMPopup->Items->Add(newitem);
+ newitem = new TMenuItem(BMPopup);
+ newitem->Caption = "&New Bookmark File";
+ newitem->OnClick = NewBookmarkFile1Click;
+ BMPopup->Items->Add(newitem);
+}
+
+
+__fastcall TBookMarkPanel::~TBookMarkPanel()
+{
+ list <String *>::iterator it;
+
+ SaveBookmarks();
+
+ for (it = bmfiles.begin(); it != bmfiles.end(); it++)
+ delete *it;
+}
+
+
+void __fastcall TBookMarkPanel::CreateWnd() {
+
+ TPanel::CreateWnd();
+
+ SWConfig *bookmarks;
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit;
+ TTreeNode *node;
+
+ DIR *dir;
+ struct dirent *ent;
+ string conffile;
+ bmdir = "";
+ SWConfig optionsconf("./options.conf");
+
+ this->DragMode = dmAutomatic;
+ this->DragKind = dkDock;
+ this->UseDockManager = true;
+
+ bmtree = new TTreeView(this);
+ bmtree->Parent = this;
+ bmtree->Align = alClient;
+ bmtree->Items->Clear();
+ bmtree->PopupMenu = BMPopup;
+
+ if ((sit = optionsconf.Sections.find("Bookmarks")) != 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);
+ }
+/*
+ SWConfig *bookmarks;
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit;
+ TTreeNode *node;
+
+ DIR *dir;
+ struct dirent *ent;
+ string conffile;
+ bmdir = "";
+ SWConfig optionsconf("./options.conf");
+
+ this->DragMode = dmAutomatic;
+ this->DragKind = dkDock;
+ this->UseDockManager = true;
+
+ bmtree = new TTreeView(this);
+ bmtree->Parent = this;
+ bmtree->Align = alClient;
+ bmtree->DragMode = dmAutomatic;
+ bmtree->Indent = 19;
+ bmtree->PopupMenu = BMPopup;
+ bmtree->TabOrder = 0;
+ bmtree->OnDblClick = bmtreeDblClick;
+ bmtree->OnDragDrop = bmtreeDragDrop;
+ bmtree->OnDragOver = bmtreeDragOver;
+
+
+
+ bmtree->Items->Clear();
+
+ if ((sit = optionsconf.Sections.find("Bookmarks")) != optionsconf.Sections.end())
+ bmdir = (*sit).second["Directory"];
+
+// 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);
+ 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);
+ 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);
+ }
+*/
+}
+
+
+void TBookMarkPanel::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 TBookMarkPanel::bmtreeDragDrop(TObject *Sender, TObject *Source,
+ int X, int Y)
+{
+ bmtree->Selected->MoveTo(bmtree->DropTarget, naAddChildFirst);
+}
+//---------------------------------------------------------------------------
+void __fastcall TBookMarkPanel::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 TBookMarkPanel::bmtreeDblClick(TObject *Sender)
+{
+ if (!bmtree->Selected->getFirstChild()) {
+// Form1->DefaultVSKey = bmtree->Selected->Text.c_str();
+// Form1->TextKeyChanged();
+ }
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TBookMarkPanel::AddChild1Click(TObject *Sender)
+{
+ bmtree->Selected->Expand(false);
+ bmtree->Items->AddChildFirst(bmtree->Selected, "New Topic")->EditText();
+}
+//---------------------------------------------------------------------------
+void __fastcall TBookMarkPanel::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 TBookMarkPanel::Rename1Click(TObject *Sender)
+{
+ bmtree->Selected->EditText();
+}
+//---------------------------------------------------------------------------
+
+void TBookMarkPanel::SaveBookmarks()
+{
+ TTreeNode *tree = 0;
+ SWConfig *bmconf;
+ ConfigEntMap emap;
+ SectionMap::iterator sit;
+ char buf[15];
+ bool personal, other;
+ list <String *>::iterator it;
+ string persfile;
+ SWConfig optionsconf("./options.conf");
+
+ if (bmtree->Items->Count)
+ tree = bmtree->Items->Item[0];
+
+ if ((sit = optionsconf.Sections.find("Bookmarks")) != 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 TBookMarkPanel::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 TBookMarkPanel::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"))));
+ }
+}
+
+
+
+//---------------------------------------------------------------------------
+namespace Bookmarkpanel
+{
+ void __fastcall PACKAGE Register()
+ {
+ TComponentClass classes[1] = {__classid(TBookMarkPanel)};
+ RegisterComponents("Samples", classes, 0);
+ }
+}
+//---------------------------------------------------------------------------
+ \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/BookMarkPanel.h b/apps/windoze/CBuilder5/prototype/BookMarkPanel.h
new file mode 100644
index 0000000..c998b76
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/BookMarkPanel.h
@@ -0,0 +1,39 @@
+//---------------------------------------------------------------------------
+#ifndef BookMarkPanelH
+#define BookMarkPanelH
+//---------------------------------------------------------------------------
+#include <SysUtils.hpp>
+#include <Controls.hpp>
+#include <Classes.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+#include <swconfig.h>
+#include <list>
+//---------------------------------------------------------------------------
+class PACKAGE TBookMarkPanel : public TPanel
+{
+private:
+ void AddSection(SWConfig *config, TTreeView *tree, TTreeNode *parent, String section);
+ list <String *> bmfiles; // so we can delete each display we create
+protected:
+public:
+ __fastcall TBookMarkPanel(TComponent* Owner);
+ virtual __fastcall ~TBookMarkPanel();
+ virtual void __fastcall CreateWnd();
+ string bmdir;
+ void SaveBookmarks();
+ void AddSectionToConf(SWConfig *config, String section, TTreeNode *tree);
+__published:
+ TTreeView *bmtree;
+ TPopupMenu *BMPopup;
+ 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);
+};
+//---------------------------------------------------------------------------
+#endif
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/CommentPanel.h b/apps/windoze/CBuilder5/prototype/CommentPanel.h
new file mode 100644
index 0000000..6fa9145
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/CommentPanel.h
@@ -0,0 +1,39 @@
+//---------------------------------------------------------------------------
+#ifndef CommentPanelH
+#define CommentPanelH
+//---------------------------------------------------------------------------
+#include <SysUtils.hpp>
+#include <Controls.hpp>
+#include <Classes.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+class SWDisplay;
+class SWModule;
+class SWMgr;
+
+
+
+//---------------------------------------------------------------------------
+class PACKAGE TCommentPanel : public TPanel
+{
+private:
+protected:
+public:
+ __fastcall TCommentPanel(TComponent* Owner, SWModule *mod = 0, SWMgr *mgr = 0);
+ __fastcall virtual ~TCommentPanel();
+ SWDisplay *display;
+ SWModule *module;
+ SWMgr *mgr;
+ char *font;
+__published:
+ TPopupMenu *menu;
+ virtual void __fastcall CreateWnd();
+ void __fastcall PopupMenuPopup(TObject *Sender);
+ void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender);
+ void __fastcall Copy1Click(TObject *Sender);
+ void __fastcall DictionaryLookup1Click(TObject *Sender);
+ void __fastcall RTFMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void BuildRTFHeader(char *buf, char *font, int max);
+};
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/DeskTopNameForm.cpp b/apps/windoze/CBuilder5/prototype/DeskTopNameForm.cpp
new file mode 100644
index 0000000..c3308b4
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/DeskTopNameForm.cpp
@@ -0,0 +1,15 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "DeskTopNameForm.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TDeskTopNameFrm *DeskTopNameFrm;
+//---------------------------------------------------------------------------
+__fastcall TDeskTopNameFrm::TDeskTopNameFrm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/prototype/DeskTopNameForm.dfm b/apps/windoze/CBuilder5/prototype/DeskTopNameForm.dfm
new file mode 100644
index 0000000..e64f7bd
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/DeskTopNameForm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/DeskTopNameForm.h b/apps/windoze/CBuilder5/prototype/DeskTopNameForm.h
new file mode 100644
index 0000000..3ef1549
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/DeskTopNameForm.h
@@ -0,0 +1,27 @@
+//---------------------------------------------------------------------------
+#ifndef DeskTopNameFormH
+#define DeskTopNameFormH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ComCtrls.hpp>
+#include <ExtCtrls.hpp>
+//---------------------------------------------------------------------------
+class TDeskTopNameFrm : public TForm
+{
+__published: // IDE-managed Components
+ TLabel *Label1;
+ TPanel *Panel1;
+ TButton *Button1;
+ TPanel *Panel2;
+ TEdit *desktopName;
+private: // User declarations
+public: // User declarations
+ __fastcall TDeskTopNameFrm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TDeskTopNameFrm *DeskTopNameFrm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/DockCanvas.cpp b/apps/windoze/CBuilder5/prototype/DockCanvas.cpp
new file mode 100644
index 0000000..2abf914
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/DockCanvas.cpp
@@ -0,0 +1,16 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include "DockCanvas.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TDockCanvasFrm *DockCanvasFrm;
+//---------------------------------------------------------------------------
+__fastcall TDockCanvasFrm::TDockCanvasFrm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/prototype/DockCanvas.dfm b/apps/windoze/CBuilder5/prototype/DockCanvas.dfm
new file mode 100644
index 0000000..6e80013
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/DockCanvas.dfm
@@ -0,0 +1,18 @@
+object DockCanvasFrm: TDockCanvasFrm
+ Left = 208
+ Top = 180
+ Width = 696
+ Height = 480
+ Caption = 'DockCanvasFrm'
+ Color = clBtnFace
+ UseDockManager = True
+ DockSite = True
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ OldCreateOrder = False
+ PixelsPerInch = 96
+ TextHeight = 13
+end
diff --git a/apps/windoze/CBuilder5/prototype/DockCanvas.h b/apps/windoze/CBuilder5/prototype/DockCanvas.h
new file mode 100644
index 0000000..c06c03a
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/DockCanvas.h
@@ -0,0 +1,21 @@
+//---------------------------------------------------------------------------
+
+#ifndef DockCanvasH
+#define DockCanvasH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+//---------------------------------------------------------------------------
+class TDockCanvasFrm : public TForm
+{
+__published: // IDE-managed Components
+private: // User declarations
+public: // User declarations
+ __fastcall TDockCanvasFrm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TDockCanvasFrm *DockCanvasFrm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/LDPanel.cpp b/apps/windoze/CBuilder5/prototype/LDPanel.cpp
new file mode 100644
index 0000000..b93af95
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/LDPanel.cpp
@@ -0,0 +1,174 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#include <vcl/clipbrd.hpp>
+#pragma hdrstop
+
+#include "LDPanel.h"
+#pragma package(smart_init)
+#include "swdisprtfchap.h"
+#include <swconfig.h>
+#include <swmodule.h>
+#include "Greek2Greek.h"
+#include <utilfuns.h>
+#include <swmgr.h>
+
+class RTFDisp : public SWDisplay {
+ SWDispRTF *edit;
+public:
+ RTFDisp(SWDispRTF *iedit) { edit = iedit; }
+ RTFDisp() {}
+ char Display(SWModule &imodule) {
+ edit->Display(imodule);
+ }
+};
+
+//---------------------------------------------------------------------------
+// ValidCtrCheck is used to assure that the components created do not have
+// any pure virtual functions.
+//
+
+static inline void ValidCtrCheck(TLDPanel *)
+{
+ new TLDPanel(NULL);
+}
+//---------------------------------------------------------------------------
+__fastcall TLDPanel::TLDPanel(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 TLDPanel::CreateWnd() {
+ TPanel::CreateWnd();
+
+ SWDispRTF *newrtf = new SWDispRTF(this);
+
+ newrtf->Parent = this;
+ newrtf->Align = alClient;
+ newrtf->ScrollBars = ssVertical;
+ newrtf->ReadOnly = true;
+// newrtf->PopupMenu = PopupMenu2;
+// newrtf->OnMouseDown = RTFMouseDown;
+ display = new RTFDisp(newrtf);
+ module->Disp(display);
+// mod->SetKey(DefaultStrKey);
+
+
+}
+__fastcall TLDPanel::~TLDPanel() {
+ delete display;
+ if (font)
+ delete font;
+}
+//---------------------------------------------------------------------------
+namespace Ldpanel
+{
+ void __fastcall PACKAGE Register()
+ {
+ TComponentClass classes[1] = {__classid(TLDPanel)};
+ RegisterComponents("Samples", classes, 0);
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TLDPanel::PopupMenuPopup(TObject *Sender)
+{
+}
+void TLDPanel::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 TLDPanel::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 TLDPanel::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 TLDPanel::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 TLDPanel::RTFMouseDown(TObject *Sender, TMouseButton Button,
+ TShiftState Shift, int X, int Y)
+{
+ ((TWinControl *)Sender)->SetFocus();
+}
diff --git a/apps/windoze/CBuilder5/prototype/LDPanel.h b/apps/windoze/CBuilder5/prototype/LDPanel.h
new file mode 100644
index 0000000..80dcdff
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/LDPanel.h
@@ -0,0 +1,39 @@
+//---------------------------------------------------------------------------
+#ifndef LDPanelH
+#define LDPanelH
+//---------------------------------------------------------------------------
+#include <SysUtils.hpp>
+#include <Controls.hpp>
+#include <Classes.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+class SWDisplay;
+class SWModule;
+class SWMgr;
+
+
+
+//---------------------------------------------------------------------------
+class PACKAGE TLDPanel : public TPanel
+{
+private:
+protected:
+public:
+ __fastcall TLDPanel(TComponent* Owner, SWModule *mod = 0, SWMgr *mgr = 0);
+ __fastcall virtual ~TLDPanel();
+ SWDisplay *display;
+ SWModule *module;
+ SWMgr *mgr;
+ char *font;
+__published:
+ TPopupMenu *menu;
+ virtual void __fastcall CreateWnd();
+ void __fastcall PopupMenuPopup(TObject *Sender);
+ void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender);
+ void __fastcall Copy1Click(TObject *Sender);
+ void __fastcall DictionaryLookup1Click(TObject *Sender);
+ void __fastcall RTFMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void BuildRTFHeader(char *buf, char *font, int max);
+};
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/ModInstForm.cpp b/apps/windoze/CBuilder5/prototype/ModInstForm.cpp
new file mode 100644
index 0000000..1763817
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/ModInstForm.cpp
@@ -0,0 +1,14 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "ModInstForm.h"
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TModInstFrm *ModInstFrm;
+//---------------------------------------------------------------------------
+__fastcall TModInstFrm::TModInstFrm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//--------------------------------------------------------------------------- \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/ModInstForm.dfm b/apps/windoze/CBuilder5/prototype/ModInstForm.dfm
new file mode 100644
index 0000000..41ce498
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/ModInstForm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/ModInstForm.h b/apps/windoze/CBuilder5/prototype/ModInstForm.h
new file mode 100644
index 0000000..f0cb90a
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/ModInstForm.h
@@ -0,0 +1,27 @@
+//---------------------------------------------------------------------------
+#ifndef ModInstFormH
+#define ModInstFormH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ComCtrls.hpp>
+#include <vcl\ExtCtrls.hpp>
+//---------------------------------------------------------------------------
+class TModInstFrm : public TForm
+{
+__published: // IDE-managed Components
+ TRichEdit *AboutText;
+ TPanel *Panel1;
+ TButton *Button1;
+ TLabel *ModText;
+private: // User declarations
+public: // User declarations
+ __fastcall TModInstFrm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern TModInstFrm *ModInstFrm;
+//---------------------------------------------------------------------------
+#endif
+ \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/ModTabPanel.cpp b/apps/windoze/CBuilder5/prototype/ModTabPanel.cpp
new file mode 100644
index 0000000..0d39acf
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/ModTabPanel.cpp
@@ -0,0 +1,114 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "ModTabPanel.h"
+#pragma package(smart_init)
+#include <swmgr.h>
+#include "TextPanel.h"
+#include "CommentPanel.h"
+#include "LDPanel.h"
+//---------------------------------------------------------------------------
+// ValidCtrCheck is used to assure that the components created do not have
+// any pure virtual functions.
+//
+
+static inline void ValidCtrCheck(TModTabPanel *)
+{
+ new TModTabPanel(NULL);
+}
+//---------------------------------------------------------------------------
+__fastcall TModTabPanel::TModTabPanel(TComponent* Owner, SWMgr *mgr, char *modType)
+ : TPanel(Owner)
+{
+ this->mgr = mgr;
+ this->modType = modType;
+}
+
+void __fastcall TModTabPanel::CreateWnd() {
+ TPanel::CreateWnd();
+ ModMap::iterator it;
+ SectionMap::iterator sit;
+ ConfigEntMap::iterator eit;
+ char *font;
+ this->DragMode = dmAutomatic;
+ this->DragKind = dkDock;
+ this->UseDockManager = true;
+ pageControl = new TPageControl(this);
+ pageControl->Parent = this;
+ pageControl->Align = alClient;
+ pageControl->MultiLine = True;
+ pageControl->ParentFont = False;
+ pageControl->ParentShowHint = False;
+ pageControl->ShowHint = True;
+ pageControl->TabHeight = 14;
+ pageControl->TabOrder = 0;
+ pageControl->OnChange = PageControl1Change;
+ for (it = mgr->Modules.begin(); it != mgr->Modules.end(); it++) {
+ if ((!strcmp((*it).second->Type(), "Biblical Texts")) && (!strcmp(modType.c_str(), "Biblical Texts"))) {
+ font = 0;
+ if ((sit = mgr->config->Sections.find((*it).second->Name())) != mgr->config->Sections.end()) {
+ if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) {
+ font = (char *)(*eit).second.c_str();
+ }
+ }
+ TTabSheet *newtab = new TTabSheet(this);
+ newtab->Caption = (*it).second->Name();
+ newtab->Hint = (*it).second->Description();
+ newtab->PageControl = pageControl;
+ TTextPanel *panel = new TTextPanel(this, (*it).second, font);
+ panel->Parent = newtab;
+ panel->Align = alClient;
+// CreateTextPane((*it).second, font);
+ }
+ if ((!strcmp((*it).second->Type(), "Commentaries")) && (!strcmp(modType.c_str(), "Commentaries"))) {
+ TTabSheet *newtab = new TTabSheet(this);
+ newtab->Caption = (*it).second->Name();
+ newtab->Hint = (*it).second->Description();
+ newtab->PageControl = pageControl;
+ TCommentPanel *panel = new TCommentPanel(this, (*it).second, mgr);
+ panel->Parent = newtab;
+ panel->Align = alClient;
+// CreateCommentPane((*it).second);
+ }
+ if ((!strcmp((*it).second->Type(), "Lexicons / Dictionaries")) && (!strcmp(modType.c_str(), "Lexicons / Dictionaries"))) {
+ TTabSheet *newtab = new TTabSheet(this);
+ newtab->Caption = (*it).second->Name();
+ newtab->Hint = (*it).second->Description();
+ newtab->PageControl = pageControl;
+ TLDPanel *panel = new TLDPanel(this, (*it).second, mgr);
+ panel->Parent = newtab;
+ panel->Align = alClient;
+// CreateLDPane((*it).second);
+ }
+ }
+}
+//---------------------------------------------------------------------------
+namespace Modtabpanel
+{
+ void __fastcall PACKAGE Register()
+ {
+ TComponentClass classes[1] = {__classid(TModTabPanel)};
+ RegisterComponents("Samples", classes, 0);
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TModTabPanel::PageControl1Change(TObject *Sender)
+{
+ RefreshActiveSheet();
+// Form1->ActiveControl = PageControl1;
+}
+
+
+void TModTabPanel::RefreshActiveSheet()
+{
+ ModMap::iterator it;
+
+ it = mgr->Modules.find(pageControl->ActivePage->Caption.c_str());
+ if (it != mgr->Modules.end()) {
+ (*it).second->Display();
+// if (logmodstate)
+// modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, (*it).second->KeyText()));
+ }
+}
+ \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/ModTabPanel.h b/apps/windoze/CBuilder5/prototype/ModTabPanel.h
new file mode 100644
index 0000000..9da8db2
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/ModTabPanel.h
@@ -0,0 +1,30 @@
+//---------------------------------------------------------------------------
+#ifndef ModTabPanelH
+#define ModTabPanelH
+//---------------------------------------------------------------------------
+#include <SysUtils.hpp>
+#include <Controls.hpp>
+#include <Classes.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+#include <string>
+
+class SWMgr;
+//---------------------------------------------------------------------------
+class PACKAGE TModTabPanel : public TPanel
+{
+private:
+protected:
+public:
+ SWMgr *mgr;
+ std::string modType;
+ __fastcall TModTabPanel(TComponent* Owner, SWMgr *mgr = 0, char *modtype = 0);
+ void RefreshActiveSheet();
+ virtual void __fastcall CreateWnd();
+
+__published:
+ TPageControl *pageControl;
+ void __fastcall PageControl1Change(TObject *Sender);
+};
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/TextPanel.cpp b/apps/windoze/CBuilder5/prototype/TextPanel.cpp
new file mode 100644
index 0000000..a534e12
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/TextPanel.cpp
@@ -0,0 +1,183 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#include <vcl/clipbrd.hpp>
+#pragma hdrstop
+
+#include "TextPanel.h"
+#pragma package(smart_init)
+#include "swdisprtfchap.h"
+#include <swconfig.h>
+#include <swmodule.h>
+#include "Greek2Greek.h"
+#include <utilfuns.h>
+
+class RTFDisp : public SWDisplay {
+ SWDispRTF *edit;
+public:
+ RTFDisp(SWDispRTF *iedit) { edit = iedit; }
+ RTFDisp() {}
+ char Display(SWModule &imodule) {
+ edit->Display(imodule);
+ }
+};
+
+
+//---------------------------------------------------------------------------
+// ValidCtrCheck is used to assure that the components created do not have
+// any pure virtual functions.
+//
+
+static inline void ValidCtrCheck(TTextPanel *)
+{
+ new TTextPanel(NULL);
+}
+//---------------------------------------------------------------------------
+__fastcall TTextPanel::TTextPanel(TComponent* Owner, SWModule *mod, char *font)
+ : TPanel(Owner)
+{
+ module = mod;
+ 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 TTextPanel::CreateWnd() {
+ TPanel::CreateWnd();
+ SWDispRTFChap *newrtf = new SWDispRTFChap(this);
+ char buf[512];
+ SectionMap::iterator sit;
+
+// newtab->Caption = mod->Name();
+// newtab->Hint = mod->Description();
+// newtab->PageControl = PageControl1;
+ newrtf->Parent = this;
+ newrtf->Align = alClient;
+ newrtf->ScrollBars = ssVertical;
+ newrtf->ReadOnly = true;
+ newrtf->PopupMenu = menu;
+ 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;
+// }
+ display = new RTFDisp(newrtf);
+ module->Disp(display);
+// mod->SetKey(DefaultVSKey);
+
+}
+__fastcall TTextPanel::~TTextPanel() {
+ delete display;
+ if (font)
+ delete font;
+}
+//---------------------------------------------------------------------------
+namespace Textpanel
+{
+ void __fastcall PACKAGE Register()
+ {
+ TComponentClass classes[1] = {__classid(TTextPanel)};
+ RegisterComponents("Samples", classes, 0);
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TTextPanel::PopupMenuPopup(TObject *Sender)
+{
+}
+void TTextPanel::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 TTextPanel::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 TTextPanel::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 TTextPanel::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 TTextPanel::RTFMouseDown(TObject *Sender, TMouseButton Button,
+ TShiftState Shift, int X, int Y)
+{
+ ((TWinControl *)Sender)->SetFocus();
+}
diff --git a/apps/windoze/CBuilder5/prototype/TextPanel.h b/apps/windoze/CBuilder5/prototype/TextPanel.h
new file mode 100644
index 0000000..6103088
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/TextPanel.h
@@ -0,0 +1,34 @@
+//---------------------------------------------------------------------------
+#ifndef TextPanelH
+#define TextPanelH
+//---------------------------------------------------------------------------
+#include <SysUtils.hpp>
+#include <Controls.hpp>
+#include <Classes.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+class SWDisplay;
+class SWModule;
+//---------------------------------------------------------------------------
+class PACKAGE TTextPanel : public TPanel
+{
+private:
+protected:
+public:
+ __fastcall TTextPanel(TComponent* Owner, SWModule *mod = 0, char *font = 0);
+ __fastcall virtual ~TTextPanel();
+ SWDisplay *display;
+ SWModule *module;
+ char *font;
+__published:
+ TPopupMenu *menu;
+ virtual void __fastcall CreateWnd();
+ void __fastcall PopupMenuPopup(TObject *Sender);
+ void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender);
+ void __fastcall Copy1Click(TObject *Sender);
+ void __fastcall DictionaryLookup1Click(TObject *Sender);
+ void __fastcall RTFMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void BuildRTFHeader(char *buf, char *font, int max);
+};
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/back.bmp b/apps/windoze/CBuilder5/prototype/back.bmp
new file mode 100644
index 0000000..5284295
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/back.bmp
Binary files differ
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/biblecsmgr.h b/apps/windoze/CBuilder5/prototype/biblecsmgr.h
new file mode 100644
index 0000000..38f8320
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/biblecsmgr.h
@@ -0,0 +1,23 @@
+//---------------------------------------------------------------------------
+#ifndef biblecsmgrH
+#define biblecsmgrH
+#include <swmgr.h>
+#include "ModInstForm.h"
+//---------------------------------------------------------------------------
+class BibleCSMGR : public SWMgr {
+ TModInstFrm *ModInstFrm;
+ SWFilter *gbftortf;
+ SWFilter *rwptortf;
+ SWFilter *thmltortf;
+
+protected:
+ virtual char AddModToConfig(int conffd, const char *fname);
+ virtual void AddRenderFilters(SWModule *module, ConfigEntMap &section);
+
+public:
+ BibleCSMGR(TModInstFrm *iModInstFrm);
+ virtual ~BibleCSMGR();
+};
+
+#endif
+ \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/bookmark.bmp b/apps/windoze/CBuilder5/prototype/bookmark.bmp
new file mode 100644
index 0000000..4b6df0c
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/bookmark.bmp
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/bookmarkfrm.cpp b/apps/windoze/CBuilder5/prototype/bookmarkfrm.cpp
new file mode 100644
index 0000000..e284b85
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/bookmarkfrm.cpp
@@ -0,0 +1,222 @@
+//---------------------------------------------------------------------------
+#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"
+TBookmarksfrm *Bookmarksfrm;
+//---------------------------------------------------------------------------
+__fastcall TBookmarksfrm::TBookmarksfrm(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 = (*sit).second["Directory"];
+
+// 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 TBookmarksfrm::~TBookmarksfrm()
+{
+ list <String *>::iterator it;
+
+ SaveBookmarks();
+
+ for (it = bmfiles.begin(); it != bmfiles.end(); it++)
+ delete *it;
+}
+
+
+//---------------------------------------------------------------------------
+
+void TBookmarksfrm::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 TBookmarksfrm::bmtreeDragDrop(TObject *Sender, TObject *Source,
+ int X, int Y)
+{
+ bmtree->Selected->MoveTo(bmtree->DropTarget, naAddChildFirst);
+}
+//---------------------------------------------------------------------------
+void __fastcall TBookmarksfrm::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 TBookmarksfrm::bmtreeDblClick(TObject *Sender)
+{
+ if (!bmtree->Selected->getFirstChild()) {
+ Form1->DefaultVSKey = bmtree->Selected->Text.c_str();
+ Form1->TextKeyChanged();
+ }
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TBookmarksfrm::AddChild1Click(TObject *Sender)
+{
+ bmtree->Selected->Expand(false);
+ bmtree->Items->AddChildFirst(bmtree->Selected, "New Topic")->EditText();
+}
+//---------------------------------------------------------------------------
+void __fastcall TBookmarksfrm::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 TBookmarksfrm::Rename1Click(TObject *Sender)
+{
+ bmtree->Selected->EditText();
+}
+//---------------------------------------------------------------------------
+
+void TBookmarksfrm::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["AutoSavePersonal"].c_str())) ? true:false;
+ other = (atoi((*sit).second["AutoSaveOther"].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[buf] = tree->Text.c_str();
+ AddSectionToConf(bmconf, buf, tree);
+ bmconf->Sections["ROOT"] = emap;
+ bmconf->Save();
+ }
+ }
+}
+
+
+void TBookmarksfrm::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[buf] = tree->Text.c_str();
+ AddSectionToConf(config, buf, tree);
+ }
+ config->Sections[section.c_str()] = sit;
+ }
+}
+
+void __fastcall TBookmarksfrm::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"))));
+ }
+}
+//--------------------------------------------------------------------------- \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/bookmarkfrm.dfm b/apps/windoze/CBuilder5/prototype/bookmarkfrm.dfm
new file mode 100644
index 0000000..deb814d
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/bookmarkfrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/bookmarkfrm.h b/apps/windoze/CBuilder5/prototype/bookmarkfrm.h
new file mode 100644
index 0000000..4c37796
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/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 TBookmarksfrm : 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 TBookmarksfrm(TComponent* Owner);
+ __fastcall ~TBookmarksfrm();
+ void SaveBookmarks();
+ void AddSectionToConf(SWConfig *config, String section, TTreeNode *tree);
+};
+//---------------------------------------------------------------------------
+extern TBookmarksfrm *Bookmarksfrm;
+//---------------------------------------------------------------------------
+#endif
+ \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/bookmarks/personal.conf b/apps/windoze/CBuilder5/prototype/bookmarks/personal.conf
new file mode 100644
index 0000000..9608d37
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/bookmarks/personal.conf
@@ -0,0 +1,7 @@
+
+[ROOT]
+branch0=Personal Bookmarks
+
+[branch0]
+branch1=Ezekiel 1:1
+
diff --git a/apps/windoze/CBuilder5/prototype/desktop.bmp b/apps/windoze/CBuilder5/prototype/desktop.bmp
new file mode 100644
index 0000000..5692668
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/desktop.bmp
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/desktop2.bmp b/apps/windoze/CBuilder5/prototype/desktop2.bmp
new file mode 100644
index 0000000..fa1bf08
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/desktop2.bmp
Binary files differ
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/editentryfrm.dfm b/apps/windoze/CBuilder5/prototype/editentryfrm.dfm
new file mode 100644
index 0000000..3b40fc4
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/editentryfrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/editentryfrm.h b/apps/windoze/CBuilder5/prototype/editentryfrm.h
new file mode 100644
index 0000000..058c385
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/editentryfrm.h
@@ -0,0 +1,108 @@
+//----------------------------------------------------------------------------
+//Borland C++Builder
+//Copyright (c) 1987, 1998 Borland International Inc. All Rights Reserved.
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+#ifndef editentryfrmH
+#define editentryfrmH
+//----------------------------------------------------------------------------
+#include <Outline.hpp>
+#include <Grids.hpp>
+#include <Buttons.hpp>
+#include <ExtCtrls.hpp>
+#include <StdCtrls.hpp>
+#include <ComCtrls.hpp>
+#include <Menus.hpp>
+#include <Dialogs.hpp>
+#include <Forms.hpp>
+#include <Controls.hpp>
+#include <Graphics.hpp>
+#include <Classes.hpp>
+#include <SysUtils.hpp>
+#include <Messages.hpp>
+#include <Windows.hpp>
+#include <System.hpp>
+#include <swmodule.h>
+#include <swdisprtf.h>
+//----------------------------------------------------------------------------
+class TEditEntry : public TForm
+{
+__published:
+ TPanel *SpeedBar;
+ TSpeedButton *UndoButton;
+ TSpeedButton *CutButton;
+ TSpeedButton *CopyButton;
+ TSpeedButton *PasteButton;
+ TBevel *Bevel1;
+ TSpeedButton *BoldButton;
+ TSpeedButton *ItalicButton;
+ TSpeedButton *LeftAlign;
+ TSpeedButton *CenterAlign;
+ TSpeedButton *RightAlign;
+ TSpeedButton *UnderlineButton;
+ TSpeedButton *BulletsButton;
+ TEdit *FontSize;
+ TUpDown *UpDown1;
+ TPanel *Ruler;
+ TLabel *FirstInd;
+ TLabel *LeftInd;
+ TBevel *RulerLine;
+ TLabel *RightInd;
+ TStatusBar *StatusBar;
+ TRichEdit *RichEdit1;
+ TLabel *Label1;
+ void __fastcall SelectionChange(TObject *Sender);
+ void __fastcall AlignClick(TObject *Sender);
+ void __fastcall EditUndoClick(TObject *Sender);
+ void __fastcall EditCutClick(TObject *Sender);
+ void __fastcall EditCopyClick(TObject *Sender);
+ void __fastcall EditPasteClick(TObject *Sender);
+ void __fastcall RulerResize(TObject *Sender);
+ void __fastcall FormCreate(TObject *Sender);
+ void __fastcall FormResize(TObject *Sender);
+ void __fastcall FormPaint(TObject *Sender);
+ void __fastcall BoldButtonClick(TObject *Sender);
+ void __fastcall FontSizeChange(TObject *Sender);
+ void __fastcall UnderlineButtonClick(TObject *Sender);
+ void __fastcall ItalicButtonClick(TObject *Sender);
+ void __fastcall BulletsButtonClick(TObject *Sender);
+ void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
+ void __fastcall RulerItemMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall RulerItemMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
+ void __fastcall FirstIndMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall LeftIndMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall RightIndMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall FormActivate(TObject *Sender);
+
+private:
+ AnsiString FFileName;
+ bool FUpdating;
+ int FDragOfs;
+ bool FDragging;
+ TTextAttributes *__fastcall CurrText(void);
+ void __fastcall CheckFileSave(void);
+ void __fastcall SetupRuler(void);
+ void __fastcall SetEditRect(void);
+ void __fastcall ShowHint(TObject *Sender);
+
+public:
+ SWModule *Module;
+ SWDispRTF *RTFDisplay;
+
+ virtual __fastcall TEditEntry(TComponent *Owner);
+ __fastcall ~TEditEntry();
+ char *ResultBuf;
+ void ExtractRTF();
+};
+//----------------------------------------------------------------------------
+class TCharsetObject : public TObject
+{
+public:
+ int Charset;
+ __fastcall TCharsetObject(int FCharset);
+};
+//----------------------------------------------------------------------------
+extern TEditEntry *EditEntry;
+//----------------------------------------------------------------------------
+#endif
+ \ No newline at end of file
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.dfm b/apps/windoze/CBuilder5/prototype/mainfrm.dfm
new file mode 100644
index 0000000..514d39f
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/mainfrm.dfm
Binary files differ
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/newbmfilefrm.cpp b/apps/windoze/CBuilder5/prototype/newbmfilefrm.cpp
new file mode 100644
index 0000000..c611804
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/newbmfilefrm.cpp
@@ -0,0 +1,14 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "newbmfilefrm.h"
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TNewBMfrm *NewBMfrm;
+//---------------------------------------------------------------------------
+__fastcall TNewBMfrm::TNewBMfrm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//--------------------------------------------------------------------------- \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/newbmfilefrm.dfm b/apps/windoze/CBuilder5/prototype/newbmfilefrm.dfm
new file mode 100644
index 0000000..1e88bcd
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/newbmfilefrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/newbmfilefrm.h b/apps/windoze/CBuilder5/prototype/newbmfilefrm.h
new file mode 100644
index 0000000..9b4c017
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/newbmfilefrm.h
@@ -0,0 +1,27 @@
+//---------------------------------------------------------------------------
+#ifndef newbmfilefrmH
+#define newbmfilefrmH
+//---------------------------------------------------------------------------
+#include <vcl\Classes.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <vcl\Forms.hpp>
+//---------------------------------------------------------------------------
+class TNewBMfrm : public TForm
+{
+__published: // IDE-managed Components
+ TLabel *Label1;
+ TEdit *bmfile;
+ TEdit *bmtitle;
+ TLabel *Label2;
+ TButton *Button1;
+ TButton *Button2;
+private: // User declarations
+public: // User declarations
+ __fastcall TNewBMfrm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern TNewBMfrm *NewBMfrm;
+//---------------------------------------------------------------------------
+#endif
+ \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/optionfrm.cpp b/apps/windoze/CBuilder5/prototype/optionfrm.cpp
new file mode 100644
index 0000000..8af047a
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/optionfrm.cpp
@@ -0,0 +1,20 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "optionfrm.h"
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TOptionsfrm *Optionsfrm;
+//---------------------------------------------------------------------------
+__fastcall TOptionsfrm::TOptionsfrm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TOptionsfrm::ChooseColorbtnClick(TObject *Sender)
+{
+ ColorDialog1->Execute();
+ CurrentVSColor->Brush->Color = ColorDialog1->Color;
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/prototype/optionfrm.dfm b/apps/windoze/CBuilder5/prototype/optionfrm.dfm
new file mode 100644
index 0000000..0b20318
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/optionfrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/optionfrm.h b/apps/windoze/CBuilder5/prototype/optionfrm.h
new file mode 100644
index 0000000..1ea8f08
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/optionfrm.h
@@ -0,0 +1,39 @@
+//---------------------------------------------------------------------------
+#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>
+//---------------------------------------------------------------------------
+class TOptionsfrm : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TGroupBox *GroupBox1;
+ TCheckBox *AutoBMPersonal;
+ TCheckBox *AutoBMOther;
+ TGroupBox *GroupBox2;
+ TCheckBox *AutoVSColor;
+ TShape *CurrentVSColor;
+ TColorDialog *ColorDialog1;
+ TButton *ChooseColorbtn;
+ TPanel *Panel2;
+ TButton *Button1;
+ TPanel *Panel3;
+ TButton *Button2;
+ TLabel *Label1;
+ void __fastcall ChooseColorbtnClick(TObject *Sender);
+
+private: // User declarations
+public: // User declarations
+ __fastcall TOptionsfrm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern TOptionsfrm *Optionsfrm;
+//---------------------------------------------------------------------------
+#endif
+ \ No newline at end of file
diff --git a/apps/windoze/CBuilder5/prototype/options.conf b/apps/windoze/CBuilder5/prototype/options.conf
new file mode 100644
index 0000000..db0e4ce
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/options.conf
@@ -0,0 +1,15 @@
+
+[Appearance]
+AutoVSColor=1
+CurrentVSColorBlue=255
+CurrentVSColorGreen=128
+CurrentVSColorRed=0
+
+[Bookmarks]
+AutoSaveOther=1
+AutoSavePersonal=1
+Directory=
+
+[System]
+MaxFiles=40
+
diff --git a/apps/windoze/CBuilder5/prototype/search.bmp b/apps/windoze/CBuilder5/prototype/search.bmp
new file mode 100644
index 0000000..ee693be
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/search.bmp
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/searchfrm.cpp b/apps/windoze/CBuilder5/prototype/searchfrm.cpp
new file mode 100644
index 0000000..c5b29b2
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/searchfrm.cpp
@@ -0,0 +1,95 @@
+//---------------------------------------------------------------------------
+#include <vcl\vcl.h>
+#pragma hdrstop
+
+#include "searchfrm.h"
+#include <listkey.h>
+#include "mainfrm.h"
+#include <regex.h>
+
+//---------------------------------------------------------------------------
+#pragma resource "*.dfm"
+TForm2 *Form2;
+//---------------------------------------------------------------------------
+__fastcall TForm2::TForm2(TComponent* Owner)
+ : TForm(Owner)
+{
+ pvrtf = new SWDispRTF(this);
+
+ pvrtf->Parent = plPreview;
+ pvrtf->Align = alClient;
+ pvrtf->ScrollBars = ssVertical;
+ pvrtf->ReadOnly = true;
+// pvrtf->PopupMenu = PopupMenu2;
+
+// mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf)));
+// mod->SetKey(DefaultVSKey);
+// return 0;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::Button1Click(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
+
+ Caption = "";
+
+
+ targetpc = Form1->textTabs->pageControl;
+
+ if ((Form1->ActiveControl == Form1->PageControl2) || (IsChild(Form1->PageControl2->Handle, Form1->ActiveControl->Handle)))
+ targetpc = Form1->PageControl2;
+ if ((Form1->ActiveControl == Form1->PageControl3) || (IsChild(Form1->PageControl3->Handle, Form1->ActiveControl->Handle)))
+ targetpc = Form1->PageControl3;
+
+
+ target = Form1->mainmgr->Modules.find(targetpc->ActivePage->Caption.c_str());
+ if (target != Form1->mainmgr->Modules.end()) {
+ Caption = Caption + "Searching [" + (*target).first.c_str() + "]...";
+ ListBox1->Clear();
+ int searchType;
+ switch (searchTypeGroup->ItemIndex) {
+ case 0: searchType = -2; break;
+ case 1: searchType = -1; break;
+ case 2: searchType = 0; break;
+ }
+ int searchOptions = (CheckBox2->Checked) ? 0 : REG_ICASE;
+ ListKey &results = (*target).second->Search(SearchText->Text.c_str(), searchType, searchOptions);
+ while (!results.Error()) {
+ ListBox1->Items->Add((const char *)results);
+ results++;
+ }
+// ListBox1->Items->Pack(); // so Count is set correctly (per helpfile)
+ Caption = "";
+ Caption = Caption + "Results from [" + (*target).first.c_str() + "] (" + ListBox1->Items->Count + ((ListBox1->Items->Count == 1) ? " match)" : " matches)");
+ }
+ else Caption = "Error finding target module";
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::ListBox1DblClick(TObject *Sender)
+{
+ if (targetpc == Form1->PageControl3) {
+ Form1->DictKeyEdit->Text = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str();
+ }
+ else {
+ Form1->DefaultVSKey = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str();
+ Form1->TextKeyChanged();
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::ListBox1Click(TObject *Sender)
+{
+ 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);
+ }
+}
+//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/prototype/searchfrm.dfm b/apps/windoze/CBuilder5/prototype/searchfrm.dfm
new file mode 100644
index 0000000..9c366d8
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/searchfrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/searchfrm.h b/apps/windoze/CBuilder5/prototype/searchfrm.h
new file mode 100644
index 0000000..a50ee44
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/searchfrm.h
@@ -0,0 +1,44 @@
+//---------------------------------------------------------------------------
+#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>
+//---------------------------------------------------------------------------
+class TForm2 : public TForm
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TPanel *Panel2;
+ TListBox *ListBox1;
+ TPanel *Panel3;
+ TMemo *SearchText;
+ TPanel *plPreview;
+ TRadioGroup *searchTypeGroup;
+ TGroupBox *GroupBox1;
+ TCheckBox *CheckBox2;
+ TPanel *Panel4;
+ TButton *Button1;
+ TSplitter *Splitter1;
+ void __fastcall Button1Click(TObject *Sender);
+ void __fastcall ListBox1DblClick(TObject *Sender);
+ void __fastcall ListBox1Click(TObject *Sender);
+private: // User declarations
+ SWDispRTF *pvrtf;
+public: // User declarations
+ ModMap::iterator target;
+ TPageControl *targetpc;
+// AnsiString CapText;
+
+ __fastcall TForm2(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern TForm2 *Form2;
+//---------------------------------------------------------------------------
+#endif
+ \ No newline at end of file
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/sword.res b/apps/windoze/CBuilder5/prototype/sword.res
new file mode 100644
index 0000000..32b522d
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/sword.res
Binary files differ
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/CBuilder5/prototype/versesel.cpp b/apps/windoze/CBuilder5/prototype/versesel.cpp
new file mode 100644
index 0000000..8788580
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/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/prototype/versesel.dfm b/apps/windoze/CBuilder5/prototype/versesel.dfm
new file mode 100644
index 0000000..4502433
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/versesel.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/versesel.h b/apps/windoze/CBuilder5/prototype/versesel.h
new file mode 100644
index 0000000..b4c1981
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/versesel.h
@@ -0,0 +1,27 @@
+//---------------------------------------------------------------------------
+#ifndef verseselH
+#define verseselH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+//---------------------------------------------------------------------------
+class TVerseSelFrm : public TForm
+{
+__published: // IDE-managed Components
+ TEdit *Edit1;
+ TPanel *Panel2;
+ TPanel *Panel1;
+ TButton *Button1;
+ TButton *Button2;
+ void __fastcall Edit1Change(TObject *Sender);
+private: // User declarations
+public: // User declarations
+ __fastcall TVerseSelFrm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TVerseSelFrm *VerseSelFrm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/apps/windoze/CBuilder5/prototype/vrslstfrm.cpp b/apps/windoze/CBuilder5/prototype/vrslstfrm.cpp
new file mode 100644
index 0000000..f20e6a8
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/vrslstfrm.cpp
@@ -0,0 +1,50 @@
+//---------------------------------------------------------------------------
+#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->textTabs->pageControl->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/prototype/vrslstfrm.dfm b/apps/windoze/CBuilder5/prototype/vrslstfrm.dfm
new file mode 100644
index 0000000..2b2af74
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/vrslstfrm.dfm
Binary files differ
diff --git a/apps/windoze/CBuilder5/prototype/vrslstfrm.h b/apps/windoze/CBuilder5/prototype/vrslstfrm.h
new file mode 100644
index 0000000..7af64b9
--- /dev/null
+++ b/apps/windoze/CBuilder5/prototype/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