[sword-svn] r499 - in branches/BCB5: . stage

scribe at crosswire.org scribe at crosswire.org
Tue Apr 21 05:15:33 MST 2009


Author: scribe
Date: 2009-04-21 05:15:33 -0700 (Tue, 21 Apr 2009)
New Revision: 499

Modified:
   branches/BCB5/BibleCS.bpg
   branches/BCB5/PrintFrm.cpp
   branches/BCB5/RxRichEditX.cpp
   branches/BCB5/bookmarkfrm.cpp
   branches/BCB5/mainfrm.cpp
   branches/BCB5/mainfrm.h
   branches/BCB5/stage/layout.conf
   branches/BCB5/swdisprtfchap.cpp
   branches/BCB5/sword.bpr
   branches/BCB5/sword.res
   branches/BCB5/vrslstfrm.cpp
Log:
First pass at removing DefaultVSKey logic.  Kindof works.
Each tab has own location.  Not sync'd.  Gotta fix this.

Modified: branches/BCB5/BibleCS.bpg
===================================================================
--- branches/BCB5/BibleCS.bpg	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/BibleCS.bpg	2009-04-21 12:15:33 UTC (rev 499)
@@ -9,7 +9,7 @@
 DCC = $(ROOT)\bin\dcc32.exe $**
 BRCC = $(ROOT)\bin\brcc32.exe $**
 #------------------------------------------------------------------------------
-PROJECTS = libsword.lib icuuc.lib icuin.lib sword.exe
+PROJECTS = libsword.lib icuuc.lib icuin.lib clucene.lib sword.exe
 #------------------------------------------------------------------------------
 default: $(PROJECTS)
 #------------------------------------------------------------------------------
@@ -30,4 +30,8 @@
   $(ROOT)\bin\bpr2mak $**
   $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
 
+clucene.lib: clucene\clucene.bpr
+  $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $**
+  $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
 
+

Modified: branches/BCB5/PrintFrm.cpp
===================================================================
--- branches/BCB5/PrintFrm.cpp	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/PrintFrm.cpp	2009-04-21 12:15:33 UTC (rev 499)
@@ -52,6 +52,7 @@
 	ConfigEntMap::iterator eit;
 	AnsiString fontName;
 	BibleCSMGR *manager = Form1->mainmgr;
+        VerseKey *vk = Form1->getActiveVerseKey();
 	ModMap::iterator mods;
 	TPageControl* pc;
 
@@ -59,7 +60,7 @@
 		pc = Form1->CommentaryPageControl;
 		radComm->Checked = true;
 		staticRange->Caption = _tr("Verse Range or List");
-		editStart->Text = (keys) ? keys->getRangeText() : Form1->DefaultVSKey->getText();
+		editStart->Text = (keys) ? keys->getRangeText() : (vk) ? vk->getText() : "";
 	}
 	else if ((Form1->ActiveControl == Form1->LexDictPageControl) || (IsChild(Form1->LexDictPageControl->Handle, Form1->ActiveControl->Handle))){
 		pc = Form1->LexDictPageControl;
@@ -71,7 +72,7 @@
 		pc = Form1->TextPageControl;
 		radText->Checked = true;
 		staticRange->Caption = _tr("Verse Range or List");
-		editStart->Text = (keys) ? keys->getRangeText() : Form1->DefaultVSKey->getText();
+		editStart->Text = (keys) ? keys->getRangeText() : (vk) ? vk->getText() : "";
 	}
 
 	FillModuleCombo();
@@ -355,17 +356,20 @@
     AnsiString newtext = "";
     AnsiString moduleName = cmbModule->Text.SubString(2,cmbModule->Text.Pos("]") - 2);
     SWModule *module = manager->Modules[moduleName.c_str()];
-    ListKey lstKey;
     StrKey testKey;
     SavePrintPrefs();
+    ListKey lstKey;
+    lstKey.Persist(1);
 
-    lstKey.Persist(1);
     if(!radLD->Checked){
-		lstKey = VerseKey().ParseVerseList(editStart->Text.c_str(),*(Form1->DefaultVSKey), true);
+    	VerseKey *vk = Form1->getActiveVerseKey();
+        if (vk) {
+		lstKey = vk->ParseVerseList(editStart->Text.c_str(),*vk, true);
 		module->setKey(&lstKey);
 		rtfPrint->type = "PrintedPage";
 		rtfPrint->RenderModule(module);
-		module->setKey(Form1->DefaultVSKey);
+		module->setKey(vk);
+        }
     }
     else{
 		testKey.setText(WideStringToUTF8(editStart->Text).c_str());

Modified: branches/BCB5/RxRichEditX.cpp
===================================================================
--- branches/BCB5/RxRichEditX.cpp	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/RxRichEditX.cpp	2009-04-21 12:15:33 UTC (rev 499)
@@ -708,7 +708,7 @@
 	// build headers with proportional font sizes to single user selected
 	// font size.
 	double fontBase = dispAttribs.fontSize;
-	fontBase /= 4.0;
+	fontBase /= (double)4.0;
 	
 	sprintf(buf,
 			"{\\fs%d \\par }}",

Modified: branches/BCB5/bookmarkfrm.cpp
===================================================================
--- branches/BCB5/bookmarkfrm.cpp	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/bookmarkfrm.cpp	2009-04-21 12:15:33 UTC (rev 499)
@@ -127,8 +127,11 @@
 void __fastcall TbookmarkForm::bmtreeDblClick(TObject *Sender)
 {
 	if (!bmtree->Selected->getFirstChild()) {
-		*(Form1->DefaultVSKey) = bmtree->Selected->Text.c_str();	
-		Form1->TextKeyChanged();
+        	VerseKey *vk = Form1->getActiveVerseKey();
+                if (vk) {
+			*vk = bmtree->Selected->Text.c_str();
+			Form1->TextKeyChanged();
+                }
 	}
 	
 }

Modified: branches/BCB5/mainfrm.cpp
===================================================================
--- branches/BCB5/mainfrm.cpp	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/mainfrm.cpp	2009-04-21 12:15:33 UTC (rev 499)
@@ -50,7 +50,18 @@
 TForm1 *Form1;
 //---------------------------------------------------------------------------
 
+char RTFVerseKeyDisp::Display(SWModule &imodule) {
+	SWKey *k = imodule.getKey();
+	VerseKey *vk = SWDYNAMIC_CAST(VerseKey, k);
+	if (last != vk) {
+               	Form1->fillVKeySelector(vk);
+                last = vk;
+	}
+	return RTFDisp::Display(imodule);
+}
 
+VerseKey *RTFVerseKeyDisp::last = 0;
+
 /*
 inline AnsiString& operator=(AnsiString& dest, const string& src) {
 	dest = src.c_str();
@@ -141,7 +152,6 @@
 	modstates.clear();
 	displays.clear();
 	ctrlstates.clear();
-	DefaultVSKey = 0;
 	DefaultStrKey = 0;
 	clickText = "";
 
@@ -217,10 +227,9 @@
 	newrtf->module = mod;
 	newrtf->recalcAppearance();
 
-	SWDisplay *disp = new RTFDisp(newrtf);
+	SWDisplay *disp = new RTFVerseKeyDisp(newrtf);
 	mod->Disp(disp);
 	displays.insert(displays.begin(), disp);
-	mod->setKey(*DefaultVSKey);
 
 	return 0;
 }
@@ -294,10 +303,10 @@
 		newrtf->Visible = true;
 		mod->Disp(*displays.insert(displays.begin(), disp));
 		((TCppWebBrowser *)newrtf)->OnBeforeNavigate2 = CppWebBrowser1BeforeNavigate2;
-*/		
+*/
 		newrtf = new SWDispRTF(this);
-		
-		SWDisplay *disp = new RTFDisp((SWDispRTF *)newrtf);
+
+		SWDisplay *disp = new RTFVerseKeyDisp((SWDispRTF *)newrtf);
 		mod->Disp(*displays.insert(displays.begin(), disp));
 		((SWDispRTF *)newrtf)->ScrollBars = Stdctrls::ssBoth;
 		((SWDispRTF *)newrtf)->ReadOnly = true;
@@ -310,15 +319,13 @@
 		}
 		else	((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2;
 		((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown;
-		((SWDispRTF *)newrtf)->OnURLClick = RTFURLClick;		
+		((SWDispRTF *)newrtf)->OnURLClick = RTFURLClick;
 		newrtf->Parent = newtab;
 		((SWDispRTF *)newrtf)->module = mod;
 		((SWDispRTF *)newrtf)->recalcAppearance();
 	}
 	newrtf->Align = alClient;
 
-
-	mod->setKey(*DefaultVSKey);
 	return 0;
 }
 //---------------------------------------------------------------------------
@@ -327,7 +334,7 @@
 	SWDispRTF *newrtf = new SWDispRTF(this);
 	SectionMap::iterator sit;
 	char buf[1024];
-	   
+
 	newtab->Caption = mod->Name();
 	newtab->Hint = mod->Description();
 	newtab->ParentShowHint = true;
@@ -353,15 +360,13 @@
 
 
 void __fastcall TForm1::BookTOCChange(TObject* Sender, TTreeNode* Node) {
-	ModMap::iterator it;
-
 	if (mainmgr) {
-		it = mainmgr->Modules.find(CommentaryPageControl->ActivePage->Caption.c_str());
-		if (it != mainmgr->Modules.end()) {
-			((TreeKeyIdx *)(SWKey *)*(it->second))->setOffset((long)Node->Data);
-			(*it).second->Display();
+		SWModule *module = mainmgr->getModule(CommentaryPageControl->ActivePage->Caption.c_str());
+		if (module) {
+			((TreeKeyIdx *)module->getKey())->setOffset((long)Node->Data);
+			module->Display();
 			if (logmodstate)
-				modstates.insert(modstates.begin(), new ModState(CommentaryPageControl, CommentaryPageControl->ActivePage, (*it).second->KeyText()));
+				modstates.insert(modstates.begin(), new ModState(CommentaryPageControl, CommentaryPageControl->ActivePage, module->KeyText()));
 		}
 	}
 }
@@ -403,9 +408,6 @@
 	((SWDispRTF *)newrtf)->module = mod;
 	((SWDispRTF *)newrtf)->recalcAppearance();
 
-
-
-//	mod->setKey(*DefaultVSKey);
 	return 0;
 }
 //---------------------------------------------------------------------------
@@ -418,18 +420,15 @@
 //---------------------------------------------------------------------------
 void TForm1::RefreshActiveSheet(TPageControl *pc)
 {
-	ModMap::iterator it;
-
 	if (mainmgr) {
-		it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
+		SWModule *module = mainmgr->getModule(pc->ActivePage->Caption.c_str());
 		if (pc->ActivePage->Caption == "PARALLEL") {
 			parallelDisp->Display();
 			pc->Hint = "PARALLEL";
 			if (logmodstate)
-				modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, *DefaultVSKey));
+				modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, (module)?module->getKeyText():"John.3.16"));
 		}
-		else if (it != mainmgr->Modules.end()) {
-			SWModule *module = it->second;
+		else if (module) {
 			module->Display();
 			pc->Hint = module->Description();
 			if (logmodstate)
@@ -441,34 +440,82 @@
 }
 
 
-void TForm1::TextKeyChanged()
+SWModule *TForm1::getFocusedModule() {
+	SWModule *module = 0;
+	TPageControl *targetpc = Form1->TextPageControl;
+
+	if ((Form1->ActiveControl == Form1->CommentaryPageControl) || (IsChild(Form1->CommentaryPageControl->Handle, Form1->ActiveControl->Handle)))
+		targetpc = Form1->CommentaryPageControl;
+	if ((Form1->ActiveControl == Form1->LexDictPageControl) || (IsChild(Form1->LexDictPageControl->Handle, Form1->ActiveControl->Handle)))
+		targetpc = Form1->LexDictPageControl;
+
+	if (targetpc->ActivePage->Caption == "PARALLEL") {
+		SWModule *mod = Form1->parallelDisp->getModules()[0];
+		if (mod) {
+			module = mod;
+		}
+	}
+	else {
+		module = mainmgr->getModule(targetpc->ActivePage->Caption.c_str());
+	}
+        return module;
+}
+
+
+VerseKey *TForm1::getActiveVerseKey() {
+	static VerseKey *retVal = 0;
+        SWModule *module = getFocusedModule();
+        SWKey *key = module->getKey();
+        VerseKey *vk = SWDYNAMIC_CAST(VerseKey, key);
+        if (vk) retVal = vk;
+        return retVal;
+}
+
+
+void TForm1::TextKeyChanged(VerseKey *vk)
 {
-	cbBook->ItemIndex = cbBook->Items->IndexOf(UTF8ToWideString(DefaultVSKey->getBookName()));
-	CHBox->Text  = DefaultVSKey->Chapter();
-	VSBox->Text  = DefaultVSKey->Verse();
-	freeHandLookup->Text = UTF8ToWideString((const char *)*DefaultVSKey);
-//	freeHandLookup->Text = (const char *)*DefaultVSKey;
-	RefreshActiveSheet(TextPageControl);
-	logmodstate = false;		// only log state once
-	RefreshActiveSheet(CommentaryPageControl);
-	logmodstate = true;
+	if (!vk) vk = getActiveVerseKey();
+        if (vk) {
+		cbBook->ItemIndex = cbBook->Items->IndexOf(UTF8ToWideString(vk->getBookName()));
+		CHBox->Text  = vk->Chapter();
+		VSBox->Text  = vk->Verse();
+		freeHandLookup->Text = UTF8ToWideString(vk->getText());
+		RefreshActiveSheet(TextPageControl);
+		logmodstate = false;		// only log state once
+		RefreshActiveSheet(CommentaryPageControl);
+		logmodstate = true;
+	}
 }
 
 
 void __fastcall TForm1::btnLookupClick(TObject *Sender)
 {
-	if (!(StrToInt(CHBox->Text)) || (!StrToInt(VSBox->Text)))
-		DefaultVSKey->AutoNormalize(0);
+	VerseKey *vk = getActiveVerseKey();
+        if (vk) {
+		if (!(StrToInt(CHBox->Text)) || (!StrToInt(VSBox->Text)))
+			vk->AutoNormalize(0);
 
-	if (StrToInt(CHBox->Text) < 0)
-		CHBox->Text = StrToInt(CHBox->Text) + 1;
-	if (StrToInt(VSBox->Text) < 0)
-		VSBox->Text = StrToInt(VSBox->Text) + 1;
+		if (StrToInt(CHBox->Text) < 0)
+			CHBox->Text = StrToInt(CHBox->Text) + 1;
+		if (StrToInt(VSBox->Text) < 0)
+			VSBox->Text = StrToInt(VSBox->Text) + 1;
 
-	(*DefaultVSKey) = WideStringToUTF8((cbBook->Text + " " + CHBox->Text + ":" + VSBox->Text)).c_str();
-//	(*DefaultVSKey) = (cbBook->Text + " " + CHBox->Text + ":" + VSBox->Text).c_str();
-	TextKeyChanged();
-	DefaultVSKey->AutoNormalize(1);	
+		(*vk) = WideStringToUTF8((cbBook->Text + " " + CHBox->Text + ":" + VSBox->Text)).c_str();
+
+	        if (vk->getVerse() < 1) {
+	        	vk->setChapter(vk->getChapter()-1);
+	                if (vk->getChapter()) *vk = MAXVERSE;
+	        }
+
+		if (vk->getChapter() < 1) {
+	        	vk->setBook(vk->getBook()-1);
+	                *vk = MAXCHAPTER;
+	                *vk = MAXVERSE;
+	        }
+
+		TextKeyChanged();
+		vk->AutoNormalize(1);
+	}
 }
 //---------------------------------------------------------------------------
 void __fastcall TForm1::CommentaryPageControlChange(TObject *Sender)
@@ -489,16 +536,14 @@
 }
 
 void TForm1::FillDictKeys() {
-	ModMap::iterator it;
 	int index = 0;
 	SWKey saveKey;
 	ConfigEntMap::const_iterator const_eit;
 	SWBuf fontname;
 
 	if (mainmgr) {
-		it = mainmgr->Modules.find(LexDictPageControl->ActivePage->Caption.c_str());
-		if (it != mainmgr->Modules.end()) {
-			SWModule *module = (*it).second;
+		SWModule *module = mainmgr->getModule(LexDictPageControl->ActivePage->Caption.c_str());
+		if (module) {
 			RTFDisp *disp = SWDYNAMIC_CAST(RTFDisp, module->Disp());
 			if (disp) {
 				SWDispRTF *rtfDisp = (SWDispRTF*) disp->editControl();
@@ -650,7 +695,8 @@
 	if ((i >= (lookupKey.Length()-1)) && (i) && (!onlyAlpha)) {
 		lookupKey = TrimJunk(lookupKey);
 		String curLex = LexDictPageControl->ActivePage->Caption;
-		String feature = (DefaultVSKey->Testament() == 1)?"Hebrew":"Greek";
+                VerseKey *vk = getActiveVerseKey();
+		String feature = (vk && (vk->Testament() == 1))?"Hebrew":"Greek";
 		feature += (preChar == '(')?"Parse":"Def";
 		if (!strncmp(rtf->Name.c_str(), "TextRTFLXX", 10))
 			feature = "GreekDef";
@@ -736,13 +782,14 @@
 	(*myVk) = TOP;
 	cbBook->Clear();
 	while (!myVk->Error()) {
-		AnsiString s1 = (const char *)(*myVk);
-		s1.SetLength(s1.Length() - 4);
+		AnsiString s1 = myVk->getBookName();
 		cbBook->Items->Add(UTF8ToWideString(s1));
-//		cbBook->Items->Add(s1);
 		myVk->Book(myVk->Book() + 1);
 	}
 	delete myVk;
+	cbBook->ItemIndex = cbBook->Items->IndexOf(UTF8ToWideString(vk->getBookName()));
+	CHBox->Text  = vk->Chapter();
+	VSBox->Text  = vk->Verse();
 }
 
 
@@ -1069,19 +1116,7 @@
 
 	tmpval = optionsconf->Sections["General"]["GlosAsDicts"];
 	showGlos = (::stricmp(tmpval.c_str(), "false"));
-	
-	DefaultVSKey = new VerseKey();
-	DefaultStrKey = new StrKey();
 
-	fillVKeySelector(DefaultVSKey);
-
-//	cbBook->ItemIndex = cbBook->Items->IndexOf("James");
-
-	DefaultVSKey->Persist(1);	// when set to a module, make the module hold on to this actual key and not a copy
-	*DefaultVSKey = "James 1:19"; // set to our standard starting verse
-	DefaultStrKey->Persist(1);
-	*DefaultStrKey = "";
-
 	try {
 		mainmgr = new BibleCSMGR(ModInstFrm);
 	}
@@ -1093,6 +1128,12 @@
 		Application->Terminate();
 	// Load devotion and show form
 
+       	DefaultStrKey = new StrKey();
+
+	DefaultStrKey->Persist(1);
+	*DefaultStrKey = "";
+
+
 	CreateParallelPane((SWMgr **)&mainmgr);
 	for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) {
 		bool devotional = false;
@@ -1116,7 +1157,7 @@
 			MessageBox(this->Handle, buf, "Module Unsupported", MB_OK|MB_ICONWARNING);
 			continue;
 		}
- 
+
 		// leave out enciphered texts with no key
 		if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) {
 			if ((eit = (*sit).second.find("CipherKey")) != (*sit).second.end()) {
@@ -1238,7 +1279,7 @@
 	updateModuleOptions(Options2);
 	
 	syncSpeedButtons();
-	   
+
 	if ((sit = layoutconf->Sections.find("History")) != layoutconf->Sections.end()) {
 
 		eitend = (*sit).second.upper_bound("SearchText");
@@ -1309,8 +1350,6 @@
 
 	SplashPg->Hide();
 
-	refreshAppearance();
-
 	tmpval = optionsconf->Sections["General"]["TipOfTheDay"];
 	if(!::stricmp(tmpval.c_str(), "Devotional")) {
 		DevOfTheDay2->Show();
@@ -1324,10 +1363,18 @@
 		if (startVerse.Length()) {
 			freeHandLookup->Text = UTF8ToWideString(startVerse.c_str());
 			char ret = '\r';
-			freeHandLookupKeyPress(0, ret);
+//			freeHandLookupKeyPress(0, ret);
 		}
 	}
 
+	SWModule *module = mainmgr->getModule(TextPageControl->ActivePage->Caption.c_str());
+        if (module) {
+        	SWKey *k = module->getKey();
+                VerseKey *vk = SWDYNAMIC_CAST(VerseKey, k);
+                if (vk) {
+			refreshAppearance(vk);
+                }
+        }
 }
 
 void TForm1::updateModuleOptions(TMenuItem *parentItem, int staticMenuItemsCount) {
@@ -1337,7 +1384,7 @@
 
 	static vector<SWBuf> optionStrings;
 	optionStrings.clear();
-	
+
 	while (parentItem->Count > staticMenuItemsCount)
 		parentItem->Delete(staticMenuItemsCount);
 
@@ -1389,16 +1436,16 @@
 {
 	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()) {
+        SWModule *module = mainmgr->getModule(token);
+	if (module) {
 		token = strtok(NULL, "");
-		SWKey *key = (SWKey *)*(it->second);
+		SWKey *key = module->getKey();
 		(*key) = token;
-		Lookup->Text = (const char *)(*(*it).second);
+		Lookup->Text = module->getKeyText();
 	}
 	else Lookup->Text = "";
 			
@@ -1408,15 +1455,15 @@
 {
 	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()) {
+	SWModule *module = mainmgr->getModule(token);
+	if (module) {
 		token = strtok(NULL, "");
-		ListKey &results = (*it).second->Search(token, REG_ICASE);
+		ListKey &results = module->search(token, REG_ICASE);
 		while (!results.Error()) {
 			retval = retval + (const char *)results + "; ";
 			results++;
@@ -1428,15 +1475,13 @@
 //---------------------------------------------------------------------------
 void __fastcall TForm1::UpDown3Click(TObject *Sender, TUDBtnType Button)
 {
-	ModMap::iterator it;
-	
-	it = mainmgr->Modules.find(LexDictPageControl->ActivePage->Caption.c_str());
-	if (it != mainmgr->Modules.end()) {
+	SWModule *module = mainmgr->getModule(LexDictPageControl->ActivePage->Caption.c_str());
+	if (module) {
 		if (Button == btNext)
-			(*((*it).second))++;
-		else	(*((*it).second))--;
+			(*module)++;
+		else	(*module)--;
 		//DictKeyEdit->Text = UTF8ToWideString(((*it).second)->KeyText());
-                DictKeyEdit->Text = ((*it).second)->KeyText();
+                DictKeyEdit->Text = module->getKeyText();
 	}
 }
 //---------------------------------------------------------------------------
@@ -1453,22 +1498,17 @@
 					and it works, I think ;-) */
 void TForm1::RestoreState(ModState *state)
 {
-    ModMap::iterator it;
-
 	if (state) {
 		state->pc->ActivePage = (TTabSheet *)state->ap;
 		if ((state->pc == TextPageControl) || (state->pc == CommentaryPageControl)) {
 			if (mainmgr) {
-				it = mainmgr->Modules.find(state->pc->ActivePage->Caption.c_str());
-				if (it != mainmgr->Modules.end()) {
-					SWModule *module = it->second;
-					SWKey *key = (SWKey *)*module;
+				SWModule *module = mainmgr->getModule(state->pc->ActivePage->Caption.c_str());
+				if (module) {
+					SWKey *key = module->getKey();
 					(*key) = state->key;
-					*DefaultVSKey = state->key;
 					TextKeyChanged();
 				}
 				else if (state->pc->ActivePage->Caption == "PARALLEL") {
-					*DefaultVSKey = state->key;
 					TextKeyChanged();
 				}
 			}
@@ -1525,15 +1565,17 @@
 		if (src[j] != '&')
 			value.append(src[j]);
 	}
-	*DefaultVSKey = value;	
+        VerseKey *vk = getActiveVerseKey();
+        if (vk) *vk = value;
 	TextKeyChanged();
 }
 
 void __fastcall TForm1::AddBookmark1Click(TObject *Sender)
 {
-//	TMenuItem *newitem;
-
-	bookmarkForm->bmtree->Items->AddChild(bookmarkForm->bmtree->Items->Item[0], UTF8ToWideString((const char *)*DefaultVSKey));
+	VerseKey *vk = getActiveVerseKey();
+        if (vk) {
+		bookmarkForm->bmtree->Items->AddChild(bookmarkForm->bmtree->Items->Item[0], UTF8ToWideString(vk->getText()));
+        }
 }
 
 void TForm1::AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree)
@@ -1591,7 +1633,6 @@
 {
 	char buf[5];
 	int val;
-	ModMap::iterator it;
 	TPageControl *pc = TextPageControl;
 
 	if ((Shift.Contains(ssCtrl)) && (!Shift.Contains(ssAlt))) {
@@ -1608,14 +1649,17 @@
 				if (pc->ActivePage->Caption == "PARALLEL") {
 					if (ctrlstates[val])
 						delete ctrlstates[val];
-					ctrlstates[val] = new ModState(pc, pc->ActivePage, *DefaultVSKey);
+					VerseKey *vk = getActiveVerseKey();
+                                        if (vk) {
+						ctrlstates[val] = new ModState(pc, pc->ActivePage, *vk);
+                                        }
 				}
-				else {					
-					it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
-					if (it != mainmgr->Modules.end()) {
+				else {
+					SWModule *module = mainmgr->getModule(pc->ActivePage->Caption.c_str());
+					if (module) {
 						if (ctrlstates[val])
 							delete ctrlstates[val];
-						ctrlstates[val] = new ModState(pc, pc->ActivePage, (*it).second->KeyText());
+						ctrlstates[val] = new ModState(pc, pc->ActivePage, module->getKeyText());
 					}
 				}
 			}
@@ -1681,28 +1725,31 @@
 		int offset = (strchr(verseNum.c_str(), '.') - verseNum.c_str());
 		verseNum.setSize(offset);
 		SWBuf fnNum = noteText+3+offset;
-		int oldVerse = DefaultVSKey->Verse();
-		DefaultVSKey->Verse(atoi(verseNum));
-		tmpVerseList.clear();
-		tmpVerseList << *DefaultVSKey;
-		module->RenderText();	// force entry attributes to get set
-		SWBuf type = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["type"].c_str();
-		SWBuf body = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["body"].c_str();
-		DefaultVSKey->Verse(oldVerse);
-		if ((type == "crossReference") || (clickText.c_str()[1] == 'x')) {
-			retVal = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["refList"].c_str();
-		}
-		else retVal = module->RenderText(body);
+                SWKey *key = module->getKey();
+                VerseKey *vk = SWDYNAMIC_CAST(VerseKey, key);
+                if (vk) {
+			int oldVerse = vk->Verse();
+			vk->Verse(atoi(verseNum));
+			tmpVerseList.clear();
+			tmpVerseList << *vk;
+			module->RenderText();	// force entry attributes to get set
+			SWBuf type = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["type"].c_str();
+			SWBuf body = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["body"].c_str();
+			vk->Verse(oldVerse);
+			if ((type == "crossReference") || (clickText.c_str()[1] == 'x')) {
+				retVal = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["refList"].c_str();
+			}
+			else retVal = module->RenderText(body);
+                }
 	}   
 	return retVal;
 }
 
 
 SWModule *TForm1::getActiveModule(TRxRichEdit *rtf) {
-	ModMap::iterator target;
 	SWBuf name = (rtf) ? ((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str() : TextPageControl->ActivePage->Caption.c_str();
-	target = mainmgr->Modules.find(name.c_str());
-	return (target != Form1->mainmgr->Modules.end()) ? target->second : 0;
+	SWModule *target = mainmgr->getModule(name.c_str());
+	return target;
 }
 
 
@@ -1716,7 +1763,7 @@
 			break;
 	if (!*ch)
 		return;
-		
+
 	SWBuf clickText = buf;
 	SWBuf origText  = Trim(AnsiString(clickText.c_str())).c_str();
 	SWModule *target = getActiveModule(rtf);
@@ -1727,9 +1774,13 @@
 	else {
 		clickText = origText;
 	}
+
+	tmpVerseList.clear();
+        VerseKey *vk = getActiveVerseKey();
+        if (vk) {
+        	tmpVerseList = vk->ParseVerseList(clickText.c_str(), *vk);
+        }
 	
-	tmpVerseList = DefaultVSKey->ParseVerseList(clickText.c_str(), *DefaultVSKey);
-	
 	// assert we have something to add
 	if (!tmpVerseList.Count())
 		return;
@@ -1897,14 +1948,15 @@
 {
 	TVerseListForm *tmpForm = new TVerseListForm(this, tmpVerseList);
 	tmpForm->Caption = UTF8ToWideString(tmpCaption);
-	tmpForm->Show();	
+	tmpForm->Show();
 }
 //---------------------------------------------------------------------------
 
 void __fastcall TForm1::freeHandLookupKeyPress(TObject *Sender, char &Key)
 {
-	if (Key == '\r') {
-		ListKey tmpVerseList = DefaultVSKey->ParseVerseList(WideStringToUTF8(freeHandLookup->Text).c_str(), *DefaultVSKey);
+	VerseKey *vk = getActiveVerseKey();
+	if (Key == '\r' && vk) {
+		ListKey tmpVerseList = vk->ParseVerseList(WideStringToUTF8(freeHandLookup->Text).c_str(), *vk);
 
 		if (tmpVerseList.Count()) {
 			// see if we already have an entry
@@ -1926,7 +1978,7 @@
 			}
 
 			tmpVerseList = TOP;
-			DefaultVSKey->positionFrom(tmpVerseList);
+			*vk = tmpVerseList;
 			TextKeyChanged();
 		}
 	}
@@ -1963,15 +2015,12 @@
 void __fastcall TForm1::EditEntry1Click(TObject *Sender)
 {
 	SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
-	SWModule *module;
-//	EditEntry->RichEdit1->Text = rtf->Text;
-	ModMap::iterator target;
-	target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
-	if (target != Form1->mainmgr->Modules.end()) {
-		EditEntryForm->Module = module = (*target).second;
+	SWModule *module = mainmgr->getModule(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+	if (module) {
+		EditEntryForm->Module = module;
 		EditEntryForm->RTFDisplay = rtf;
 	}
-	else	EditEntryForm->Module = module = 0;
+	else	EditEntryForm->Module = 0;
 	EditEntryForm->ShowModal();
 	if (EditEntryForm->ResultBuf) {
 		if (module)
@@ -1988,12 +2037,8 @@
 	WideString header = _tr("Delete Entry");
 	if (MessageBoxW(Handle, message.c_bstr(), header.c_bstr(), MB_YESNO) == IDYES) {
 		SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
-		SWModule *module;
-		ModMap::iterator target;
-
-		target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
-		if (target != Form1->mainmgr->Modules.end()) {
-			module = (*target).second;
+		SWModule *module = mainmgr->getModule(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+		if (module) {
 			module->deleteEntry();
 		}
 		RefreshActiveSheet(CommentaryPageControl);
@@ -2005,14 +2050,12 @@
 {
 	if (VerseSelFrm->ShowModal() == mrOk) {
 		SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl;
-		SWModule *module;
-		ModMap::iterator target;
-		SWKey *linkkey = new VerseKey(VerseSelFrm->Panel2->Caption.c_str());
-
-		target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
-		if (target != Form1->mainmgr->Modules.end()) {
-			module = (*target).second;
+		SWModule *module = mainmgr->getModule(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str());
+                if (module) {
+			SWKey *linkkey = module->CreateKey();
+                        *linkkey = VerseSelFrm->Panel2->Caption.c_str();
 			*module << linkkey;
+                        delete linkkey;
 		}
 		RefreshActiveSheet(CommentaryPageControl);
 	}
@@ -2136,7 +2179,10 @@
 	for (int loop = 0; ((loop < saveCount) && (loop <	freeHandLookup->Items->Count)); loop++)
 		 section.insert(ConfigEntMap::value_type("LookupText", WideStringToUTF8(freeHandLookup->Items->Strings[loop]).c_str()));
 
-	section["LastVerse"] = (const char *)*DefaultVSKey;
+	VerseKey *vk = getActiveVerseKey();
+        if (vk) {
+		section["LastVerse"] = vk->getText();
+        }
 	section["LastLDKey"] = WideStringToUTF8(DictKeyEdit->Text).c_str();
 	section["LastTextModule"] = TextPageControl->ActivePage->Caption.c_str();
 	section["LastComModule"] = CommentaryPageControl->ActivePage->Caption.c_str();
@@ -2176,8 +2222,6 @@
 			delete ctrlstates[loop];
 	}
 
-	if (DefaultVSKey)
-		delete DefaultVSKey;
 	if (DefaultStrKey)
 		delete DefaultStrKey;
 		
@@ -2277,8 +2321,11 @@
 		strcpy(buf, verse.c_str());
 		dehtmlize(buf);
 		(*Cancel) = true;
-		*DefaultVSKey = (buf);
-		TextKeyChanged();
+                VerseKey *vk = getActiveVerseKey();
+                if (vk) {
+			*vk = (buf);
+			TextKeyChanged();
+                }
 		delete [] buf;
 	}
 }
@@ -2291,7 +2338,7 @@
 //---------------------------------------------------------------------------
 
 
-void TForm1::refreshAppearance() {
+void TForm1::refreshAppearance(VerseKey *vk) {
 	ModMap::iterator it;
 	SWBuf locale;
 	SWBuf tmpval;
@@ -2323,9 +2370,10 @@
 	DictKeyEdit->Color    = fieldColor;
 
 	Form1->ShowHint = (optionsconf->Sections["Hints"].getWithDefault("Hints", "true") != "false");
-	DefaultVSKey->setLocale(locale.c_str());
-	fillVKeySelector(DefaultVSKey);
-	TextKeyChanged();
+        if (!vk) vk = getActiveVerseKey();
+	vk->setLocale(locale.c_str());
+	fillVKeySelector(vk);
+	TextKeyChanged(vk);
 	RefreshActiveSheet(LexDictPageControl);
 	RefreshActiveSheet(CommentaryPageControl);
 	RefreshActiveSheet(TextPageControl);
@@ -2379,11 +2427,9 @@
 					module = parallelDisp->getModules()[0];
 				}
 				else {
-					ModMap::iterator it = mainmgr->Modules.find(ts->Caption.c_str());
-					if (it != mainmgr->Modules.end())
-						module = it->second;
+					module = mainmgr->getModule(ts->Caption.c_str());
 				}
-					
+
 				if (module) {
 					HintStr = module->Description();
 					HintInfo.CursorRect = pc->TabRect(tab);
@@ -2410,9 +2456,7 @@
 		module = parallelDisp->getModules()[0];
 	}
 	else {
-		ModMap::iterator it = mainmgr->Modules.find(strstr(modName, "RTF")+3);
-		if (it != mainmgr->Modules.end())
-			module = it->second;
+		module = mainmgr->getModule(strstr(modName, "RTF")+3);
 	}
 
 
@@ -2528,39 +2572,41 @@
 		// currently assume all links are verselists (added note types still using verseList variable name)
 		if (verseList.Length()) {
 			if (verseList.c_str()[0] == '*') {	// '*' = NOTE
-				ModMap::iterator it;
-				it = mainmgr->Modules.find(TextPageControl->ActivePage->Caption.c_str());
-				if (it != mainmgr->Modules.end()) {
-					SWModule *module = it->second;
+				SWModule *module = mainmgr->getModule(TextPageControl->ActivePage->Caption.c_str());
+				if (module) {
 					SWBuf verseNum = verseList.c_str()+2;
 					int offset = (strchr(verseNum.c_str(), '.') - verseNum.c_str());
 					verseNum.setSize(offset);
 					SWBuf fnNum = verseList.c_str()+3+offset;
-					int oldVerse = DefaultVSKey->Verse();
-					DefaultVSKey->Verse(atoi(verseNum));
-					module->RenderText();	// force entry attributes to get set
-					SWBuf type = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["type"].c_str();
-					SWBuf body = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["body"].c_str();
-					SWBuf refList = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["refList"].c_str();
-					body = module->RenderText(body.c_str());
-					DefaultVSKey->Verse(oldVerse);
- 
-					if ((type == "crossReference") || (verseList.c_str()[1] == 'x')
-					// this doesn't work cuz we never cat into the hint code if a meta key is pressed.  curious.
-					// && (!GetAsyncKeyState(VK_LCONTROL))
-					) {
-						ListKey verses = DefaultVSKey->ParseVerseList(refList.c_str(), *DefaultVSKey, true);
-						if (verses.Count()) {
-							RTFHintForm->rtfDrawer->fillWithVerses(module, &verses, body.c_str(), true, true, "Popup");
+                                        SWKey *key = module->getKey();
+                                        VerseKey *vk = SWDYNAMIC_CAST(VerseKey, key);
+                                        if (vk) {
+						int oldVerse = vk->Verse();
+						vk->Verse(atoi(verseNum));
+						module->RenderText();	// force entry attributes to get set
+						SWBuf type = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["type"].c_str();
+						SWBuf body = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["body"].c_str();
+						SWBuf refList = module->getEntryAttributes()["Footnote"][fnNum.c_str()]["refList"].c_str();
+						body = module->RenderText(body.c_str());
+						vk->Verse(oldVerse);
+
+						if ((type == "crossReference") || (verseList.c_str()[1] == 'x')
+						// this doesn't work cuz we never cat into the hint code if a meta key is pressed.  curious.
+						// && (!GetAsyncKeyState(VK_LCONTROL))
+						) {
+							ListKey verses = vk->ParseVerseList(refList.c_str(), *vk, true);
+							if (verses.Count()) {
+								RTFHintForm->rtfDrawer->fillWithVerses(module, &verses, body.c_str(), true, true, "Popup");
+								HintStr = "show rtf";
+							}
+							else HintStr = "";
+						}
+						else {
+							RTFHintForm->rtfDrawer->fillWithRTFString(module, body.c_str());
 							HintStr = "show rtf";
 						}
-						else HintStr = "";
-					}
-					else {
-						RTFHintForm->rtfDrawer->fillWithRTFString(module, body.c_str());
-						HintStr = "show rtf";
-					}
-				}   
+                                        }
+				}
 				break;
 
 			}
@@ -2570,18 +2616,19 @@
 					module = Form1->parallelDisp->getModules()[0];
 				}
 				else {
-					ModMap::iterator it = mainmgr->Modules.find(TextPageControl->ActivePage->Caption.c_str());
-					if (it != mainmgr->Modules.end()) {
-						module = it->second;
-					}
+					module = mainmgr->getModule(TextPageControl->ActivePage->Caption.c_str());
 				}
 				if (module) {
-					ListKey verses = DefaultVSKey->ParseVerseList(verseList.c_str(), *DefaultVSKey, true);
-					if (verses.Count()) {
-						RTFHintForm->rtfDrawer->fillWithVerses(module, &verses, 0, true, true, "Popup");
-						HintStr = "show rtf";
-					}
-					else HintStr = "";
+                                	SWKey *key = module->getKey();
+                                        VerseKey *vk = SWDYNAMIC_CAST(VerseKey, key);
+                                        if (vk) {
+						ListKey verses = vk->ParseVerseList(verseList.c_str(), *vk, true);
+						if (verses.Count()) {
+							RTFHintForm->rtfDrawer->fillWithVerses(module, &verses, 0, true, true, "Popup");
+							HintStr = "show rtf";
+						}
+						else HintStr = "";
+                                        }
 				}
 				break;
 			}
@@ -2602,16 +2649,14 @@
 			}
 
 			if (!link && (i >= strongsWord.Length()) && (i-1)) {
-				String feature = (DefaultVSKey->Testament() == 1)?"Hebrew":"Greek";
+                        	VerseKey *vk = getActiveVerseKey();
+				String feature = (vk && (vk->Testament() == 1))?"Hebrew":"Greek";
 				feature += (preChar == '(')?"Parse":"Def";
 				if (!strncmp(HintInfo.HintControl->Name.c_str(), "TextRTFLXX", 10))
 					feature = "GreekDef";
 				SWBuf tmpval = optionsconf->Sections["ModDefaults"][feature.c_str()];
 				if (tmpval.size()) {
-					SWModule *defMod = 0;
-					ModMap::iterator it = mainmgr->Modules.find(tmpval);
-					if (it != mainmgr->Modules.end())
-						defMod = it->second;
+					SWModule *defMod = mainmgr->getModule(tmpval);
 					if (!defMod) {
 						HintStr = "";
 						break;
@@ -2629,10 +2674,7 @@
 		if (!link && hintWords) {
 			SWBuf tmpval = optionsconf->Sections["ModDefaults"]["GenDict"];
 			if (tmpval.size()) {
-				SWModule *defMod = 0;
-				ModMap::iterator it = mainmgr->Modules.find(tmpval);
-				if (it != mainmgr->Modules.end())
-					defMod = it->second;
+				SWModule *defMod = mainmgr->getModule(tmpval);
 				if (!defMod)
 					break;
 				ListKey key;
@@ -2648,7 +2690,7 @@
 	if (!HintStr.Length()) {
 //			HintInfo = saveHintInfo;
 		HintInfo.HintWindowClass = __classid(THintWindow);
-/*				
+/*
 		if (module)
 			HintStr = module->Description();
 		if (lastHint == HintStr)
@@ -2890,17 +2932,18 @@
 	}
 
         // must show first so we can set target and see if we're using indexing
-    searchForm->Show();
+	searchForm->Show();
 
-    if ((lookupKey.Length() > 1) && (lookupKey[1] == '<') && (lookupKey[lookupKey.Length()] == '>')) {
-      if (searchForm->usingSearchFramework) {
-	    lookupKey = (String)"lemma:"+((DefaultVSKey->Testament()>1)?"G":"H")+lookupKey.SubString(2,lookupKey.Length()-2);
-	 }
-	 else {
-	    lookupKey = (String)"<"+((DefaultVSKey->Testament()>1)?"G":"H")+lookupKey.SubString(2,lookupKey.Length()-2)+">";
-      }
-    }
-   searchForm->SearchText->Text = lookupKey;
+        VerseKey *vk = getActiveVerseKey();
+	if ((lookupKey.Length() > 1) && (lookupKey[1] == '<') && (lookupKey[lookupKey.Length()] == '>')) {
+		if (searchForm->usingSearchFramework) {
+			lookupKey = (String)"lemma:"+((vk && (vk->Testament()>1))?"G":"H")+lookupKey.SubString(2,lookupKey.Length()-2);
+		}
+		else {
+			lookupKey = (String)"<"+((vk && (vk->Testament()>1))?"G":"H")+lookupKey.SubString(2,lookupKey.Length()-2)+">";
+		}
+	}
+	searchForm->SearchText->Text = lookupKey;
 }
 //---------------------------------------------------------------------------
 

Modified: branches/BCB5/mainfrm.h
===================================================================
--- branches/BCB5/mainfrm.h	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/mainfrm.h	2009-04-21 12:15:33 UTC (rev 499)
@@ -103,6 +103,18 @@
 	}
 };
 
+
+class RTFVerseKeyDisp : public RTFDisp {
+	SWDispRTF *edit;
+	static VerseKey *last;
+public:
+	RTFVerseKeyDisp(SWDispRTF *iedit) : RTFDisp(iedit) {}
+	RTFVerseKeyDisp() {}
+
+	virtual char Display(SWModule &imodule);
+};
+
+
 class HREFDisp : public SWDisplay {
 	TCppWebBrowser *edit;
 public:
@@ -379,17 +391,15 @@
 	void AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree);
 	void FillDictKeys();
 	void AddVerseChoices(TPopupMenu *menu, const char *buf, TRxRichEdit *rtf);
-	void fillVKeySelector(VerseKey *vk);
 	static bool hasFeature(SWMgr *mgr, const char *modName, const char *feature);
 	void NavigateVerseURL(char* verStr);
-	void refreshAppearance();
+	void refreshAppearance(VerseKey *vk = 0);
 
 public:		// User declarations
 	TTntListBox *lbDictKeys;
 	TTntEdit *DictKeyEdit;
 	TTntComboBox *freeHandLookup;
 	TTntComboBox *cbBook;
-	VerseKey *DefaultVSKey;
 	SWKey *DefaultStrKey;
 	BibleCSMGR *mainmgr;
 	SWConfig *layoutconf;
@@ -399,12 +409,12 @@
 	__fastcall ~TForm1();
 	void __fastcall DisplayHint(TObject* Sender);
 	void RefreshActiveSheet(TPageControl *ts);
-	void TextKeyChanged();		// updates dependents on TextKeyChanged
+	void TextKeyChanged(VerseKey *vk = 0);		// updates dependents on TextKeyChanged
 	void RefreshBookmarksMenu(TMenu *menu, TTreeView *tree);
 	void RestoreState(ModState *state);
 	void i12ize(const char *lang);
 	static WideString TrimJunk(WideString src);
-	void __fastcall AppMessage(tagMSG &Msg, bool &Handled);     
+	void __fastcall AppMessage(tagMSG &Msg, bool &Handled);
 	static void ClipOrCenterRectToMonitor(LPRECT prc, UINT flags);
 	static void ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags);
 	// set when parsing for a popup menu, and used when popout choice is picked
@@ -420,6 +430,9 @@
 	SWBuf getNoteText(const char *noteText, SWModule *module = 0);
 	SWModule *getActiveModule(TRxRichEdit *rtf = 0);
 	void updateModuleOptions(TMenuItem *parentItem, int staticMenuItemsCount = 1);
+	SWModule *getFocusedModule();
+	VerseKey *getActiveVerseKey();
+	void fillVKeySelector(VerseKey *vk);
 };
 
 class TRTFHintWindow : public THintWindow {

Modified: branches/BCB5/stage/layout.conf
===================================================================
--- branches/BCB5/stage/layout.conf	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/stage/layout.conf	2009-04-21 12:15:33 UTC (rev 499)
@@ -39,26 +39,26 @@
 Wesley=
 
 [History]
-LastComModule=JFB
+LastComModule=Jub
 LastLDKey=DAVID
 LastLDModule=ImageSampler
 LastParaMod01=ESV
 LastParaMod02=ASV
 LastParaMod03=NETtext
-LastTextModule=NASB
-LastVerse=James 4:4
+LastTextModule=AraSVD
+LastVerse=Leviticus 1:1
 LookupSaveCount=5
+LookupText=Genesis 1:1
+LookupText=James 4:8
+LookupText=James 4:4
 LookupText=James 4.4
 LookupText=James 1:1
-LookupText=James 3:1
-LookupText=James 1:5
-LookupText=James 1:4
 SearchSaveCount=5
+SearchText=God love* world
+SearchText=God love world
 SearchText=the sword
 SearchText=God love +world
-SearchText=God love world
 SearchText=kingdom
-SearchText=regeneration
 
 [LDView]
 2BabDict=
@@ -192,13 +192,13 @@
 la_en=
 
 [ModuleOptions]
-Cross-references=On
-Footnotes=On
+Cross-references=Off
+Footnotes=Off
 Headings=On
 Hebrew Cantillation=Off
 Hebrew Vowel Points=On
-Morphological Tags=On
-Strong's Numbers=On
+Morphological Tags=Off
+Strong's Numbers=Off
 Textual Variants=Primary Reading
 Transliteration=Off
 Words of Christ in Red=On
@@ -209,12 +209,12 @@
 MainTop=94
 MainWidth=1092
 Maximized=false
-SearchHeight=566
-SearchLeft=599
+SearchHeight=701
+SearchLeft=549
 SearchMaximized=false
 SearchResCol0Width=175
 SearchTop=51
-SearchWidth=759
+SearchWidth=809
 TextComHeight=529
 TextWidth=687
 

Modified: branches/BCB5/swdisprtfchap.cpp
===================================================================
--- branches/BCB5/swdisprtfchap.cpp	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/swdisprtfchap.cpp	2009-04-21 12:15:33 UTC (rev 499)
@@ -196,9 +196,9 @@
 
 	RTFStream->Clear();
 	RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
-//	int fd = open("rtfout.txt", O_CREAT|O_RDWR|O_TRUNC, S_IREAD|S_IWRITE);
-//	write(fd, newtext.c_str(), newtext.Length());
-//	close(fd);
+	int fd = open("rtfout.txt", O_CREAT|O_RDWR|O_TRUNC, S_IREAD|S_IWRITE);
+	write(fd, newtext.c_str(), newtext.Length());
+	close(fd);
 	RTFStream->Position = 0;
 		Lines->LoadFromStream(RTFStream);
 

Modified: branches/BCB5/sword.bpr
===================================================================
--- branches/BCB5/sword.bpr	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/sword.bpr	2009-04-21 12:15:33 UTC (rev 499)
@@ -79,7 +79,7 @@
 MajorVer=1
 MinorVer=5
 Release=11
-Build=9
+Build=10
 Debug=0
 PreRelease=0
 Special=0
@@ -91,7 +91,7 @@
 [Version Info Keys]
 CompanyName=CrossWire Bible Society
 FileDescription=Windows User Interface to The SWORD Project
-FileVersion=1.5.11.9
+FileVersion=1.5.11.10
 InternalName=biblecs
 LegalCopyright=(c) 1990-2008 CrossWire Bible Society under the terms of the GNU General Public License
 LegalTrademarks=

Modified: branches/BCB5/sword.res
===================================================================
(Binary files differ)

Modified: branches/BCB5/vrslstfrm.cpp
===================================================================
--- branches/BCB5/vrslstfrm.cpp	2009-04-20 08:24:47 UTC (rev 498)
+++ branches/BCB5/vrslstfrm.cpp	2009-04-21 12:15:33 UTC (rev 499)
@@ -61,8 +61,11 @@
 
 void __fastcall TVerseListForm::ListBox1DblClick(TObject *Sender)
 {
-	*(Form1->DefaultVSKey) = WideStringToUTF8(ListBox1->Items->Strings[ListBox1->ItemIndex]).c_str();
-	Form1->TextKeyChanged();
+	VerseKey *vk = Form1->getActiveVerseKey();
+        if (vk) {
+		*vk = WideStringToUTF8(ListBox1->Items->Strings[ListBox1->ItemIndex]).c_str();
+		Form1->TextKeyChanged();
+        }
 }
 //---------------------------------------------------------------------------
 void __fastcall TVerseListForm::FormShow(TObject *Sender)
@@ -91,7 +94,10 @@
 // ADD CURRENT
 void __fastcall TVerseListForm::SpeedButton1Click(TObject *Sender)
 {
-	ListBox1->Items->Add(UTF8ToWideString((const char *)*(Form1->DefaultVSKey)));
+	VerseKey *vk = Form1->getActiveVerseKey();
+        if (vk) {
+		ListBox1->Items->Add(UTF8ToWideString((const char *)*(vk)));
+        }
 }
 //---------------------------------------------------------------------------
 // DELETE SELECTED




More information about the sword-cvs mailing list