aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanglassey <danglassey>2002-08-14 10:47:42 +0000
committerdanglassey <danglassey>2002-08-14 10:47:42 +0000
commiteb328cd14563269c4c2df8ba4260b859f800001e (patch)
tree7d778370e8b030b695bd578fc1ccba76d03c056b
parent223bb0b0aa1a50e38f546af5d0e7d38cede5a09f (diff)
downloadsword-sf-cvs-eb328cd14563269c4c2df8ba4260b859f800001e.tar.gz
sync with crosswire 20020814-1047
-rw-r--r--apps/X11/InstallMgr/src/cipherfrm.cpp4
-rw-r--r--apps/X11/cheatah/cheatah.cpp2
-rw-r--r--apps/X11/micros/micros.cpp2
-rw-r--r--apps/X11/wxSword/gui_sword.cpp12
-rw-r--r--apps/console/diatheke/corediatheke.cpp2
-rw-r--r--apps/windoze/CBuilder1/mainform.cpp2
-rw-r--r--apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp2
-rw-r--r--apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm4
-rw-r--r--apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp42
-rw-r--r--apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm3
-rw-r--r--apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h12
-rw-r--r--apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp8
-rw-r--r--apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp5
-rw-r--r--apps/windoze/CBuilder5/BibleCS/mainfrm.cpp85
-rw-r--r--apps/windoze/CBuilder5/BibleCS/searchfrm.cpp6
-rw-r--r--apps/windoze/CBuilder5/BibleCS/sword.bpr22
-rw-r--r--apps/windoze/CBuilder5/BibleCS/sword.resbin1980 -> 1980 bytes
-rw-r--r--apps/windoze/CBuilder5/BibleCS/swordlib.bpr16
-rw-r--r--apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp4
-rw-r--r--apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp4
-rw-r--r--apps/windoze/CBuilder5/prototype/mainfrm.cpp8
-rw-r--r--bindings/flatapi.cpp4
-rw-r--r--bindings/gsoap/gsoapsword.cpp8
-rw-r--r--examples/X11/gtk--/simplefrontend/simplefrontend.cpp2
-rw-r--r--examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp2
-rw-r--r--examples/classes/ciphercng.cpp2
-rw-r--r--examples/cmdline/lookup.cpp2
-rw-r--r--examples/cmdline/search.cpp2
-rw-r--r--examples/windoze/bcowl25/multimod/swrtdlgc.cpp8
-rw-r--r--include/swkey.h8
-rw-r--r--include/swmodule.h50
-rw-r--r--src/keys/swkey.cpp4
-rw-r--r--src/modules/common/zverse.cpp3
-rw-r--r--src/modules/swmodule.cpp53
-rw-r--r--src/modules/texts/rawtext/rawtext.cpp4
-rw-r--r--testlib.cpp4
-rw-r--r--tests/indextest.cpp2
-rw-r--r--tests/introtest.cpp4
-rw-r--r--tests/lextest.cpp8
-rw-r--r--tests/mgrtest.cpp2
-rw-r--r--utilities/addcomment.cpp2
-rw-r--r--utilities/addgb.cpp4
-rw-r--r--utilities/addld.cpp18
-rw-r--r--utilities/addvs.cpp6
-rw-r--r--utilities/imp2ld.cpp12
-rw-r--r--utilities/imp2vs.cpp4
-rw-r--r--utilities/mod2zmod.cpp2
-rw-r--r--utilities/modwrite.cpp2
-rw-r--r--utilities/vpl2mod.cpp2
49 files changed, 250 insertions, 219 deletions
diff --git a/apps/X11/InstallMgr/src/cipherfrm.cpp b/apps/X11/InstallMgr/src/cipherfrm.cpp
index 5b77797..1e6dd90 100644
--- a/apps/X11/InstallMgr/src/cipherfrm.cpp
+++ b/apps/X11/InstallMgr/src/cipherfrm.cpp
@@ -32,9 +32,9 @@ void __fastcall TCipherForm::Button2Click(TObject *Sender)
modconf = 0;
SWMgr *mgr = new SWMgr();
SWModule *mod = mgr->Modules[modName];
- mod->SetKey("Ipet 2:12");
+ mod->setKey("Ipet 2:12");
tmpBuf = mod->StripText();
- mod->SetKey("gen 1:10");
+ mod->setKey("gen 1:10");
tmpBuf += "\r\n\r\n";
tmpBuf += mod->StripText();
Memo1->Text = tmpBuf.c_str();
diff --git a/apps/X11/cheatah/cheatah.cpp b/apps/X11/cheatah/cheatah.cpp
index 0cb5778..38554f3 100644
--- a/apps/X11/cheatah/cheatah.cpp
+++ b/apps/X11/cheatah/cheatah.cpp
@@ -515,7 +515,7 @@ void MainWindow::lookupTextChanged() {
keyText = entryText;
if (curMod) {
- curMod->SetKey(keyText.c_str());
+ curMod->setKey(keyText.c_str());
curMod->Display();
sprintf(tmpBuf, "%s (%s)", curMod->KeyText(), curMod->Name());
gtk_label_set(GTK_LABEL(statusbar1), tmpBuf);
diff --git a/apps/X11/micros/micros.cpp b/apps/X11/micros/micros.cpp
index 0321b92..f5af756 100644
--- a/apps/X11/micros/micros.cpp
+++ b/apps/X11/micros/micros.cpp
@@ -542,7 +542,7 @@ void MainWindow::lookupTextChanged() {
keyText += entryText;
if (curMod) {
- curMod->SetKey(keyText.c_str());
+ curMod->setKey(keyText.c_str());
curMod->Display();
sprintf(tmpBuf, "%s (%s)", curMod->KeyText(), curMod->Name());
gtk_label_set(GTK_LABEL(statusbar1), tmpBuf);
diff --git a/apps/X11/wxSword/gui_sword.cpp b/apps/X11/wxSword/gui_sword.cpp
index 33d50ca..1a64105 100644
--- a/apps/X11/wxSword/gui_sword.cpp
+++ b/apps/X11/wxSword/gui_sword.cpp
@@ -196,7 +196,7 @@ public:
iWalk != m_vBookList.end();
iWalk ++ )
{
- (*iWalk) -> SetKey( oKey );
+ (*iWalk) -> setKey( oKey );
}
ttextVec::iterator iText;
@@ -228,7 +228,7 @@ public:
// set this verse
for( iWalk = m_vBookList.begin(); iWalk != m_vBookList.end(); iWalk ++ )
{
- (*iWalk) -> SetKey( oKey );
+ (*iWalk) -> setKey( oKey );
}
ttextVec::iterator iText;
@@ -290,7 +290,7 @@ public:
for( iText = m_vpTextCtrl.begin(); iText != m_vpTextCtrl.end(); iText ++, iBooks ++ ) {
ostrstream oOut;
- (*iBooks)->SetKey( sWord.c_str() );
+ (*iBooks)->setKey( sWord.c_str() );
// Clear Previous Text
(*iText) -> SetValue("");
@@ -299,7 +299,7 @@ public:
// This 'if' checks to make sure we have an entry
// It also forces the module to retrieve its text which forces KeyText to closest
// match. Without it, the call to KeyText would get exactly what we set with
- // SetKey, above.
+ // setKey, above.
if (strlen(* ((*iBooks).ptr())) > 0) {
oOut << "[ " << ((*iBooks).ptr()) -> KeyText() << " ]" << endl;
oOut << * ((*iBooks).ptr()) << endl;
@@ -326,7 +326,7 @@ public:
// Get the search results and start a key here.
SWListKey& oSearchResults = (*iBooks)->Search( sWord );
oSearchResults.Persist( true );
- (*iBooks)->SetKey( oSearchResults );
+ (*iBooks)->setKey( oSearchResults );
// Clear Previous Text
(*iText) -> SetValue("");
@@ -651,7 +651,7 @@ bool MyApp::OnInit(void)
InitToolbar(pFrame->GetToolBar());
// Text Message
- pFrame->SetStatusText("Alpha $Revision: 1.1.1.1 $:Linux Version:Sword Development Team.");
+ pFrame->SetStatusText("Alpha $Revision: 1.2 $:Linux Version:Sword Development Team.");
// Add Panel Info ==============================================
diff --git a/apps/console/diatheke/corediatheke.cpp b/apps/console/diatheke/corediatheke.cpp
index 6d091b8..e87f4da 100644
--- a/apps/console/diatheke/corediatheke.cpp
+++ b/apps/console/diatheke/corediatheke.cpp
@@ -266,7 +266,7 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
else if (querytype == QT_LD) {
//do dictionary stuff
- target->SetKey(ref);
+ target->setKey(ref);
const char * text = (const char *) *target;
diff --git a/apps/windoze/CBuilder1/mainform.cpp b/apps/windoze/CBuilder1/mainform.cpp
index 0118d7b..1216329 100644
--- a/apps/windoze/CBuilder1/mainform.cpp
+++ b/apps/windoze/CBuilder1/mainform.cpp
@@ -14,7 +14,7 @@ __fastcall TForm1::TForm1(TComponent* Owner)
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
- webster->SetKey(Edit1->Text.c_str());
+ webster->setKey(Edit1->Text.c_str());
Memo1->Text = webster->operator char*();
}
diff --git a/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp b/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp
index 0528c7f..77399c4 100644
--- a/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp
+++ b/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp
@@ -24,7 +24,7 @@ void __fastcall TVerseListFrm::ListBox1Click(TObject *Sender) {
target = Form1->mainmgr->Modules.find(Form1->PageControl1->ActivePage->Caption.c_str());
if (target != Form1->mainmgr->Modules.end()) {
SWKey *savekey = *(*target).second;
- (*target).second->SetKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str());
+ (*target).second->setKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str());
pvrtf->Display(*(*target).second);
(*target).second->SetKey(*savekey);
}
diff --git a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm
index 07cecd8..c0b9b7e 100644
--- a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm
+++ b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm
@@ -1,6 +1,6 @@
object AboutBox: TAboutBox
- Left = 291
- Top = 107
+ Left = 283
+ Top = 112
BorderStyle = bsDialog
Caption = 'About The SWORD Project'
ClientHeight = 448
diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp
index d336056..e26f6ff 100644
--- a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp
@@ -3,6 +3,8 @@
#include <vcl.h>
#pragma hdrstop
+#include <swmgr.h>
+#include <listkey.h>
#include "DevOfTheDay.h"
#include "mainfrm.h"
//---------------------------------------------------------------------------
@@ -13,25 +15,41 @@ TDevOfTheDay2 *DevOfTheDay2;
__fastcall TDevOfTheDay2::TDevOfTheDay2(TComponent* Owner)
: TForm(Owner)
{
+ RichTipOld->Visible = false;
+ RichTip = new TRxRichEditX(this);
+ RichTip->Parent = Panel1;
+ RichTip->Align = alClient;
+ RichTip->ScrollBars = ssVertical;
+ RichTip->ReadOnly = true;
}
//---------------------------------------------------------------------------
void __fastcall TDevOfTheDay2::btnOKClick(TObject *Sender)
{
- DevOfTheDay2->Hide();
- ConfigEntMap emap;
- SWConfig * optionsconf;
- optionsconf = dynamic_cast<TForm1*>(Application->MainForm)->optionsconf;
- if(optionsconf)
- {
- emap = optionsconf->Sections["General"];
- emap.erase("TipOfTheDay");
- emap.insert(ConfigEntMap::value_type("TipOfTheDay", (DevOfTheDay2->ckShowTip->Checked) ? "Devotional" : ""));
- optionsconf->Sections["General"] = emap;
- optionsconf->Save();
- }
+ DevOfTheDay2->Hide();
+ if (Form1->optionsconf) {
+ Form1->optionsconf->Sections["General"]["TipOfTheDay"] = (DevOfTheDay2->ckShowTip->Checked) ? "Devotional" : "";
+ Form1->optionsconf->Save();
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TDevOfTheDay2::FormShow(TObject *Sender)
+{
+ ModMap::iterator it;
+ ListKey key;
+ String devoKey = TDateTime::CurrentDate().FormatString("mm.dd");
+ key << devoKey.c_str();
+ string tmpval = Form1->optionsconf->Sections["ModDefaults"]["DailyDevotion"];
+ if ((it = Form1->mainmgr->Modules.find(tmpval)) != Form1->mainmgr->Modules.end()) {
+ RichTip->fillWithVerses(it->second, &key, false, false);
+ }
+ else DevOfTheDay2->RichTip->Text = "A Daily Devotional is not installed or is not configured for use with the \"Devotional of the Day.\n\nTo configure an installed devotional for use with this dialog box open the Preferences dialog box by going to the \"Options\" menu and selecting \"Preferences...\"; then click the \"Special Modules\" tab. Find the \"Default Devotional\" option and select a devotional to use from the list. If nothing shows up in the pull-down list you will need to install a devotional. This can be done by using the Install Manager. Some examples of devotionals are \"Spurgeon's Morning and Evening\" or \"Jonathan Bagster's Daily Light\".\n\nVisit our website at www.crosswire.org for more information.";
+ // If no devotional text is shown then a general how-to is diplayed.
+
+ tmpval = Form1->optionsconf->Sections["General"]["TipOfTheDay"];
+ ckShowTip->Checked = (!stricmp(tmpval.c_str(), "Devotional"));
}
//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm
index 9c3f8b9..ac688d6 100644
--- a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm
+++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm
@@ -18,6 +18,7 @@ object DevOfTheDay2: TDevOfTheDay2
ParentBiDiMode = False
Position = poScreenCenter
Scaled = False
+ OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
@@ -30,7 +31,7 @@ object DevOfTheDay2: TDevOfTheDay2
BevelOuter = bvNone
Caption = 'Panel1'
TabOrder = 0
- object RichTip: TRichEdit
+ object RichTipOld: TRichEdit
Left = 0
Top = 0
Width = 419
diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h
index 267330a..4999813 100644
--- a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h
+++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h
@@ -10,22 +10,26 @@
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
+#include "rxricheditx.h"
+
//---------------------------------------------------------------------------
class TDevOfTheDay2 : public TForm
{
__published: // IDE-managed Components
- TRichEdit *RichTip;
- TPanel *Panel1;
+ TRichEdit *RichTipOld;
+ TPanel *Panel1;
TPanel *Panel3;
TCheckBox *ckShowTip;
TButton *btnOK;
TPanel *Panel4;
TImage *bmpDev;
TLabel *Label1;
- void __fastcall btnOKClick(TObject *Sender);
+ void __fastcall btnOKClick(TObject *Sender);
+ void __fastcall FormShow(TObject *Sender);
private: // User declarations
public: // User declarations
- __fastcall TDevOfTheDay2(TComponent* Owner);
+ TRxRichEditX *RichTip;
+ __fastcall TDevOfTheDay2(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TDevOfTheDay2 *DevOfTheDay2;
diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp b/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp
index 9d6b85f..4c2252f 100644
--- a/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp
@@ -368,16 +368,16 @@ void TPrintForm::PrepareRTF()
lstKey.Persist(1);
if(!radLD->Checked){
lstKey = VerseKey().ParseVerseList(editStart->Text.c_str(),*(Form1->DefaultVSKey), true);
- module->SetKey(&lstKey);
+ module->setKey(&lstKey);
rtfPrint->RenderModule(module, format);
- module->SetKey(Form1->DefaultVSKey);
+ module->setKey(Form1->DefaultVSKey);
}
else{
testKey.setText(WideStringToUTF8(editStart->Text).c_str());
lstKey << testKey;
- module->SetKey(&lstKey);
+ module->setKey(&lstKey);
rtfPrint->RenderModule(module, format);
- module->SetKey(Form1->DefaultStrKey);
+ module->setKey(Form1->DefaultStrKey);
}
}
diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
index 52876ab..58f0e80 100644
--- a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
@@ -445,7 +445,7 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin
SWKey *saveKey = (*module);
if (!saveKey->Persist())
saveKey = 0;
- module->SetKey(verses);
+ module->setKey(verses);
SWKey *lastKey = 0;
bool first = true;
@@ -517,7 +517,8 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin
}
if (saveKey)
- module->SetKey(saveKey);
+ module->setKey(saveKey);
+ else module->setKey(SWKey("")); //remove our persist key
newtext += RTFTrailer;
diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
index 3aee541..5d883ae 100644
--- a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
@@ -217,7 +217,7 @@ char TForm1::CreateTextPane(SWModule *mod, char *font) {
SWDisplay *disp = new RTFDisp(newrtf);
mod->Disp(disp);
displays.insert(displays.begin(), disp);
- mod->SetKey(*DefaultVSKey);
+ mod->setKey(*DefaultVSKey);
return 0;
}
@@ -281,7 +281,7 @@ char TForm1::CreateCommentPane(SWModule *mod, char* font) {
((SWDispRTF *)newrtf)->module = mod;
((SWDispRTF *)newrtf)->recalcAppearance();
- mod->SetKey(*DefaultVSKey);
+ mod->setKey(*DefaultVSKey);
return 0;
}
//---------------------------------------------------------------------------
@@ -307,6 +307,7 @@ char TForm1::CreateLDPane(SWModule *mod, char* font) {
newrtf->module = mod;
newrtf->recalcAppearance();
+/*
if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) {
if ((*sit).second.find("LDBackColor") != (*sit).second.end()) {
lbDictKeys->Color = TColor((atoi((*(*sit).second.find("LDBackColor")).second.c_str())));
@@ -314,9 +315,10 @@ char TForm1::CreateLDPane(SWModule *mod, char* font) {
if ((*sit).second.find("LDFontColor") != (*sit).second.end())
lbDictKeys->Font->Color = TColor((atoi((*(*sit).second.find("LDFontColor")).second.c_str())));
}
+*/
SWDisplay *disp = new RTFDisp(newrtf);
mod->Disp(*displays.insert(displays.begin(), disp));
- mod->SetKey(*DefaultStrKey);
+ mod->setKey(*DefaultStrKey);
return 0;
}
//---------------------------------------------------------------------------
@@ -377,7 +379,7 @@ char TForm1::CreateBookPane(SWModule *mod, char* font) {
-// mod->SetKey(*DefaultVSKey);
+// mod->setKey(*DefaultVSKey);
return 0;
}
//---------------------------------------------------------------------------
@@ -488,6 +490,7 @@ void TForm1::FillDictKeys() {
index = lbDictKeys->Items->Count-1;
}
lbDictKeys->ItemIndex = index;
+ *DefaultStrKey = saveKey;
}
}
}
@@ -918,7 +921,6 @@ void __fastcall TForm1::FormShow(TObject *Sender)
string tmpval;
bool showDevos;
bool showGlos;
- bool showDevOfDay = false;
/*
showLocked = true;
@@ -981,21 +983,6 @@ void __fastcall TForm1::FormShow(TObject *Sender)
mainmgr = new BibleCSMGR(ModInstFrm);
// Load devotion and show form
- String devoKey = TDateTime::CurrentDate().FormatString("mm.dd");
- tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("DailyDevotion")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)"";
- if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) {
- it->second->SetKey(devoKey.c_str());
- DevOfTheDay2->RichTip->Text = it->second->StripText();
- }
- tmpval = ((eit = optionsconf->Sections["General"].find("TipOfTheDay")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"";
- if (!stricmp(tmpval.c_str(), "Devotional")) {
- DevOfTheDay2->ckShowTip->Checked = true;
- showDevOfDay = true;
- }
- // If no devotional text is shown then a general how-to is diplayed.
- if(DevOfTheDay2->RichTip->Text == "")
- DevOfTheDay2->RichTip->Text = "A Daily Devotional is not installed or is not configured for use with the \"Devotional of the Day.\n\nTo configure an installed devotional for use with this dialog box open the Preferences dialog box by going to the \"Options\" menu and selecting \"Preferences...\"; then click the \"Special Modules\" tab. Find the \"Default Devotional\" option and select a devotional to use from the list. If nothing shows up in the pull-down list you will need to install a devotional. This can be done by using the Install Manager. Some examples of devotionals are \"Spurgeon's Morning and Evening\" or \"Jonathan Bagster's Daily Light\".\n\nVisit our website at www.crosswire.org for more information.";
-
for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) {
bool devotional = false;
@@ -1193,14 +1180,27 @@ void __fastcall TForm1::FormShow(TObject *Sender)
}
}
}
- if (this->Tag) {
+ if (this->Tag) {
NavigateVerseURL((char*)(this->Tag));
- }
+ }
else if ((eit = (*sit).second.find("LastVerse")) != (*sit).second.end()) {
freeHandLookup->Text = (*eit).second.c_str();
char ret = '\r';
freeHandLookupoldKeyPress(0, ret);
}
+
+ if ((eit = (*sit).second.find("LastLDModule")) != (*sit).second.end()) {
+ for (int i = 0; i < LexDictPageControl->PageCount; i++) {
+ if (!strcmp(LexDictPageControl->Pages[i]->Caption.c_str(), (*eit).second.c_str())) {
+ LexDictPageControl->ActivePageIndex = i;
+ break;
+ }
+ }
+ }
+ if ((eit = (*sit).second.find("LastLDKey")) != (*sit).second.end()) {
+ DictKeyEdit->Text = UTF8ToWideString((*eit).second.c_str());
+ }
+
}
ConfigEntMap *section;
@@ -1222,15 +1222,17 @@ void __fastcall TForm1::FormShow(TObject *Sender)
}
for (int i = 0; i < pc->PageCount; i++) {
- string heading = pc->Pages[i]->Caption.c_str();
- pc->Pages[i]->TabVisible = !((*section)[heading.c_str()] == "false"); // !false allows default to be true
- }
- }
+ string heading = pc->Pages[i]->Caption.c_str();
+ pc->Pages[i]->TabVisible = !((*section)[heading.c_str()] == "false"); // !false allows default to be true
+ }
+ }
- SplashPg->Hide();
- if(showDevOfDay){
- DevOfTheDay2->Show();
- }
+ SplashPg->Hide();
+
+ tmpval = optionsconf->Sections["General"]["TipOfTheDay"];
+ if(!stricmp(tmpval.c_str(), "Devotional")) {
+ DevOfTheDay2->Show();
+ }
RefreshActiveSheet(LexDictPageControl);
RefreshActiveSheet(CommentaryPageControl);
RefreshActiveSheet(TextPageControl);
@@ -1263,7 +1265,7 @@ void __fastcall TForm1::LookupPokeData(TObject *Sender)
token = strtok(buf, " ");
if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) {
token = strtok(NULL, "");
- (*it).second->SetKey(token);
+ (*it).second->setKey(token);
Lookup->Text = (const char *)(*(*it).second);
}
else Lookup->Text = "";
@@ -1325,7 +1327,7 @@ void TForm1::RestoreState(ModState *state)
if (it != mainmgr->Modules.end()) {
SWModule *module = it->second;
if (!strcmp(module->Type(0), "Generic Books")) {
- module->SetKey(state->key);
+ module->setKey(state->key);
}
else {
*DefaultVSKey = state->key;
@@ -2135,14 +2137,11 @@ void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
for (int loop = 0; ((loop < saveCount) && (loop < freeHandLookup->Items->Count)); loop++)
section.insert(ConfigEntMap::value_type("LookupText", freeHandLookup->Items->Strings[loop].c_str()));
- section.erase("LastVerse");
- section.insert(ConfigEntMap::value_type("LastVerse", (const char *)*DefaultVSKey));
-
- section.erase("LastTextModule");
- section.insert(ConfigEntMap::value_type("LastTextModule", TextPageControl->ActivePage->Caption.c_str()));
-
- section.erase("LastComModule");
- section.insert(ConfigEntMap::value_type("LastComModule", CommentaryPageControl->ActivePage->Caption.c_str()));
+ section["LastVerse"] = (const char *)*DefaultVSKey;
+ section["LastLDKey"] = WideStringToUTF8(DictKeyEdit->Text).c_str();
+ section["LastTextModule"] = TextPageControl->ActivePage->Caption.c_str();
+ section["LastComModule"] = CommentaryPageControl->ActivePage->Caption.c_str();
+ section["LastLDModule"] = LexDictPageControl->ActivePage->Caption.c_str();
layoutconf->Sections["History"] = section;
layoutconf->Save();
@@ -2205,7 +2204,7 @@ void __fastcall TForm1::HideShowModules1Click(TObject *Sender)
//---------------------------------------------------------------------------
void __fastcall TForm1::DevotionaloftheDay1Click(TObject *Sender) {
- DevOfTheDay2->Show();
+ DevOfTheDay2->Show();
}
//---------------------------------------------------------------------------
@@ -2494,9 +2493,9 @@ void __fastcall TForm1::ApplicationEvents1ShowHint(AnsiString &HintStr,
HintStr = "";
break;
}
- defMod->SetKey(WideStringToUTF8(targetWord).c_str());
+ defMod->setKey(WideStringToUTF8(targetWord).c_str());
HintStr = defMod->RenderText();
- defMod->SetKey(DefaultStrKey);
+ defMod->setKey(DefaultStrKey);
// Color attributes for the strongs portion of the hint are here.
// If the module uses it's own font load that else we will try the config file else we will use the default
diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
index f661f7f..a0591d4 100644
--- a/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp
@@ -36,7 +36,7 @@ __fastcall TsearchForm::TsearchForm(TComponent* Owner)
// }
// mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf)));
-// mod->SetKey(DefaultVSKey);
+// mod->setKey(DefaultVSKey);
// return 0;
target = 0;
}
@@ -177,14 +177,14 @@ void __fastcall TsearchForm::TSearchThread::FillListBox(void)
SWKey *savekey = (SWKey *)*(parent->target);
for (results = TOP; !results.Error(); results++) {
- parent->target->SetKey(results);
+ parent->target->setKey(results);
pItem = parent->resultsLV->Items->Add();
pItem->Caption = (const char *)results;
pItem->SubItems->Add("");
// pItem->SubItems->Add((*parent->target).second->StripText());
// pItem = resultsLV->Items->Add(
}
- parent->target->SetKey(*savekey);
+ parent->target->setKey(*savekey);
// ListBox1->Items->Pack(); // so Count is set correctly (per helpfile)
parent->Caption = ((AnsiString)parent->resultsLV->Items->Count + (AnsiString)" " + (AnsiString)((parent->resultsLV->Items->Count == 1) ? _tr("match") : _tr("matches"))) + (AnsiString)" from [ " + (AnsiString)parent->target->Description() + (AnsiString)" (" + (AnsiString)parent->target->Name() + (AnsiString)") ]";
parent->searchBtn->Caption = _tr("Search");
diff --git a/apps/windoze/CBuilder5/BibleCS/sword.bpr b/apps/windoze/CBuilder5/BibleCS/sword.bpr
index 8d99df8..25df0e5 100644
--- a/apps/windoze/CBuilder5/BibleCS/sword.bpr
+++ b/apps/windoze/CBuilder5/BibleCS/sword.bpr
@@ -43,7 +43,7 @@
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
- <USERDEFINES value="_ICU_;_ICUSWORD_"/>
+ <USERDEFINES value="_ICU_;_ICUSWORD_;_DEBUG"/>
<SYSDEFINES value="NO_STRICT"/>
<MAINSOURCE value="sword.cpp"/>
<INCLUDEPATH value="TntUnicodeControls;..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib"/>
@@ -55,16 +55,16 @@
<IDLCFLAGS value="-I..\.. -I..\..\..\..\..\icu-sword\source\common
-I..\..\..\..\..\icu-sword\source\i18n -I..\..\..\..\include
-I$(BCB)\include -I$(BCB)\include\vcl -Irxlib -src_suffix cpp -D_ICU_"/>
- <CFLAG1 value="-O2 -Vx -Ve -RT- -X- -a8 -4 -b- -k- -vi -c -tW -tWM"/>
- <PFLAGS value="-N2obj -N0obj -$Y- -$L- -$D- -v -M -JPHNE"/>
+ <CFLAG1 value="-vGc -vGt -vGd -Od -Vx -Ve -RT- -X- -r- -a8 -4 -b- -k -y -v -vi- -c -tW -tWM"/>
+ <PFLAGS value="-N2obj -N0obj -$Y+ -$W -$O- -v -M -JPHNE"/>
<RFLAGS value=""/>
- <AFLAGS value="/mx /w2 /zn"/>
- <LFLAGS value="-Iobj -D&quot;&quot; -aa -Tpe -GD -s -Gn"/>
+ <AFLAGS value="/mx /w2 /zi"/>
+ <LFLAGS value="-Iobj -D&quot;&quot; -aa -Tpe -GD -s -Gn -v"/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0w32.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
- <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
+ <ALLLIB value="cg32.lib $(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
</LINKER>
<IDEOPTIONS>
[Version Info]
@@ -73,7 +73,7 @@ AutoIncBuild=1
MajorVer=1
MinorVer=5
Release=3
-Build=103
+Build=104
Debug=0
PreRelease=0
Special=0
@@ -85,7 +85,7 @@ CodePage=1252
[Version Info Keys]
CompanyName=CrossWire Software &amp; Bible Society
FileDescription=Windows 32bit User Interface to The SWORD Project
-FileVersion=1.5.3.103
+FileVersion=1.5.3.104
InternalName=biblecs
LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License
LegalTrademarks=
@@ -125,8 +125,8 @@ Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=5
-Item0=_ICU_;_ICUSWORD_
-Item1=_ICU_;_ICUSWORD_;_DEBUG
+Item0=_ICU_;_ICUSWORD_;_DEBUG
+Item1=_ICU_;_ICUSWORD_
Item2=_ICU_
Item3=_ICU_;_DEBUG
Item4=_DEBUG
@@ -156,7 +156,7 @@ RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
-LinkCGLIB=0
+LinkCGLIB=1
[Language]
ActiveLang=
diff --git a/apps/windoze/CBuilder5/BibleCS/sword.res b/apps/windoze/CBuilder5/BibleCS/sword.res
index 8aa7e8d..b748394 100644
--- a/apps/windoze/CBuilder5/BibleCS/sword.res
+++ b/apps/windoze/CBuilder5/BibleCS/sword.res
Binary files differ
diff --git a/apps/windoze/CBuilder5/BibleCS/swordlib.bpr b/apps/windoze/CBuilder5/BibleCS/swordlib.bpr
index 52ae339..7fd20ec 100644
--- a/apps/windoze/CBuilder5/BibleCS/swordlib.bpr
+++ b/apps/windoze/CBuilder5/BibleCS/swordlib.bpr
@@ -78,7 +78,7 @@
<DEBUGLIBPATH value=""/>
<RELEASELIBPATH value=""/>
<LINKER value="TLib"/>
- <USERDEFINES value="_ICU_;_ICUSWORD_"/>
+ <USERDEFINES value="_ICU_;_ICUSWORD_;_DEBUG"/>
<SYSDEFINES value="NO_STRICT;_NO_VCL"/>
<MAINSOURCE value="swordlib.cpp"/>
<INCLUDEPATH value="..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl"/>
@@ -107,11 +107,11 @@
-I..\..\..\..\src\modules\comments\rawcom -I..\..\..\..\src\mgr
-I..\..\..\..\src\keys -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix
cpp -D_ICU_ -D_DEBUG"/>
- <CFLAG1 value="-O2 -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -RT- -X- -a8
- -4 -b- -k- -vi -c -g0 -tWM"/>
- <PFLAGS value="-N2..\..\..\..\obj -N0..\..\..\..\obj -$Y- -$L- -$D- -v -M -JPHNE"/>
+ <CFLAG1 value="-vGc -vGt -vGd -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="-N2..\..\..\..\obj -N0..\..\..\..\obj -$Y+ -$W -$O- -v -M -JPHNE"/>
<RFLAGS value=""/>
- <AFLAGS value="/mx /w2 /zn"/>
+ <AFLAGS value="/mx /w2 /zi"/>
<LFLAGS value="/P512"/>
</OPTIONS>
<LINKER>
@@ -159,8 +159,8 @@ Item5=..\..\..\..\src\modules\lexdict\zld;..\..;..\..\..\..\src\utilfuns\zlib;..
[HistoryLists\hlConditionals]
Count=5
-Item0=_ICU_;_ICUSWORD_
-Item1=_ICU_;_ICUSWORD_;_DEBUG
+Item0=_ICU_;_ICUSWORD_;_DEBUG
+Item1=_ICU_;_ICUSWORD_
Item2=_ICU_
Item3=_ICU_;_DEBUG
Item4=_DEBUG
@@ -193,7 +193,7 @@ RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
-LinkCGLIB=0
+LinkCGLIB=1
[Language]
ActiveLang=
diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp
index ac0f3b9..48d0aa0 100644
--- a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp
@@ -24,9 +24,9 @@ void __fastcall TVerseListFrm::ListBox1Click(TObject *Sender) {
target = Form1->mainmgr->Modules.find(Form1->TextPageControl->ActivePage->Caption.c_str());
if (target != Form1->mainmgr->Modules.end()) {
SWKey *savekey = *(*target).second;
- (*target).second->SetKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str());
+ target->second->setKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str());
pvrtf->Display(*(*target).second);
- (*target).second->SetKey(*savekey);
+ (*target).second->setKey(*savekey);
}
}
//---------------------------------------------------------------------------
diff --git a/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp b/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp
index 5b77797..1e6dd90 100644
--- a/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp
+++ b/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp
@@ -32,9 +32,9 @@ void __fastcall TCipherForm::Button2Click(TObject *Sender)
modconf = 0;
SWMgr *mgr = new SWMgr();
SWModule *mod = mgr->Modules[modName];
- mod->SetKey("Ipet 2:12");
+ mod->setKey("Ipet 2:12");
tmpBuf = mod->StripText();
- mod->SetKey("gen 1:10");
+ mod->setKey("gen 1:10");
tmpBuf += "\r\n\r\n";
tmpBuf += mod->StripText();
Memo1->Text = tmpBuf.c_str();
diff --git a/apps/windoze/CBuilder5/prototype/mainfrm.cpp b/apps/windoze/CBuilder5/prototype/mainfrm.cpp
index cfe753e..05674cf 100644
--- a/apps/windoze/CBuilder5/prototype/mainfrm.cpp
+++ b/apps/windoze/CBuilder5/prototype/mainfrm.cpp
@@ -112,7 +112,7 @@ char TForm1::CreateTextPane(SWModule *mod, char *font) {
}
mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf)));
- mod->SetKey(DefaultVSKey);
+ mod->setKey(DefaultVSKey);
*/
return 0;
}
@@ -157,7 +157,7 @@ char TForm1::CreateCommentPane(SWModule *mod) {
newrtf->Parent = newtab;
newrtf->Align = alClient;
- mod->SetKey(DefaultVSKey);
+ mod->setKey(DefaultVSKey);
return 0;
}
//---------------------------------------------------------------------------
@@ -176,7 +176,7 @@ char TForm1::CreateLDPane(SWModule *mod) {
newrtf->OnMouseDown = RTFMouseDown;
mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf)));
- mod->SetKey(DefaultStrKey);
+ mod->setKey(DefaultStrKey);
return 0;
}
//---------------------------------------------------------------------------
@@ -398,7 +398,7 @@ void __fastcall TForm1::LookupPokeData(TObject *Sender)
token = strtok(buf, " ");
if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) {
token = strtok(NULL, "");
- (*it).second->SetKey(token);
+ it->second->setKey(token);
Lookup->Text = (const char *)(*(*it).second);
}
else Lookup->Text = "";
diff --git a/bindings/flatapi.cpp b/bindings/flatapi.cpp
index 9208c13..7728b86 100644
--- a/bindings/flatapi.cpp
+++ b/bindings/flatapi.cpp
@@ -159,10 +159,10 @@ int SWModule_getEntrySize(SWHANDLE hmodule) {
void SWModule_setKeyText(SWHANDLE hmodule, const char *key) {
SWModule *module = (SWModule *)hmodule;
if (module)
- module->Key(key);
+ module->setKey(key);
}
-// virtual char SetKey (const SWKey &ikey);
+// virtual char setKey (const SWKey &ikey);
// virtual SWKey & Key () const {
const char *SWModule_getKeyText(SWHANDLE hmodule) {
diff --git a/bindings/gsoap/gsoapsword.cpp b/bindings/gsoap/gsoapsword.cpp
index 57eff23..cb3a58d 100644
--- a/bindings/gsoap/gsoapsword.cpp
+++ b/bindings/gsoap/gsoapsword.cpp
@@ -52,7 +52,7 @@ int sword__SWModule_getDescription(xsd__int hmodule, xsd__string &description) {
int sword__Quick_getModuleRawEntry(xsd__string modName, xsd__string modKey, xsd__string &modText) {
SWModule *mod = mgr->Modules[modName];
if (mod) {
- mod->SetKey(modKey);
+ mod->setKey(modKey);
modText = mod->getRawEntry();
}
return SOAP_OK;
@@ -62,7 +62,7 @@ int sword__Quick_getModuleRawEntry(xsd__string modName, xsd__string modKey, xsd_
int sword__Quick_setModuleRawEntry(xsd__string modName, xsd__string modKey, xsd__string modText, xsd__int &noop) {
SWModule *mod = mgr->Modules[modName];
if (mod) {
- mod->SetKey(modKey);
+ mod->setKey(modKey);
(*mod) << modText;
}
return SOAP_OK;
@@ -72,7 +72,7 @@ int sword__Quick_setModuleRawEntry(xsd__string modName, xsd__string modKey, xsd_
int sword__Quick_getModuleRenderText(xsd__string modName, xsd__string modKey, xsd__string &modText) {
SWModule *mod = mgr->Modules[modName];
if (mod) {
- mod->SetKey(modKey);
+ mod->setKey(modKey);
modText = (char *)mod->RenderText();
}
return SOAP_OK;
@@ -82,7 +82,7 @@ int sword__Quick_getModuleRenderText(xsd__string modName, xsd__string modKey, xs
int sword__Quick_getJScriptAttribArray(xsd__string modName, xsd__string modKey, xsd__string &arrayText) {
SWModule *mod = mgr->Modules[modName];
if (mod) {
- mod->SetKey(modKey);
+ mod->setKey(modKey);
AttributeTypeList::iterator i1;
AttributeList::iterator i2;
AttributeValue::iterator i3;
diff --git a/examples/X11/gtk--/simplefrontend/simplefrontend.cpp b/examples/X11/gtk--/simplefrontend/simplefrontend.cpp
index ed5192a..b43e17e 100644
--- a/examples/X11/gtk--/simplefrontend/simplefrontend.cpp
+++ b/examples/X11/gtk--/simplefrontend/simplefrontend.cpp
@@ -61,7 +61,7 @@ public:
it = manager.Modules.find(modName.c_str());
if (it != manager.Modules.end()) {
- it->second->SetKey(keyText.c_str());
+ it->second->setKey(keyText.c_str());
text->delete_text(0, text->get_length());
text->insert_text((const char *)*it->second, strlen(*it->second), &position);
l3.set(it->second->KeyText());
diff --git a/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp b/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp
index 3ddc77d..691a026 100644
--- a/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp
+++ b/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp
@@ -66,7 +66,7 @@ SimpleFrontEndProject::lookup(const char *)
it = manager.Modules.find(modName.c_str());
if (it != manager.Modules.end()) {
- it->second->SetKey(keyText.c_str());
+ it->second->setKey(keyText.c_str());
mlined1->setText(*it->second);
label3->setText(it->second->KeyText());
}
diff --git a/examples/classes/ciphercng.cpp b/examples/classes/ciphercng.cpp
index 9e6e461..591cd2d 100644
--- a/examples/classes/ciphercng.cpp
+++ b/examples/classes/ciphercng.cpp
@@ -30,7 +30,7 @@ int main(int argc, char **argv) {
cout << "\nPress [CTRL-C] to end\n\n";
while (true) {
cout << "\nModule text:\n";
- module->SetKey("1jn 1:9");
+ module->setKey("1jn 1:9");
cout << "[ " << module->KeyText() << " ]\n";
cout << (const char *)*module;
cout << "\n\nEnter new cipher key: ";
diff --git a/examples/cmdline/lookup.cpp b/examples/cmdline/lookup.cpp
index 6f67ed7..0bccc09 100644
--- a/examples/cmdline/lookup.cpp
+++ b/examples/cmdline/lookup.cpp
@@ -25,7 +25,7 @@ int main(int argc, char **argv)
target = (*it).second;
- target->SetKey(argv[2]);
+ target->setKey(argv[2]);
(const char *)*target; // force an entry lookup to resolve key so we
// get the idxbuf entry for the key
diff --git a/examples/cmdline/search.cpp b/examples/cmdline/search.cpp
index ec55b14..9e1c896 100644
--- a/examples/cmdline/search.cpp
+++ b/examples/cmdline/search.cpp
@@ -48,7 +48,7 @@ int main(int argc, char **argv)
vk.LowerBound(argv[3]);
vk.UpperBound(argv[4]);
vk.Persist(1);
- target->SetKey(vk);
+ target->setKey(vk);
}
std::cout << "[0=================================50===============================100]\n ";
diff --git a/examples/windoze/bcowl25/multimod/swrtdlgc.cpp b/examples/windoze/bcowl25/multimod/swrtdlgc.cpp
index 44e93ca..e3c6051 100644
--- a/examples/windoze/bcowl25/multimod/swrtdlgc.cpp
+++ b/examples/windoze/bcowl25/multimod/swrtdlgc.cpp
@@ -74,11 +74,11 @@ END_RESPONSE_TABLE;
void SWLookup(char *modname, SWKey &key)
{
if (!stricmp(modname, eastons->Name())) {
- eastons->SetKey(key);
+ eastons->setKey(key);
eastons->Display();
}
if (!stricmp(modname, vines->Name())) {
- vines->SetKey(key);
+ vines->setKey(key);
vines->Display();
}
}
@@ -141,8 +141,8 @@ void swordTDLGClient::SetupWindow ()
vines = new RawLD ("../../../../modules/lexdict/rawld/vines/vines", "Vines", "Vine's Bible Dictionary", edit3disp);
masterkey->Persist(1);
- webster->SetKey(*masterkey);
- mhc->SetKey(*masterkey);
+ webster->setKey(*masterkey);
+ mhc->setKey(*masterkey);
for (loop1 = 0; loop1 < 2; loop1++) {
for (loop2 = 0; loop2 < VerseKey::BMAX[loop1]; loop2++) {
diff --git a/include/swkey.h b/include/swkey.h
index ce088d4..f9569b5 100644
--- a/include/swkey.h
+++ b/include/swkey.h
@@ -3,7 +3,7 @@
* types of keys for indexing into modules (e.g. verse, word,
* place, etc.)
*
- * $Id: swkey.h,v 1.18 2002/07/28 01:48:38 scribe Exp $
+ * $Id: swkey.h,v 1.19 2002/08/14 09:23:17 scribe Exp $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -103,7 +103,7 @@ public:
virtual SWKey *clone() const;
/** Gets whether this object itself persists within a
- * module that it was used to SetKey or just a copy.
+ * module that it was used to setKey or just a copy.
* (1 - persists in module; 0 - a copy is attempted
*
* @return value of persist
@@ -111,7 +111,7 @@ public:
char Persist() const;
/** Set/gets whether this object itself persists within a
- * module that it was used to SetKey or just a copy.
+ * module that it was used to setKey or just a copy.
* (1 - persists in module; 0 - a copy is attempted
*
* @param ipersist value which to set persist;
@@ -191,7 +191,7 @@ public:
* srand( time(0) );
* const double newIndex = (double(rand())/RAND_MAX)*(24108+8224);
* vk.Index(newIndex);
- * module->SetKey(vk);
+ * module->setKey(vk);
*
* char* text;
* sprintf(text, "%s: %s",(const char*)vk ,module->StripText(&vk));
diff --git a/include/swmodule.h b/include/swmodule.h
index 1dc1307..1d92375 100644
--- a/include/swmodule.h
+++ b/include/swmodule.h
@@ -3,7 +3,7 @@
* types of modules (e.g. texts, commentaries, maps, lexicons,
* etc.)
*
-* $Id: swmodule.h,v 1.49 2002/07/30 10:17:30 scribe Exp $
+* $Id: swmodule.h,v 1.50 2002/08/14 09:23:17 scribe Exp $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -40,8 +40,8 @@ using namespace std;
#define SWMODULE_OPERATORS \
operator const char *() { return RenderText(); } \
- operator SWKey &() { return *key; } \
- operator SWKey *() { return key; } \
+ operator SWKey &() { return *getKey(); } \
+ operator SWKey *() { return getKey(); } \
SWModule &operator <<(const char *inbuf) { setEntry(inbuf); return *this; } \
SWModule &operator <<(const SWKey *sourceKey) { linkEntry(sourceKey); return *this; } \
SWModule &operator -=(int steps) { decrement(steps); return *this; } \
@@ -178,37 +178,55 @@ protected:
*
* @param ikey key with which to set this module
* @return error status
+ * @deprecated See setKey()
*/
- virtual char SetKey(const SWKey *ikey);
+ char SetKey(const SWKey *ikey) { return setKey(ikey); }
+ virtual char setKey(const SWKey *ikey);
+
/**
- * Sets the key of this module. Similair to @see SetKey(const SWKey*) .
+ * Sets the key of this module. Similar to @see SetKey(const SWKey*) .
* @param ikey The SWKey which should be used as new key.
* @return Error status
+ * @deprecated See setKey()
*/
- virtual char SetKey(const SWKey &ikey);
+ char SetKey(const SWKey &ikey) { return setKey(ikey); }
+ char setKey(const SWKey &ikey) { return SetKey(&ikey); }
+
/** Gets the current module key
* @return the current key of this module
+ * @deprecated See getKey()
*/
- virtual SWKey & Key() const { return *key; }
+ SWKey &Key() const { return *getKey(); }
+ SWKey *getKey() const;
+
/** Sets the current key of the module to ikey, and returns
* the keytext
*
* @param ikey new current key for the module
* @return the keytext of the current module key
- */
- virtual char Key(const SWKey & ikey) { return SetKey(ikey); }
- /** Sets/gets module KeyText
- *
- * @param ikeytext value which to set keytext;
- * [0] - only get
- * @return pointer to keytext
- */
- virtual const char *KeyText(const char *imodtype = 0);
+ * @deprecated See setKey()
+ */
+ char Key(const SWKey & ikey) { return setKey(ikey); }
+
+ /******************************************************************************
+ * SWModule::KeyText - Sets/gets module KeyText
+ *
+ * ENT: ikeytext - value which to set keytext
+ * [0] - only get
+ *
+ * RET: pointer to keytext
+ */
+ const char *KeyText(const char *ikeytext = 0) {
+ if (ikeytext) setKey(ikeytext);
+ return *getKey();
+ }
+
/** Calls this modules display object and passes itself
*
* @return error status
*/
virtual char Display();
+
/** Sets/gets display driver
*
* @param idisp value which to set disp;
diff --git a/src/keys/swkey.cpp b/src/keys/swkey.cpp
index e633369..307e848 100644
--- a/src/keys/swkey.cpp
+++ b/src/keys/swkey.cpp
@@ -59,7 +59,7 @@ SWKey::~SWKey() {
/******************************************************************************
* SWKey::Persist - Gets whether this object itself persists within a
- * module that it was used to SetKey or just a copy.
+ * module that it was used to setKey or just a copy.
* (1 - persists in module; 0 - a copy is attempted
*
* RET: value of persist
@@ -73,7 +73,7 @@ char SWKey::Persist() const
/******************************************************************************
* SWKey::Persist - Set/gets whether this object itself persists within a
- * module that it was used to SetKey or just a copy.
+ * module that it was used to setKey or just a copy.
* (1 - persists in module; 0 - a copy is attempted
*
* ENT: ipersist - value which to set persist
diff --git a/src/modules/common/zverse.cpp b/src/modules/common/zverse.cpp
index 6d76ddc..600a317 100644
--- a/src/modules/common/zverse.cpp
+++ b/src/modules/common/zverse.cpp
@@ -262,7 +262,8 @@ void zVerse::zreadtext(char testmt, long start, unsigned short size, char *inbuf
{
memset(inbuf, 0, size);
if (size > 2) {
- strncpy(inbuf, &(cacheBuf[start]), size-2);
+ if (cacheBuf)
+ strncpy(inbuf, &(cacheBuf[start]), size-2);
}
}
diff --git a/src/modules/swmodule.cpp b/src/modules/swmodule.cpp
index f37df27..b0e1002 100644
--- a/src/modules/swmodule.cpp
+++ b/src/modules/swmodule.cpp
@@ -256,20 +256,27 @@ char SWModule::Display()
/******************************************************************************
- * SWModule::SetKey - Sets a key to this module for position to a particular
- * record or set of records
+ * SWModule::getKey - Gets the key from this module that points to the position
+ * record
+ *
+ * RET: key object
+ */
+
+SWKey *SWModule::getKey() const {
+ return key;
+}
+
+
+/******************************************************************************
+ * SWModule::setKey - Sets a key to this module for position to a particular
+ * record
*
* ENT: ikey - key with which to set this module
*
* RET: error status
*/
-char SWModule::SetKey(const SWKey &ikey) {
- return SetKey(&ikey);
-}
-
-char SWModule::SetKey(const SWKey *ikey)
-{
+char SWModule::setKey(const SWKey *ikey) {
SWKey *oldKey = 0;
if (key) {
@@ -291,24 +298,6 @@ char SWModule::SetKey(const SWKey *ikey)
/******************************************************************************
- * SWModule::KeyText - Sets/gets module KeyText
- *
- * ENT: ikeytext - value which to set keytext
- * [0] - only get
- *
- * RET: pointer to keytext
- */
-
-const char *SWModule::KeyText(const char *ikeytext)
-{
- if (ikeytext)
- SetKey(ikeytext);
-
- return *key;
-}
-
-
-/******************************************************************************
* SWModule::setPosition(SW_POSITION) - Positions this modules to an entry
*
* ENT: p - position (e.g. TOP, BOTTOM)
@@ -405,7 +394,7 @@ ListKey &SWModule::Search(const char *istr, int searchType, int flags, SWKey *sc
searchkey = (scope)?scope->clone():(key->Persist())?key->clone():0;
if (searchkey) {
searchkey->Persist(1);
- SetKey(*searchkey);
+ setKey(*searchkey);
}
(*percent)(perc, percentUserData);
@@ -519,7 +508,7 @@ ListKey &SWModule::Search(const char *istr, int searchType, int flags, SWKey *sc
free(wordBuf);
}
- SetKey(*savekey);
+ setKey(*savekey);
if (!savekey->Persist())
delete savekey;
@@ -605,11 +594,11 @@ const char *SWModule::StripText(char *buf, int len)
}
else savekey = key;
- SetKey(*tmpKey);
+ setKey(*tmpKey);
retVal = RenderText();
- SetKey(*savekey);
+ setKey(*savekey);
if (!savekey->Persist())
delete savekey;
@@ -637,11 +626,11 @@ const char *SWModule::StripText(SWKey *tmpKey)
}
else savekey = key;
- SetKey(*tmpKey);
+ setKey(*tmpKey);
retVal = StripText();
- SetKey(*savekey);
+ setKey(*savekey);
if (!savekey->Persist())
delete savekey;
diff --git a/src/modules/texts/rawtext/rawtext.cpp b/src/modules/texts/rawtext/rawtext.cpp
index c2214f8..cfaaa37 100644
--- a/src/modules/texts/rawtext/rawtext.cpp
+++ b/src/modules/texts/rawtext/rawtext.cpp
@@ -142,7 +142,7 @@ signed char RawText::createSearchFramework() {
searchkey = (key->Persist())?key->clone():0;
if (searchkey) {
searchkey->Persist(1);
- SetKey(*searchkey);
+ setKey(*searchkey);
}
// position module at the beginning
@@ -174,7 +174,7 @@ signed char RawText::createSearchFramework() {
}
// reposition module back to where it was before we were called
- SetKey(*savekey);
+ setKey(*savekey);
if (!savekey->Persist())
delete savekey;
diff --git a/testlib.cpp b/testlib.cpp
index c20c8db..2adc9e8 100644
--- a/testlib.cpp
+++ b/testlib.cpp
@@ -31,8 +31,8 @@ int main(int argc, char **argv)
mykey = (argc < 2) ? "James 1:19" : argv[1];
mykey.Persist(1);
- text.SetKey(mykey);
- commentary.SetKey(mykey);
+ text.setKey(mykey);
+ commentary.setKey(mykey);
max = (argc < 3) ? 1 : atoi(argv[2]);
diff --git a/tests/indextest.cpp b/tests/indextest.cpp
index fed477e..457a2e4 100644
--- a/tests/indextest.cpp
+++ b/tests/indextest.cpp
@@ -10,7 +10,7 @@ int main(int argc, char **argv) {
if (bbe) {
VerseKey vk;
vk.Persist(1);
- bbe->SetKey(vk);
+ bbe->setKey(vk);
for (; !bbe->Error(); (*bbe)++ ) {
std::cout << vk.NewIndex() << std::endl;
}
diff --git a/tests/introtest.cpp b/tests/introtest.cpp
index 6f1d9b1..bed10aa 100644
--- a/tests/introtest.cpp
+++ b/tests/introtest.cpp
@@ -13,7 +13,7 @@ int main(int argc, char **argv) {
vk.Headings(1);
vk.AutoNormalize(0);
vk.Persist(1);
- mod.SetKey(vk);
+ mod.setKey(vk);
vk.Verse(0);
vk.Chapter(0);
@@ -96,7 +96,7 @@ int main(int argc, char **argv) {
vk.Persist(1);
vk = "jas 0:0";
std::cout << vk << ":\n";
- mhc->SetKey(vk);
+ mhc->setKey(vk);
std::cout << (const char *) mhc->Key() << ":\n";
std::cout << (const char *) *mhc << "\n";
}
diff --git a/tests/lextest.cpp b/tests/lextest.cpp
index 72beea0..403bbce 100644
--- a/tests/lextest.cpp
+++ b/tests/lextest.cpp
@@ -6,16 +6,16 @@ void main(int argc, char **argv)
RawLD::createModule("tmp/lextest");
RawLD lex("tmp/lextest");
- lex.SetKey("b");
+ lex.setKey("b");
lex << "x";
- lex.SetKey("a");
+ lex.setKey("a");
lex << "x";
- lex.SetKey("a");
+ lex.setKey("a");
lex.deleteEntry();
-// lex.SetKey("a");
+// lex.setKey("a");
// lex << "y";
lex = BOTTOM;
diff --git a/tests/mgrtest.cpp b/tests/mgrtest.cpp
index 1a6c359..6a77328 100644
--- a/tests/mgrtest.cpp
+++ b/tests/mgrtest.cpp
@@ -17,7 +17,7 @@ int main(int argc, char **argv) {
std::cout << "AbsoluteDataPath = " << it->second->getConfigEntry("AbsoluteDataPath") << "\n";
std::cout << "Has Feature HebrewDef = " << it->second->getConfig().has("Feature", "HebrewDef") << "\n";
if ((!strcmp((*it).second->Type(), "Biblical Texts")) || (!strcmp((*it).second->Type(), "Commentaries"))) {
- (*it).second->SetKey("James 1:19");
+ it->second->setKey("James 1:19");
std::cout << (const char *) *(*it).second << "\n\n";
}
}
diff --git a/utilities/addcomment.cpp b/utilities/addcomment.cpp
index e52b87a..11efe8a 100644
--- a/utilities/addcomment.cpp
+++ b/utilities/addcomment.cpp
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
mykey = argv[2];
mykey.Persist(1);
- personal.SetKey(mykey);
+ personal.setKey(mykey);
max = (argc < 4) ? 1 : atoi(argv[3]);
diff --git a/utilities/addgb.cpp b/utilities/addgb.cpp
index 854496a..4926725 100644
--- a/utilities/addgb.cpp
+++ b/utilities/addgb.cpp
@@ -122,7 +122,7 @@ int main(int argc, char **argv) {
// Link 2 verses
else if ((mode == 'l') && argc == 5) {
*key = argv[3];
- mod.SetKey(*key);
+ mod.setKey(*key);
SWKey tmpkey = argv[4];
mod << &(tmpkey);
@@ -130,7 +130,7 @@ int main(int argc, char **argv) {
// Delete an entry
else if ((mode == 'd') && argc == 4) {
- mod.SetKey(argv[3]);
+ mod.setKey(argv[3]);
mod.deleteEntry();
}
*/
diff --git a/utilities/addld.cpp b/utilities/addld.cpp
index a1cc318..272460a 100644
--- a/utilities/addld.cpp
+++ b/utilities/addld.cpp
@@ -58,7 +58,7 @@ int main(int argc, char **argv) {
// Set our VerseKey
*key = argv[3];
- mod.SetKey(*key);
+ mod.setKey(*key);
FILE *infile;
// case: add from text file
//Open our data file and read its contents into the buffer
@@ -77,7 +77,7 @@ int main(int argc, char **argv) {
// Set our VerseKey
*key = argv[3];
- mod.SetKey(*key);
+ mod.setKey(*key);
FILE *infile;
// case: add from text file
//Open our data file and read its contents into the buffer
@@ -96,7 +96,7 @@ int main(int argc, char **argv) {
// Set our VerseKey
*key = argv[3];
- mod.SetKey(*key);
+ mod.setKey(*key);
FILE *infile;
// case: add from text file
//Open our data file and read its contents into the buffer
@@ -118,7 +118,7 @@ int main(int argc, char **argv) {
key->Persist(1); // the magical setting
*key = argv[3];
- mod.SetKey(*key);
+ mod.setKey(*key);
SWKey tmpkey = argv[4];
mod << &(tmpkey);
}
@@ -128,7 +128,7 @@ int main(int argc, char **argv) {
key->Persist(1); // the magical setting
*key = argv[3];
- mod.SetKey(*key);
+ mod.setKey(*key);
SWKey tmpkey = argv[4];
mod << &(tmpkey);
@@ -139,7 +139,7 @@ int main(int argc, char **argv) {
key->Persist(1); // the magical setting
*key = argv[3];
- mod.SetKey(*key);
+ mod.setKey(*key);
SWKey tmpkey = argv[4];
mod << &(tmpkey);
@@ -148,17 +148,17 @@ int main(int argc, char **argv) {
else if ((mode == 'd') && argc == 4) {
if (fourbyte) {
RawLD4 mod(argv[2]); // open our datapath with our RawText driver.
- mod.SetKey(argv[3]);
+ mod.setKey(argv[3]);
mod.deleteEntry();
}
if (compress) {
zLD mod(argv[2]); // open our datapath with our RawText driver.
- mod.SetKey(argv[3]);
+ mod.setKey(argv[3]);
mod.deleteEntry();
}
else {
RawLD mod(argv[2]); // open our datapath with our RawText driver.
- mod.SetKey(argv[3]);
+ mod.setKey(argv[3]);
mod.deleteEntry();
}
diff --git a/utilities/addvs.cpp b/utilities/addvs.cpp
index 33dc28d..1efeede 100644
--- a/utilities/addvs.cpp
+++ b/utilities/addvs.cpp
@@ -39,7 +39,7 @@ int main(int argc, char **argv) {
vkey->Persist(1); // the magical setting
*vkey = argv[3];
// Set our VerseKey
- mod->SetKey(*vkey);
+ mod->setKey(*vkey);
if (!vkey->Chapter()) {
// bad hack >>
// 0:0 is Book intro
@@ -128,7 +128,7 @@ int main(int argc, char **argv) {
// Do some initialization stuff
RawText *mod = new RawText(argv[2]); // open our datapath with our RawText driver.
- mod->SetKey(argv[4]); // set key from argument
+ mod->setKey(argv[4]); // set key from argument
SWKey tmpkey = (SWKey) argv[3];
*(SWModule*)mod << &(tmpkey);
delete mod;
@@ -142,7 +142,7 @@ int main(int argc, char **argv) {
vkey->Persist(1); // the magical setting
// Set our VerseKey
- mod.SetKey(*vkey);
+ mod.setKey(*vkey);
*vkey = argv[3];
if (!vkey->Chapter())
diff --git a/utilities/imp2ld.cpp b/utilities/imp2ld.cpp
index adcea56..a92bbc5 100644
--- a/utilities/imp2ld.cpp
+++ b/utilities/imp2ld.cpp
@@ -105,15 +105,15 @@ int main(int argc, char **argv) {
*key = keybuffer;
if (mode == 3) {
- modZ->SetKey(*key);
+ modZ->setKey(*key);
modZ->setEntry(entbuffer, strlen(entbuffer));
}
else if (mode == 2) {
- mod2->SetKey(*key);
+ mod2->setKey(*key);
mod2->setEntry(entbuffer, strlen(entbuffer));
}
else if (mode == 1) {
- mod4->SetKey(*key);
+ mod4->setKey(*key);
mod4->setEntry(entbuffer, strlen(entbuffer));
}
}
@@ -132,15 +132,15 @@ int main(int argc, char **argv) {
*key = keybuffer;
if (mode == 3) {
- modZ->SetKey(*key);
+ modZ->setKey(*key);
modZ->setEntry(entbuffer, strlen(entbuffer));
}
else if (mode == 2) {
- mod2->SetKey(*key);
+ mod2->setKey(*key);
mod2->setEntry(entbuffer, strlen(entbuffer));
}
else if (mode == 1) {
- mod4->SetKey(*key);
+ mod4->setKey(*key);
mod4->setEntry(entbuffer, strlen(entbuffer));
}
}
diff --git a/utilities/imp2vs.cpp b/utilities/imp2vs.cpp
index 698d0a2..0764ff9 100644
--- a/utilities/imp2vs.cpp
+++ b/utilities/imp2vs.cpp
@@ -70,7 +70,7 @@ int main(int argc, char **argv) {
if (strlen(keybuffer) && strlen(entbuffer)) {
std::cout << keybuffer << std::endl;
*vkey = keybuffer;
- mod->SetKey(*vkey);
+ mod->setKey(*vkey);
if (!vkey->Chapter()) {
// bad hack: 0:0 is Book intro; (chapter):0 is Chapter intro; 0:2 is Module intro; 0:1 is Testament intro
int backstep = vkey->Verse();
@@ -135,7 +135,7 @@ int main(int argc, char **argv) {
if (strlen(keybuffer) && strlen(entbuffer)) {
std::cout << keybuffer << std::endl;
*vkey = keybuffer;
- mod->SetKey(*vkey);
+ mod->setKey(*vkey);
if (!vkey->Chapter()) {
// bad hack: 0:0 is Book intro; (chapter):0 is Chapter intro; 0:2 is Module intro; 0:1 is Testament intro
int backstep = vkey->Verse();
diff --git a/utilities/mod2zmod.cpp b/utilities/mod2zmod.cpp
index bfa7305..e154a58 100644
--- a/utilities/mod2zmod.cpp
+++ b/utilities/mod2zmod.cpp
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
lastBuffer = inModule->getRawEntry();
if (lastBuffer.length() > 0) {
cout << "Adding [" << bufferKey << "] new text. \n";
- outModule->SetKey(bufferKey);
+ outModule->setKey(bufferKey);
(*outModule) << lastBuffer.c_str(); // save new text;
}
else {
diff --git a/utilities/modwrite.cpp b/utilities/modwrite.cpp
index 33bd20c..1caee81 100644
--- a/utilities/modwrite.cpp
+++ b/utilities/modwrite.cpp
@@ -36,7 +36,7 @@ int main(int argc, char **argv)
}
SWModule *module = it->second;
- module->SetKey(argv[2]);
+ module->setKey(argv[2]);
switch (action) {
case 0:
diff --git a/utilities/vpl2mod.cpp b/utilities/vpl2mod.cpp
index cddc923..3760d42 100644
--- a/utilities/vpl2mod.cpp
+++ b/utilities/vpl2mod.cpp
@@ -185,7 +185,7 @@ int main(int argc, char **argv) {
vk.Headings(1); // turn on mod/testmnt/book/chap headings
vk.Persist(1);
- mod.SetKey(vk);
+ mod.setKey(vk);
// Loop through module from TOP to BOTTOM and set next line from
// input file as text for this entry in the module