[sword-cvs] sword/apps/windoze/CBuilder5/BibleCS mainfrm.cpp,1.121,1.122 mainfrm.h,1.45,1.46 paraldisp.cpp,1.2,1.3 paraldisp.h,1.1,1.2 searchfrm.cpp,1.41,1.42 sword.bpr,1.112,1.113 sword.res,1.99,1.100 vrslstfrm.cpp,1.13,1.14
sword@www.crosswire.org
sword@www.crosswire.org
Thu, 19 Jun 2003 09:58:32 -0700
Update of /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS
In directory www:/tmp/cvs-serv19591/apps/windoze/CBuilder5/BibleCS
Modified Files:
mainfrm.cpp mainfrm.h paraldisp.cpp paraldisp.h searchfrm.cpp
sword.bpr sword.res vrslstfrm.cpp
Log Message:
no message
Index: mainfrm.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -C2 -d -r1.121 -r1.122
*** mainfrm.cpp 18 Jun 2003 23:37:21 -0000 1.121
--- mainfrm.cpp 19 Jun 2003 16:58:30 -0000 1.122
***************
*** 436,448 ****
if (pc == LexDictPageControl)
FillDictKeys();
! }else if(pc->ActivePage->Caption == "PARALLEL")
! {
! parallelDisp->Display();
! pc->Hint = "PARALLEL";
if (logmodstate)
modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, *DefaultVSKey));
! if (pc == LexDictPageControl)
! FillDictKeys();
! }
}
}
--- 436,446 ----
if (pc == LexDictPageControl)
FillDictKeys();
! }
! else if (pc->ActivePage->Caption == "PARALLEL") {
! parallelDisp->Display();
! pc->Hint = "PARALLEL";
if (logmodstate)
modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, *DefaultVSKey));
! }
}
}
***************
*** 455,459 ****
VSBox->Text = DefaultVSKey->Verse();
//freeHandLookup->Text = UTF8ToWideString((const char *)*DefaultVSKey);
! freeHandLookup->Text = (const char *)*DefaultVSKey;
RefreshActiveSheet(TextPageControl);
logmodstate = false; // only log state once
--- 453,457 ----
VSBox->Text = DefaultVSKey->Verse();
//freeHandLookup->Text = UTF8ToWideString((const char *)*DefaultVSKey);
! freeHandLookup->Text = (const char *)*DefaultVSKey;
RefreshActiveSheet(TextPageControl);
logmodstate = false; // only log state once
***************
*** 1387,1392 ****
/* TODO -cParallel Disp : Troy could you make sure that I did this correctly?
I am not sure what they key was for in the original
! if statement so I left it out of the PARALLEL statement
! and it works, I think ;-) */
void TForm1::RestoreState(ModState *state)
{
--- 1385,1390 ----
/* TODO -cParallel Disp : Troy could you make sure that I did this correctly?
I am not sure what they key was for in the original
! if statement so I left it out of the PARALLEL statement
! and it works, I think ;-) */
void TForm1::RestoreState(ModState *state)
{
***************
*** 1404,1416 ****
*DefaultVSKey = state->key;
TextKeyChanged();
! }else if(state->pc->ActivePage->Caption == "PARALLEL") {
*DefaultVSKey = state->key;
TextKeyChanged();
! }
}
}
if (state->pc == LexDictPageControl) {
//DictKeyEdit->Text = UTF8ToWideString((const char *)state->key);
! DictKeyEdit->Text = ((const char *)state->key);
}
if (state->pc->ActivePage->ControlCount){
--- 1402,1415 ----
*DefaultVSKey = state->key;
TextKeyChanged();
! }
! else if (state->pc->ActivePage->Caption == "PARALLEL") {
*DefaultVSKey = state->key;
TextKeyChanged();
! }
}
}
if (state->pc == LexDictPageControl) {
//DictKeyEdit->Text = UTF8ToWideString((const char *)state->key);
! DictKeyEdit->Text = ((const char *)state->key);
}
if (state->pc->ActivePage->ControlCount){
***************
*** 1559,1568 ****
pc = LexDictPageControl;
! it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
! if (it != mainmgr->Modules.end()) {
if (ctrlstates[val])
delete ctrlstates[val];
!
! ctrlstates[val] = new ModState(pc, pc->ActivePage, (*it).second->KeyText());
}
}
--- 1558,1573 ----
pc = LexDictPageControl;
! if (pc->ActivePage->Caption == "PARALLEL") {
if (ctrlstates[val])
delete ctrlstates[val];
! ctrlstates[val] = new ModState(pc, pc->ActivePage, *DefaultVSKey);
! }
! else {
! it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
! if (it != mainmgr->Modules.end()) {
! if (ctrlstates[val])
! delete ctrlstates[val];
! ctrlstates[val] = new ModState(pc, pc->ActivePage, (*it).second->KeyText());
! }
}
}
***************
*** 1705,1712 ****
}
}
!
! tmpVerseList = DefaultVSKey->ParseVerseList(highlight.c_str(), *DefaultVSKey);
! if (tmpVerseList.Count())
! AddVerseChoices(menu, highlight.c_str(), rtf);
}
else if (!rtf->SelLength) {
--- 1710,1718 ----
}
}
! else {
! tmpVerseList = DefaultVSKey->ParseVerseList(highlight.c_str(), *DefaultVSKey);
! if (tmpVerseList.Count())
! AddVerseChoices(menu, highlight.c_str(), rtf);
! }
}
else if (!rtf->SelLength) {
***************
*** 2399,2406 ****
}
else if (hintVLists) { // otherwise assume verselist
! ModMap::iterator it;
! it = mainmgr->Modules.find(TextPageControl->ActivePage->Caption.c_str());
! if (it != mainmgr->Modules.end()) {
! SWModule *module = it->second;
ListKey verses = DefaultVSKey->ParseVerseList(verseList.c_str(), *DefaultVSKey, true);
if (verses.Count()) {
--- 2405,2419 ----
}
else if (hintVLists) { // otherwise assume verselist
! SWModule *module = 0;
! if (TextPageControl->ActivePage->Caption == "PARALLEL") {
! 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;
! }
! }
! if (module) {
ListKey verses = DefaultVSKey->ParseVerseList(verseList.c_str(), *DefaultVSKey, true);
if (verses.Count()) {
***************
*** 2802,2805 ****
--- 2815,2823 ----
menus[i]->Caption = "Bible " + IntToStr(i+1);
menu->Items->Add(menus[i]);
+ newitem = new TMenuItem(menu);
+ newitem->Caption = "[NONE]";
+ newitem->Hint = "Remove This View";
+ newitem->OnClick = ParallelMenuItemClick;
+ menus[i]->Add(newitem);
}
***************
*** 2809,2814 ****
newitem = new TMenuItem(menu);
newitem->Caption = it->second->Name();
! if(!strcmp(parallelDisp->mod[i].c_str(), newitem->Caption.c_str()))
! newitem->Checked = true;
newitem->Hint = it->second->Description();
newitem->OnClick = ParallelMenuItemClick;
--- 2827,2832 ----
newitem = new TMenuItem(menu);
newitem->Caption = it->second->Name();
! if(!strcmp(parallelDisp->mod[i].c_str(), newitem->Caption.c_str()))
! newitem->Checked = true;
newitem->Hint = it->second->Description();
newitem->OnClick = ParallelMenuItemClick;
***************
*** 2835,2838 ****
--- 2853,2857 ----
parallelDisp->mod[bno] = value;
parallelDisp->Display();
+ delete [] value;
}
Index: mainfrm.h
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/mainfrm.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** mainfrm.h 12 Jun 2003 02:03:34 -0000 1.45
--- mainfrm.h 19 Jun 2003 16:58:30 -0000 1.46
***************
*** 367,372 ****
String clickText;
- ParallelDisp *parallelDisp;
-
char CreateTextPane(SWModule *mod);
char CreateParallelPane(SWMgr **mgr);
--- 367,370 ----
***************
*** 410,413 ****
--- 408,412 ----
bool renderingHint;
bool closing;
+ ParallelDisp *parallelDisp;
};
Index: paraldisp.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/paraldisp.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** paraldisp.cpp 13 Jun 2003 12:18:21 -0000 1.2
--- paraldisp.cpp 19 Jun 2003 16:58:30 -0000 1.3
***************
*** 21,28 ****
--- 21,31 ----
: SWDispRTFChap(Owner) {
modCount = 3;
+ mods = 0;
}
__fastcall ParallelDisp::~ParallelDisp() {
+ if (mods)
+ delete [] mods;
}
***************
*** 33,39 ****
}
- char ParallelDisp::Display() {
! SWModule **mods;
int realModCount = 0;
for (int i = 0; i < modCount; i++) {
--- 36,44 ----
}
! SWModule **ParallelDisp::getModules() {
! if (mods)
! delete [] mods;
!
int realModCount = 0;
for (int i = 0; i < modCount; i++) {
***************
*** 43,51 ****
}
! // assert we have at least one module to display
! if (!realModCount)
! return 0; // not an error, just nothing to display
!
! mods = new SWModule *[realModCount];
realModCount = 0;
for (int i = 0; i < modCount; i++) {
--- 48,52 ----
}
! mods = new SWModule *[realModCount+1];
realModCount = 0;
for (int i = 0; i < modCount; i++) {
***************
*** 54,63 ****
mods[realModCount++] = it->second;
}
int testmt, book, chap, verse, versepos;
char buf[254];
System::AnsiString newtext, tmptext, tmptext2;
-
VerseKey *key = (VerseKey *)(SWKey *)(*mods[0]);
UnicodeRTF uToRTF;
--- 55,76 ----
mods[realModCount++] = it->second;
}
+ mods[realModCount] = 0;
+ return mods;
+ }
+
+ char ParallelDisp::Display() {
+
+ SWModule **mods = getModules();
+ int realModCount;
+ for (realModCount = 0; mods[realModCount]; realModCount++);
+ // assert we have at least one module to display
+ if (!realModCount)
+ return 0; // not an error, just nothing to display
+
int testmt, book, chap, verse, versepos;
char buf[254];
System::AnsiString newtext, tmptext, tmptext2;
VerseKey *key = (VerseKey *)(SWKey *)(*mods[0]);
UnicodeRTF uToRTF;
***************
*** 73,77 ****
recalcAppearance();
-
newtext = RTFHeader;
newtext = newtext + RTFChapterMarkPre + IntToStr(chap) + RTFChapterMarkPost;
--- 86,89 ----
***************
*** 81,85 ****
-
/*
// Dunno if this first line does anything
--- 93,96 ----
***************
*** 206,209 ****
--- 217,221 ----
RTFStream->Position = 0;
Lines->LoadFromStream(RTFStream);
+ makeLinks();
versepos = GetTextLen() - 3;
}
***************
*** 211,215 ****
if (z < (realModCount-1))
! newtext += "\\par__________\\par ";
else newtext += "\\par\\par ";
--- 223,227 ----
if (z < (realModCount-1))
! newtext += "\\par{\\super _______}\\par ";
else newtext += "\\par\\par ";
***************
*** 243,277 ****
RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
RTFStream->Position = 0;
! Lines->LoadFromStream(RTFStream);
!
! // make links
! while (true) {
! int start, len, foundAt, endAt;
!
! start = (SelLength) ? SelStart + SelLength : 0;
! len = Text.Length() - start;
! foundAt = this->SearchText("<a href=\"\">", start, len, TRichSearchTypes());
! if (foundAt == -1)
! break;
! SelStart = foundAt;
! SelLength = 11;
! this->SelText = "";
! endAt = this->SearchText("</a>", foundAt, len, TRichSearchTypes());
! if (foundAt == -1)
! break;
! SelStart = endAt;
! SelLength = 4;
! this->SelText = "";
! SelStart = foundAt;
! SelLength = endAt - foundAt;
! this->SelAttributes->Link = true;
! }
//{ Position control text at current verse }
this->SetFocus();
SelStart = versepos;
SendMessage(Handle, EM_SCROLLCARET, 0, 0);
- delete [] mods;
return 0;
}
--- 255,268 ----
RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
RTFStream->Position = 0;
! Lines->LoadFromStream(RTFStream);
! makeLinks();
//{ Position control text at current verse }
this->SetFocus();
+ SelStart = 1;
+ SendMessage(Handle, EM_SCROLLCARET, 0, 0);
SelStart = versepos;
SendMessage(Handle, EM_SCROLLCARET, 0, 0);
return 0;
}
Index: paraldisp.h
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/paraldisp.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** paraldisp.h 12 Jun 2003 02:03:34 -0000 1.1
--- paraldisp.h 19 Jun 2003 16:58:30 -0000 1.2
***************
*** 37,40 ****
--- 37,41 ----
//---------------------------------------------------------------------------
class ParallelDisp : public SWDispRTFChap {
+ SWModule **mods;
protected:
public:
***************
*** 49,52 ****
--- 50,54 ----
virtual char Display(SWModule & imodule);
virtual char Display();
+ SWModule **getModules();
};
Index: searchfrm.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** searchfrm.cpp 26 Mar 2003 22:07:12 -0000 1.41
--- searchfrm.cpp 19 Jun 2003 16:58:30 -0000 1.42
***************
*** 337,343 ****
! ModMap::iterator it = Form1->mainmgr->Modules.find(targetpc->ActivePage->Caption.c_str());
! if (it != Form1->mainmgr->Modules.end()) {
! setTarget(it->second);
}
SearchText->SetFocus();
--- 337,351 ----
! if (targetpc->ActivePage->Caption == "PARALLEL") {
! SWModule *mod = Form1->parallelDisp->getModules()[0];
! if (mod) {
! setTarget(mod);
! }
! }
! else {
! ModMap::iterator it = Form1->mainmgr->Modules.find(targetpc->ActivePage->Caption.c_str());
! if (it != Form1->mainmgr->Modules.end()) {
! setTarget(it->second);
! }
}
SearchText->SetFocus();
Index: sword.bpr
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/sword.bpr,v
retrieving revision 1.112
retrieving revision 1.113
diff -C2 -d -r1.112 -r1.113
*** sword.bpr 12 Jun 2003 02:03:34 -0000 1.112
--- sword.bpr 19 Jun 2003 16:58:30 -0000 1.113
***************
*** 46,50 ****
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
! <USERDEFINES value="_ICU_;_ICUSWORD_;USBINARY;_DEBUG"/>
<SYSDEFINES value="NO_STRICT"/>
<MAINSOURCE value="sword.cpp"/>
--- 46,50 ----
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
! <USERDEFINES value="_ICU_;_ICUSWORD_;USBINARY"/>
<SYSDEFINES value="NO_STRICT"/>
<MAINSOURCE value="sword.cpp"/>
***************
*** 58,66 ****
-I..\..\..\..\..\icu-sword\source\i18n -I..\..\..\..\include
-I$(BCB)\include -I$(BCB)\include\vcl -Irxlib -src_suffix cpp -D_ICU_"/>
! <CFLAG1 value="-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 /zi"/>
! <LFLAGS value="-Iobj -D"" -aa -Tpe -GD -s -Gn -v"/>
</OPTIONS>
<LINKER>
--- 58,66 ----
-I..\..\..\..\..\icu-sword\source\i18n -I..\..\..\..\include
-I$(BCB)\include -I$(BCB)\include\vcl -Irxlib -src_suffix cpp -D_ICU_"/>
! <CFLAG1 value="-O2 -Vx -Ve -RT- -X- -a8 -4 -b- -k- -vi -c -tW -tWM"/>
! <PFLAGS value="-N2obj -N0obj -$Y- -$L- -$D- -v -M -JPHNE"/>
<RFLAGS value=""/>
! <AFLAGS value="/mx /w2 /zn"/>
! <LFLAGS value="-Iobj -D"" -aa -Tpe -GD -s -Gn"/>
</OPTIONS>
<LINKER>
***************
*** 76,80 ****
MinorVer=5
Release=5
! Build=31
Debug=0
PreRelease=0
--- 76,80 ----
MinorVer=5
Release=5
! Build=33
Debug=0
PreRelease=0
***************
*** 88,92 ****
CompanyName=CrossWire Software & Bible Society
FileDescription=Windows 32bit User Interface to The SWORD Project
! FileVersion=1.5.5.31
InternalName=biblecs
LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License
--- 88,92 ----
CompanyName=CrossWire Software & Bible Society
FileDescription=Windows 32bit User Interface to The SWORD Project
! FileVersion=1.5.5.33
InternalName=biblecs
LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License
***************
*** 133,138 ****
[HistoryLists\hlConditionals]
Count=8
! Item0=_ICU_;_ICUSWORD_;USBINARY;_DEBUG
! Item1=_ICU_;_ICUSWORD_;USBINARY
Item2=_ICU_;_ICUSWORD_;_DEBUG;USBINARY
Item3=_ICU_;_ICUSWORD_;_DEBUG
--- 133,138 ----
[HistoryLists\hlConditionals]
Count=8
! Item0=_ICU_;_ICUSWORD_;USBINARY
! Item1=_ICU_;_ICUSWORD_;USBINARY;_DEBUG
Item2=_ICU_;_ICUSWORD_;_DEBUG;USBINARY
Item3=_ICU_;_ICUSWORD_;_DEBUG
Index: sword.res
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/sword.res,v
retrieving revision 1.99
retrieving revision 1.100
diff -C2 -d -r1.99 -r1.100
Binary files /tmp/cvs6py2dn and /tmp/cvs6pFK1H differ
Index: vrslstfrm.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** vrslstfrm.cpp 27 Jan 2003 09:23:06 -0000 1.13
--- vrslstfrm.cpp 19 Jun 2003 16:58:30 -0000 1.14
***************
*** 36,48 ****
void __fastcall TVerseListForm::ListBox1Click(TObject *Sender) {
! ModMap::iterator target;
! target = Form1->mainmgr->Modules.find(Form1->TextPageControl->ActivePage->Caption.c_str());
! if (target != Form1->mainmgr->Modules.end()) {
ListKey key;
! SWKey *tkey = target->second->CreateKey();
*tkey = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str();
key << *tkey;
delete tkey;
! pvrtf->fillWithVerses(target->second, &key, true, false);
}
}
--- 36,57 ----
void __fastcall TVerseListForm::ListBox1Click(TObject *Sender) {
! SWModule *target = 0;
!
! if (Form1->TextPageControl->ActivePage->Caption == "PARALLEL") {
! target = Form1->parallelDisp->getModules()[0];
! }
! else {
! ModMap::iterator it;
! it = Form1->mainmgr->Modules.find(Form1->TextPageControl->ActivePage->Caption.c_str());
! if (it != Form1->mainmgr->Modules.end())
! target = it->second;
! }
! if (target) {
ListKey key;
! SWKey *tkey = target->CreateKey();
*tkey = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str();
key << *tkey;
delete tkey;
! pvrtf->fillWithVerses(target, &key, true, false);
}
}
***************
*** 108,114 ****
targetpc = Form1->LexDictPageControl;
! ModMap::iterator it = Form1->mainmgr->Modules.find(targetpc->ActivePage->Caption.c_str());
! if (it != Form1->mainmgr->Modules.end()) {
! RTFHintForm->rtfDrawer->fillWithVerses(it->second, &verses, true, true);
RTFHintForm->rtfDrawer->SelectAll();
RTFHintForm->rtfDrawer->CopyToClipboard();
--- 117,133 ----
targetpc = Form1->LexDictPageControl;
! SWModule *target = 0;
!
! if (targetpc->ActivePage->Caption == "PARALLEL") {
! target = Form1->parallelDisp->getModules()[0];
! }
! else {
! ModMap::iterator it;
! it = Form1->mainmgr->Modules.find(targetpc->ActivePage->Caption.c_str());
! if (it != Form1->mainmgr->Modules.end())
! target = it->second;
! }
! if (target) {
! RTFHintForm->rtfDrawer->fillWithVerses(target, &verses, true, true);
RTFHintForm->rtfDrawer->SelectAll();
RTFHintForm->rtfDrawer->CopyToClipboard();