From 1e057d67306569fcd9896dfcea1f5353810f0a48 Mon Sep 17 00:00:00 2001 From: danglassey Date: Wed, 28 Aug 2002 13:02:00 +0000 Subject: sync with crosswire 20020828-1300 --- apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm | 6 +- apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp | 50 ++++---- apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm | 4 +- apps/windoze/CBuilder5/BibleCS/PrintFrm.h | 1 + apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp | 29 ++++- apps/windoze/CBuilder5/BibleCS/mainfrm.cpp | 104 +++++++++++----- apps/windoze/CBuilder5/BibleCS/mainfrm.dfm | 15 ++- apps/windoze/CBuilder5/BibleCS/mainfrm.h | 7 +- apps/windoze/CBuilder5/BibleCS/optionfrm.cpp | 5 +- apps/windoze/CBuilder5/BibleCS/optionfrm.dfm | 122 +++++++++---------- apps/windoze/CBuilder5/BibleCS/searchfrm.cpp | 16 +++ apps/windoze/CBuilder5/BibleCS/searchfrm.dfm | 103 +++++++++------- apps/windoze/CBuilder5/BibleCS/searchfrm.h | 3 + apps/windoze/CBuilder5/BibleCS/sword.bpr | 6 +- apps/windoze/CBuilder5/BibleCS/sword.cpp | 4 +- apps/windoze/CBuilder5/BibleCS/sword.res | Bin 1980 -> 1976 bytes apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp | 126 ++++++++++++++++++-- apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm | 159 ++++++++++++++++++++++++- apps/windoze/CBuilder5/BibleCS/vrslstfrm.h | 29 ++++- 19 files changed, 590 insertions(+), 199 deletions(-) (limited to 'apps/windoze/CBuilder5') diff --git a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm index c8eb0dd..00aeb24 100644 --- a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm +++ b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm @@ -1,6 +1,6 @@ object AboutBox: TAboutBox - Left = 283 - Top = 112 + Left = 256 + Top = 121 BorderStyle = bsDialog Caption = 'About The SWORD Project' ClientHeight = 448 @@ -102,7 +102,7 @@ object AboutBox: TAboutBox Width = 213 Height = 21 AutoSize = False - Caption = 'v1.5.4betaZ' + Caption = 'v1.5.4rc1' IsControl = True end object Copyright: TLabel diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp b/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp index 4c2252f..dbc991f 100644 --- a/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp @@ -35,14 +35,18 @@ __fastcall TPrintForm::TPrintForm(TComponent* Owner) } //--------------------------------------------------------------------------- -void __fastcall TPrintForm::FormShow(TObject *Sender) -{ - + +void __fastcall TPrintForm::FormShow(TObject *Sender) { if(Form1->optionsconf->Sections["Printing"]["Notice"] != "1"){ Application->MessageBox("This release of The Sword Printer is preliminary and is not yet fully functional, therefore some of the features here have been disabled. Please be sure to take a look at the formatting options to be able to fully take control of how your page will look. Also be sure to use the \"Print Preview\" feature to preview how your page(s) will look on paper before printing. Enjoy! From, The Sword Project Development Team!", "The Sword Printer", MB_ICONINFORMATION | MB_OK); Form1->optionsconf->Sections["Printing"]["Notice"] = "1"; Form1->optionsconf->Save(); } +} + +//TODO: fix! :) I added wishlist functionality with parameters that isn't implemented! :) Sorry. +void TPrintForm::print(ListKey *keys, SWModule *module) { + ConfigEntMap::iterator eit; AnsiString fontName; BibleCSMGR *manager = Form1->mainmgr; @@ -53,34 +57,36 @@ void __fastcall TPrintForm::FormShow(TObject *Sender) pc = Form1->CommentaryPageControl; radComm->Checked = true; staticRange->Caption = "Verse Range or List"; - editStart->Text = Form1->DefaultVSKey->getText(); + editStart->Text = (keys) ? keys->getRangeText() : Form1->DefaultVSKey->getText(); } else if ((Form1->ActiveControl == Form1->LexDictPageControl) || (IsChild(Form1->LexDictPageControl->Handle, Form1->ActiveControl->Handle))){ pc = Form1->LexDictPageControl; - radLD->Checked = true; - staticRange->Caption = "Lookup Range"; - editStart->Text = Form1->DictKeyEdit->Text; - } - else{ - pc = Form1->TextPageControl; + radLD->Checked = true; + staticRange->Caption = "Lookup Range"; + editStart->Text = (keys) ? WideString(keys->getRangeText()) : Form1->DictKeyEdit->Text; + } + else { + pc = Form1->TextPageControl; radText->Checked = true; staticRange->Caption = "Verse Range or List"; - editStart->Text = Form1->DefaultVSKey->getText(); - } - FillModuleCombo(); + editStart->Text = (keys) ? keys->getRangeText() : Form1->DefaultVSKey->getText(); + } - AnsiString temp; - for(int count = 0; count < cmbModule->Items->Count; count++){ - temp = cmbModule->Items->Strings[count].SubString(2, cmbModule->Items->Strings[count].Pos("]") - 2); - if(temp == pc->ActivePage->Caption) - cmbModule->ItemIndex = count; - } - SetHint(); + FillModuleCombo(); + + AnsiString temp; + for (int count = 0; count < cmbModule->Items->Count; count++) { + temp = cmbModule->Items->Strings[count].SubString(2, cmbModule->Items->Strings[count].Pos("]") - 2); + if (temp == pc->ActivePage->Caption) + cmbModule->ItemIndex = count; + } + SetHint(); fontName = ((eit = Form1->optionsconf->Sections["PrintPrefs"].find("PrintFontName")) != Form1->optionsconf->Sections["PrintPrefs"].end())? (*eit).second.c_str() : "Times New Roman"; - cmbFont->ItemIndex = cmbFont->Items->IndexOf(fontName); - PageControl1->ActivePage = shtSelection; + cmbFont->ItemIndex = cmbFont->Items->IndexOf(fontName); + PageControl1->ActivePage = shtSelection; SetDefaultOps(); + ShowModal(); } //--------------------------------------------------------------------------- diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm b/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm index 2385ae1..4db9932 100644 --- a/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm +++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm @@ -1,6 +1,6 @@ object PrintForm: TPrintForm - Left = 384 - Top = 205 + Left = 151 + Top = 114 Width = 550 Height = 310 AutoSize = True diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.h b/apps/windoze/CBuilder5/BibleCS/PrintFrm.h index d358e9b..631db3e 100644 --- a/apps/windoze/CBuilder5/BibleCS/PrintFrm.h +++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.h @@ -110,6 +110,7 @@ public: // User declarations void SetHint(); void PrepareRTF(); void SetDefaultOps(); + void print(ListKey *keys = 0, SWModule *module = 0); }; //--------------------------------------------------------------------------- extern PACKAGE TPrintForm *PrintForm; diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp index 94fdf62..b10ed36 100644 --- a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp +++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp @@ -444,6 +444,7 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin } verses->Persist(1); + (*verses) = TOP; SWKey *saveKey = (*module); if (!saveKey->Persist()) saveKey = 0; @@ -451,7 +452,7 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin SWKey *lastKey = 0; bool first = true; - while (!module->Error() && newtext.Length() < 10000 ) { + while (verses->Count() && !module->Error() && newtext.Length() < 10000 ) { SWKey *testKey = verses->GetElement(); VerseKey *element = SWDYNAMIC_CAST(VerseKey, testKey); if (heading) { @@ -467,11 +468,25 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin } } else { + char *buf2 = 0; + stdstr(&buf2, (const char *)*verses); + module->getRawEntry(); + strcpy(buf, module->KeyText()); + int i; + for (i = 0; i < strlen(buf2); i++) { + if (buf[i] != buf2[i]) + break; + } + if (!i || i < (strlen(buf2)/2)) { + delete [] buf2; + verses->Remove(); + continue; + } + delete [] buf2; if (!first) newtext += "\\par\\par "; newtext += RTFHeadingPre; - - strcpy(buf, module->KeyText()); + SWKey *key = *module; // VerseKey locales are not yet UTF8, so don't try to convert them. if (!SWDYNAMIC_CAST(VerseKey, key)) @@ -626,6 +641,7 @@ void TRxRichEditX::getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module /*, c void TRxRichEditX::recalcAppearance() { + static UnicodeRTF filter; char buf[4096]; getDisplayPrefs(&dispAttribs, module /*, type.c_str()*/); @@ -650,10 +666,13 @@ void TRxRichEditX::recalcAppearance() { (int)(fontBase * 8)); RTFTrailer = buf; - const char *chap = _tr("Chapter"); + char chapBuf[1024]; + strcpy(chapBuf, _tr("Chapter")); + filter.ProcessText(chapBuf, 1022, *module, module); + sprintf(buf, "\\pard \\qc\\nowidctlpar{\\f1\\cf7\\fs%d\\b %s ", - (int)(fontBase * 10), chap); + (int)(fontBase * 10), chapBuf); RTFChapterMarkPre = buf; sprintf(buf, diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp index ccbc772..705911d 100644 --- a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp @@ -67,7 +67,7 @@ void __fastcall TForm1::AppMessage(tagMSG &Msg, bool &Handled) result = RegDeleteKey(HKEY_CLASSES_ROOT, "sword\\OpenVerse"); NavigateVerseURL(verStr); Handled = true; - } + } } void TForm1::NavigateVerseURL (char* verStrIN) @@ -92,7 +92,7 @@ void TForm1::NavigateVerseURL (char* verStrIN) } else if (*verStr == '\"') { verSize = 1; - } + } while (verStr[verSize] != 0) { verStr2[verSize2] = verStr[verSize]; @@ -391,6 +391,7 @@ void TForm1::RefreshActiveSheet(TPageControl *pc) if (it != mainmgr->Modules.end()) { SWModule *module = it->second; module->Display(); + pc->Hint = module->Description(); if (logmodstate) modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, module->KeyText())); if (pc == LexDictPageControl) @@ -462,6 +463,8 @@ void TForm1::FillDictKeys() { rtfDisp->recalcAppearance(); lbDictKeys->Font->Name = rtfDisp->dispAttribs.fontName; lbDictKeys->Font->Size = rtfDisp->dispAttribs.fontSize; + lbDictKeys->Color = rtfDisp->dispAttribs.backColor; + lbDictKeys->Font->Color = rtfDisp->dispAttribs.fontColor; DictKeyEdit->Font->Name = rtfDisp->dispAttribs.fontName; DictKeyEdit->Font->Size = rtfDisp->dispAttribs.fontSize; @@ -660,7 +663,6 @@ void TForm1::fillVKeySelector(VerseKey *vk) { void TForm1::i12ize(const char *lang) { LocaleMgr::systemLocaleMgr.setDefaultLocaleName(lang); - // TODO 5 -cConfiguration Ops -oScribe: add mainmgr->configpath, or something, to beginning of these image names ??? const char *tmp; Graphics::TBitmap *bitmap = 0; @@ -704,6 +706,7 @@ void TForm1::i12ize(const char *lang) { Copy2->Caption = _tr("&Copy"); Copy3->Caption = _tr("&Copy"); Copy4->Caption = _tr("&Copy"); + NewVer1->Caption = _tr("&New Verse List"); CopyasBGreekTransliteration1->Caption = _tr("Copy as &B-Greek Transliteration"); MenuItem1->Caption = _tr("Dictionary Lookup"); Copy4->Caption = _tr("&Copy"); @@ -784,7 +787,7 @@ void TForm1::i12ize(const char *lang) { Optionsfrm->AutoLayout->Caption = _tr("Autosave Screen Layout"); Optionsfrm->HintStrongs->Caption = _tr("Show Lexicon Lookup Over Strongs Numbers"); Optionsfrm->HintVLists->Caption = _tr("Show Preview Over Verse Lists"); - Optionsfrm->HintWords->Caption = _tr("Show Glossary Lookup Over Words"); + Optionsfrm->HintWords->Caption = _tr("Show Glossary Lookup Over Words (ALT-W)"); Optionsfrm->OkBtn->Caption = _tr("OK"); Optionsfrm->CancelBtn->Caption = _tr("Cancel"); Optionsfrm->gbDefModules->Caption = _tr("Original Language Support - Default Modules"); @@ -843,14 +846,21 @@ void TForm1::i12ize(const char *lang) { searchForm->resultsLV->Columns->Items[1]->Caption = _tr("Preview..."); searchForm->lblChooseModule->Caption = _tr("Choose Module"); searchForm->Button2->Caption = _tr("&Help"); + searchForm->Button3->Caption = _tr("Create Verse&List From Result"); // VerseSelFrm VerseSelFrm->Caption = _tr("Type Verse"); - VerseSelFrm->OkBtn->Caption = _tr("OkBtn"); + VerseSelFrm->OkBtn->Caption = _tr("OK"); VerseSelFrm->CancelBtn->Caption = _tr("Cancel"); // VerseListFrm - VerseListFrm->Caption = _tr("Verse List"); + VerseListForm->Caption = _tr("Verse List"); + VerseListForm->SpeedButton1->Hint = _tr("Add Current Verse To List"); + VerseListForm->SpeedButton2->Hint = _tr("Remove Highlighted Entry From List"); + VerseListForm->SpeedButton3->Hint = _tr("Copy All Entries To Clipboard"); + VerseListForm->SpeedButton4->Hint = _tr("Print All Entries"); + VerseListForm->SpeedButton5->Hint = _tr("Save Verse List To File"); + VerseListForm->SpeedButton6->Hint = _tr("Load Verse List From File"); // Print Form PrintForm->shtSelection->Caption = _tr("Print Selection"); @@ -1118,14 +1128,6 @@ void __fastcall TForm1::FormShow(TObject *Sender) } } } - 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++) { @@ -1174,6 +1176,16 @@ void __fastcall TForm1::FormShow(TObject *Sender) } refreshAppearance(); + + 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); + } + } @@ -1302,17 +1314,6 @@ void __fastcall TForm1::BackbtnClick(TObject *Sender) logmodstate = true; } //--------------------------------------------------------------------------- -void __fastcall TForm1::Button1Click(TObject *Sender) -{ -/* - list ::iterator it; - ListBox1->Clear(); - for (it = modstates.begin(); it != modstates.end(); it++) { - ListBox1->Items->Add((*it)->ap->Caption.c_str()); - } -*/ -} -//--------------------------------------------------------------------------- void __fastcall TForm1::CopyasBGreekTransliteration1Click(TObject *Sender) { char *retbuf; @@ -1604,7 +1605,7 @@ void __fastcall TForm1::PopupMenuPopup(TObject *Sender) { void __fastcall TForm1::createVerseList(TObject *Sender) { - TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList); + TVerseListForm *tmpForm = new TVerseListForm(this, tmpVerseList); tmpForm->Caption = tmpVerseListCaption; tmpForm->Show(); } @@ -1625,7 +1626,7 @@ void __fastcall TForm1::freeHandLookupoldKeyPress(TObject *Sender, char &Key) freeHandLookup->ItemIndex = 0; if (tmpVerseList.Count() > 1) { - TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList); + TVerseListForm *tmpForm = new TVerseListForm(this, tmpVerseList); tmpForm->Caption = _tr("User Verse List"); tmpForm->Show(); } @@ -1688,7 +1689,9 @@ void __fastcall TForm1::EditEntry1Click(TObject *Sender) void __fastcall TForm1::DeleteEntry1Click(TObject *Sender) { - if (MessageBox(Handle, "Are you sure you wish to delete this entry?", "Delete Entry", MB_YESNO) == IDYES) { + string message = _tr("Are you sure you wish to delete this entry?"); + string header = _tr("Delete Entry"); + if (MessageBox(Handle, message.c_str(), header.c_str(), MB_YESNO) == IDYES) { SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; SWModule *module; ModMap::iterator target; @@ -1964,10 +1967,11 @@ void __fastcall TForm1::InstallManager1Click(TObject *Sender) void TForm1::refreshAppearance() { ModMap::iterator it; + string locale; string tmpval; - tmpval = optionsconf->Sections["Appearance"].getWithDefault("locale", "en_us"); - i12ize(tmpval.c_str()); + locale = optionsconf->Sections["Appearance"].getWithDefault("locale", "en_us"); + i12ize(locale.c_str()); // Change the panels attributes here for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) { @@ -1990,7 +1994,7 @@ void TForm1::refreshAppearance() { DictKeyEdit->Color = fieldColor; Form1->ShowHint = (optionsconf->Sections["Hints"].getWithDefault("Hints", "true") != "false"); - DefaultVSKey->setLocale(tmpval.c_str()); + DefaultVSKey->setLocale(locale.c_str()); fillVKeySelector(DefaultVSKey); TextKeyChanged(); RefreshActiveSheet(LexDictPageControl); @@ -2023,6 +2027,23 @@ void __fastcall TForm1::ApplicationEvents1ShowHint(AnsiString &HintStr, if (HintInfo.HintControl == searchForm->resultsLV) { HintStr = ""; } + if ((HintInfo.HintControl == TextPageControl) || + (HintInfo.HintControl == CommentaryPageControl) || + (HintInfo.HintControl == LexDictPageControl)) { + TPageControl *pc = (TPageControl *)HintInfo.HintControl; + TPoint mousePoint = pc->ScreenToClient(Mouse->CursorPos); + int tab = pc->IndexOfTabAt(mousePoint.x, mousePoint.y); + if (tab >=0) { + TTabSheet *ts = pc->Pages[tab]; + SWModule *module = mainmgr->Modules[ts->Caption.c_str()]; + if (module) { + HintStr = module->Description(); + HintInfo.CursorRect = TRect(TPoint(mousePoint.x-7, mousePoint.y-7), TPoint(mousePoint.x+7, mousePoint.y+7)); + } + } + return; + } + if ((strncmp(HintInfo.HintControl->Name.c_str(), "TextRTF", 7)) && (strncmp(HintInfo.HintControl->Name.c_str(), "CommentRTF", 10)) && (strncmp(HintInfo.HintControl->Name.c_str(), "LexDictRTF", 10))) { @@ -2194,7 +2215,7 @@ void __fastcall TForm1::ApplicationEvents1ShowHint(AnsiString &HintStr, ListKey key; key << WideStringToUTF8(targetWord).c_str(); RTFHintForm->rtfDrawer->fillWithVerses(defMod, &key, true, false, "Popup"); - HintStr = "show rtf"; + HintStr = (key.Count()) ? "show rtf" : ""; break; } } @@ -2387,7 +2408,7 @@ bool __fastcall TRTFHintWindow::IsHintMsg(tagMSG& Msg) void __fastcall TForm1::Print1Click(TObject *Sender) { - PrintForm->ShowModal(); + PrintForm->print(); } //--------------------------------------------------------------------------- @@ -2502,3 +2523,20 @@ void TForm1::ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags) { SetWindowPos(hwnd, NULL, rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); } + +void __fastcall TForm1::Action1Execute(TObject *Sender) +{ + bool hintWords = (optionsconf->Sections["Hints"].getWithDefault("Words", "false") == "true"); + optionsconf->Sections["Hints"]["Words"] = (!hintWords) ? "true" : "false"; +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::NewVer1Click(TObject *Sender) +{ + ListKey verses; + TVerseListForm *tmpForm = new TVerseListForm(this, verses); + tmpForm->Caption = _tr("User Verse List"); + tmpForm->Show(); +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm b/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm index 0688f42..41f747c 100644 --- a/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm +++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm @@ -1,5 +1,5 @@ object Form1: TForm1 - Left = 412 + Left = 451 Top = 100 Width = 686 Height = 510 @@ -538,6 +538,10 @@ object Form1: TForm1 Top = 4 object File1: TMenuItem Caption = '&File' + object NewVer1: TMenuItem + Caption = '&New Verse List' + OnClick = NewVer1Click + end object SaveLayout1: TMenuItem Caption = 'S&ave Layout' OnClick = SaveLayout1Click @@ -735,4 +739,13 @@ object Form1: TForm1 Left = 547 Top = 19 end + object ActionList1: TActionList + Left = 621 + Top = 118 + object Action1: TAction + Caption = 'Action1' + ShortCut = 16471 + OnExecute = Action1Execute + end + end end diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.h b/apps/windoze/CBuilder5/BibleCS/mainfrm.h index 725d345..0b2c342 100644 --- a/apps/windoze/CBuilder5/BibleCS/mainfrm.h +++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.h @@ -36,6 +36,7 @@ #include "SHDocVw_OCX.h" #include #include +#include #ifndef USEOLDRTF #include "RxRichEdit.hpp" @@ -264,6 +265,9 @@ __published: // IDE-managed Components TMenuItem *SearchForWord1; TMenuItem *SearchForWord2; TMenuItem *SearchForWord3; + TActionList *ActionList1; + TAction *Action1; + TMenuItem *NewVer1; void __fastcall TextPageControlChange(TObject *Sender); void __fastcall btnLookupClick(TObject *Sender); void __fastcall CommentaryPageControlChange(TObject *Sender); @@ -290,7 +294,6 @@ __published: // IDE-managed Components void __fastcall BackbtnClick(TObject *Sender); - void __fastcall Button1Click(TObject *Sender); void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender); void __fastcall Copy1Click(TObject *Sender); @@ -337,6 +340,8 @@ __published: // IDE-managed Components bool &CanShow, THintInfo &HintInfo); void __fastcall Print1Click(TObject *Sender); void __fastcall SearchForWord1Click(TObject *Sender); + void __fastcall Action1Execute(TObject *Sender); + void __fastcall NewVer1Click(TObject *Sender); private: // User declarations list displays; // so we can delete each display we create list modstates; diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp index 6fc16da..aaaae46 100644 --- a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp @@ -368,8 +368,8 @@ void __fastcall TOptionsfrm::ExportClick(TObject *Sender) void __fastcall TOptionsfrm::ImportClick(TObject *Sender) { AnsiString newFileName; - AnsiString exName, newPath; - AnsiString subdir = ExtractFilePath(Application->ExeName) + COLOR_DIR; + AnsiString exName, newPath; + AnsiString subdir = ExtractFilePath(Application->ExeName) + COLOR_DIR; if(OpenSchDlg->Execute()){ exName = OpenSchDlg->FileName.c_str(); newFileName = ExtractFileName(exName); @@ -846,3 +846,4 @@ void __fastcall TOptionsfrm::shpNumClrMouseDown(TObject *Sender, + diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm b/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm index 4a65636..920be7e 100644 --- a/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm @@ -4,7 +4,7 @@ object Optionsfrm: TOptionsfrm BorderStyle = bsDialog Caption = 'Preferences' ClientHeight = 325 - ClientWidth = 527 + ClientWidth = 554 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -46,13 +46,13 @@ object Optionsfrm: TOptionsfrm object Panel2: TPanel Left = 0 Top = 284 - Width = 527 + Width = 554 Height = 41 Align = alBottom BevelOuter = bvNone TabOrder = 0 object OkBtn: TBitBtn - Left = 334 + Left = 361 Top = 9 Width = 89 Height = 25 @@ -61,7 +61,7 @@ object Optionsfrm: TOptionsfrm Kind = bkOK end object CancelBtn: TBitBtn - Left = 432 + Left = 459 Top = 9 Width = 89 Height = 25 @@ -73,7 +73,7 @@ object Optionsfrm: TOptionsfrm object PageControl1: TPageControl Left = 0 Top = 0 - Width = 527 + Width = 554 Height = 284 ActivePage = TabSheet1 Align = alClient @@ -83,7 +83,7 @@ object Optionsfrm: TOptionsfrm object Panel1: TPanel Left = 0 Top = 0 - Width = 519 + Width = 546 Height = 163 Align = alTop BevelOuter = bvNone @@ -91,7 +91,7 @@ object Optionsfrm: TOptionsfrm object gbPersonalize: TGroupBox Left = 0 Top = 0 - Width = 519 + Width = 546 Height = 163 Align = alClient Caption = 'Personalize' @@ -99,8 +99,9 @@ object Optionsfrm: TOptionsfrm object Label4: TLabel Left = 7 Top = 103 - Width = 48 - Height = 13 + Width = 82 + Height = 18 + AutoSize = False Caption = 'Language' end object AutoBMPersonal: TCheckBox @@ -123,9 +124,9 @@ object Optionsfrm: TOptionsfrm TabOrder = 1 end object HintPopups: TCheckBox - Left = 248 + Left = 232 Top = 12 - Width = 245 + Width = 305 Height = 13 Hint = 'Shows the hint boxes when you mouseover a'#13#10'panel giving a brief ' + @@ -149,7 +150,7 @@ object Optionsfrm: TOptionsfrm object AutoLayout: TCheckBox Left = 7 Top = 55 - Width = 206 + Width = 233 Height = 17 Hint = 'Saves the screen layout when the program exits' Anchors = [akLeft, akTop, akRight] @@ -157,26 +158,26 @@ object Optionsfrm: TOptionsfrm TabOrder = 4 end object HintStrongs: TCheckBox - Left = 268 + Left = 252 Top = 29 - Width = 241 + Width = 289 Height = 17 Anchors = [akLeft, akTop, akRight] Caption = 'Show Lexicon Lookup Over Strongs Numbers' TabOrder = 5 end object HintWords: TCheckBox - Left = 268 + Left = 252 Top = 68 - Width = 241 + Width = 285 Height = 17 - Caption = 'Show Glossary Lookup Over Words' + Caption = 'Show Glossary Lookup Over Words (CTRL-W)' TabOrder = 6 end object HintVLists: TCheckBox - Left = 268 + Left = 252 Top = 48 - Width = 241 + Width = 285 Height = 17 Caption = 'Show Preview Over Verse Lists' TabOrder = 7 @@ -190,7 +191,7 @@ object Optionsfrm: TOptionsfrm object gbDefModules: TGroupBox Left = 0 Top = 0 - Width = 519 + Width = 546 Height = 105 Align = alTop Caption = 'Original Language Support - Default Modules' @@ -217,7 +218,7 @@ object Optionsfrm: TOptionsfrm Caption = 'Definitions' end object Label8: TLabel - Left = 271 + Left = 307 Top = 16 Width = 35 Height = 13 @@ -226,60 +227,61 @@ object Optionsfrm: TOptionsfrm object Label10: TLabel Left = 7 Top = 81 - Width = 114 - Height = 13 + Width = 166 + Height = 20 + AutoSize = False Caption = 'Strong'#39's Numbered Text' end object hebrewDefCB: TComboBox Left = 75 Top = 55 - Width = 190 + Width = 225 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 0 end object greekDefCB: TComboBox Left = 75 Top = 33 - Width = 190 + Width = 225 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 1 end object greekParseCB: TComboBox - Left = 271 + Left = 307 Top = 33 - Width = 190 + Width = 225 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 end object hebrewParseCB: TComboBox - Left = 271 + Left = 307 Top = 55 - Width = 190 + Width = 225 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 3 end object strongsNumsCB: TComboBox - Left = 154 + Left = 178 Top = 78 - Width = 190 + Width = 225 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 4 end end object gbDevos: TGroupBox Left = 0 Top = 105 - Width = 277 + Width = 281 Height = 151 Align = alLeft Anchors = [akLeft, akTop, akRight, akBottom] @@ -296,16 +298,16 @@ object Optionsfrm: TOptionsfrm object dailyDefaultCB: TComboBox Left = 8 Top = 42 - Width = 257 + Width = 265 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 0 end object devSplashCB: TCheckBox Left = 8 Top = 72 - Width = 259 + Width = 263 Height = 21 Anchors = [akLeft, akTop, akRight] Caption = 'Show Devotional Splash Screen on Startup' @@ -314,7 +316,7 @@ object Optionsfrm: TOptionsfrm object devsAsDictsCB: TCheckBox Left = 8 Top = 88 - Width = 259 + Width = 263 Height = 22 Anchors = [akLeft, akTop, akRight] Caption = 'Show Devotionals as Dictionaries' @@ -322,9 +324,9 @@ object Optionsfrm: TOptionsfrm end end object gbGloss: TGroupBox - Left = 280 + Left = 284 Top = 105 - Width = 239 + Width = 262 Height = 151 Align = alRight Caption = 'Glossaries / General Dictionaries' @@ -348,10 +350,10 @@ object Optionsfrm: TOptionsfrm object genDictCB: TComboBox Left = 8 Top = 42 - Width = 225 + Width = 245 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 1 end end @@ -362,7 +364,7 @@ object Optionsfrm: TOptionsfrm object Panel3: TPanel Left = 0 Top = 0 - Width = 519 + Width = 546 Height = 256 Align = alClient Anchors = [akLeft, akTop, akRight] @@ -372,7 +374,7 @@ object Optionsfrm: TOptionsfrm object gbColors: TGroupBox Left = 0 Top = 0 - Width = 519 + Width = 546 Height = 256 Align = alClient Caption = 'Display Colors' @@ -406,7 +408,7 @@ object Optionsfrm: TOptionsfrm Caption = 'Entry Number Color' end object shpCurrVSClr: TShape - Left = 387 + Left = 414 Top = 114 Width = 20 Height = 16 @@ -429,7 +431,7 @@ object Optionsfrm: TOptionsfrm Caption = 'Combo/Edit Fields' end object btnSave: TSpeedButton - Left = 487 + Left = 514 Top = 27 Width = 22 Height = 22 @@ -470,7 +472,7 @@ object Optionsfrm: TOptionsfrm Caption = 'Strong'#39's Tense (...)' end object shpStrongClr: TShape - Left = 387 + Left = 414 Top = 172 Width = 20 Height = 16 @@ -479,7 +481,7 @@ object Optionsfrm: TOptionsfrm OnMouseDown = shpStrongClrMouseDown end object shpMorphClr: TShape - Left = 387 + Left = 414 Top = 201 Width = 20 Height = 16 @@ -488,7 +490,7 @@ object Optionsfrm: TOptionsfrm OnMouseDown = shpMorphClrMouseDown end object shpFieldClr: TShape - Left = 387 + Left = 414 Top = 143 Width = 20 Height = 16 @@ -497,7 +499,7 @@ object Optionsfrm: TOptionsfrm OnMouseDown = shpFieldClrMouseDown end object shpNumClr: TShape - Left = 387 + Left = 414 Top = 85 Width = 20 Height = 16 @@ -506,7 +508,7 @@ object Optionsfrm: TOptionsfrm OnMouseDown = shpNumClrMouseDown end object btnCurrVerse: TButton - Left = 417 + Left = 444 Top = 111 Width = 96 Height = 25 @@ -543,7 +545,7 @@ object Optionsfrm: TOptionsfrm 'Search Results') end object btnFont: TButton - Left = 417 + Left = 444 Top = 54 Width = 96 Height = 25 @@ -564,7 +566,7 @@ object Optionsfrm: TOptionsfrm TabOrder = 3 end object btnNumClr: TButton - Left = 417 + Left = 444 Top = 82 Width = 96 Height = 25 @@ -588,7 +590,7 @@ object Optionsfrm: TOptionsfrm 'Midnight') end object btnFieldClr: TButton - Left = 417 + Left = 444 Top = 140 Width = 96 Height = 25 @@ -598,7 +600,7 @@ object Optionsfrm: TOptionsfrm OnClick = btnFieldClrClick end object btnModFonts: TButton - Left = 417 + Left = 444 Top = 227 Width = 96 Height = 25 @@ -608,7 +610,7 @@ object Optionsfrm: TOptionsfrm OnClick = btnModFontsClick end object btnStrongClr: TButton - Left = 417 + Left = 444 Top = 169 Width = 96 Height = 25 @@ -619,7 +621,7 @@ object Optionsfrm: TOptionsfrm OnClick = btnStrongClrClick end object btnMorphClr: TButton - Left = 417 + Left = 444 Top = 198 Width = 96 Height = 25 diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp index da4b957..7082ed7 100644 --- a/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp @@ -11,6 +11,7 @@ #include #include "rtfhintfrm.h" #include +#include "vrslstfrm.h" //--------------------------------------------------------------------------- #pragma resource "*.dfm" @@ -412,3 +413,18 @@ void __fastcall TsearchForm::Button2Click(TObject *Sender) } //--------------------------------------------------------------------------- +void __fastcall TsearchForm::Button3Click(TObject *Sender) +{ + if (resultsLV->Items->Count > 0) { + ListKey tmpVerseList; + for (int i = 0; i < resultsLV->Items->Count; i++) { + tmpVerseList << resultsLV->Items->Item[i]->Caption.c_str(); + } + TVerseListForm *tmpForm = new TVerseListForm(this, tmpVerseList); + tmpForm->Caption = _tr("Search Verse List"); + tmpForm->Show(); + } + +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm b/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm index c3b607f..8c15b6b 100644 --- a/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm +++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm @@ -1,8 +1,8 @@ object searchForm: TsearchForm Left = 332 Top = 103 - Width = 494 - Height = 474 + Width = 491 + Height = 475 Caption = 'Search...' Color = clBtnFace Constraints.MinHeight = 360 @@ -48,7 +48,7 @@ object searchForm: TsearchForm Left = 101 Top = 0 Width = 5 - Height = 431 + Height = 432 Cursor = crHSplit Visible = False end @@ -56,7 +56,7 @@ object searchForm: TsearchForm Left = 0 Top = 0 Width = 101 - Height = 431 + Height = 432 Align = alLeft TabOrder = 0 Visible = False @@ -80,7 +80,7 @@ object searchForm: TsearchForm Left = 1 Top = 25 Width = 99 - Height = 405 + Height = 406 Align = alClient Indent = 19 TabOrder = 1 @@ -90,23 +90,23 @@ object searchForm: TsearchForm object Panel7: TPanel Left = 106 Top = 0 - Width = 380 - Height = 431 + Width = 377 + Height = 432 Align = alClient BevelOuter = bvNone Caption = 'Panel7' TabOrder = 1 object pnlResult: TPanel Left = 0 - Top = 204 - Width = 380 + Top = 205 + Width = 377 Height = 227 Align = alClient TabOrder = 0 object Splitter1: TSplitter Left = 1 - Top = 108 - Width = 378 + Top = 135 + Width = 375 Height = 5 Cursor = crVSplit Align = alBottom @@ -114,17 +114,17 @@ object searchForm: TsearchForm end object plPreview: TPanel Left = 1 - Top = 113 - Width = 378 - Height = 113 + Top = 140 + Width = 375 + Height = 86 Align = alBottom TabOrder = 0 end object resultsLV: TListView Left = 1 - Top = 1 - Width = 378 - Height = 107 + Top = 29 + Width = 375 + Height = 106 Hint = 'false' Align = alClient Columns = < @@ -157,19 +157,37 @@ object searchForm: TsearchForm OnDblClick = ListBox1DblClick OnInfoTip = resultsLVInfoTip end + object Panel13: TPanel + Left = 1 + Top = 1 + Width = 375 + Height = 28 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Button3: TButton + Left = 4 + Top = 4 + Width = 217 + Height = 21 + Caption = 'Create Verse&List From Result' + TabOrder = 0 + OnClick = Button3Click + end + end end object Panel1: TPanel Left = 0 Top = 0 - Width = 380 - Height = 132 + Width = 377 + Height = 133 Align = alTop BevelOuter = bvNone TabOrder = 1 object Panel3: TPanel Left = 0 Top = 0 - Width = 380 + Width = 377 Height = 33 Align = alTop BevelOuter = bvNone @@ -178,7 +196,7 @@ object searchForm: TsearchForm object SearchTextOld: TComboBox Left = 0 Top = 2 - Width = 378 + Width = 375 Height = 21 Anchors = [akLeft, akTop, akRight] ItemHeight = 13 @@ -188,7 +206,7 @@ object searchForm: TsearchForm object Panel8: TPanel Left = 0 Top = 33 - Width = 380 + Width = 377 Height = 29 Align = alTop BevelOuter = bvNone @@ -196,7 +214,7 @@ object searchForm: TsearchForm object moduleName: TLabel Left = 28 Top = 0 - Width = 352 + Width = 349 Height = 29 Align = alClient AutoSize = False @@ -225,8 +243,8 @@ object searchForm: TsearchForm object Panel10: TPanel Left = 0 Top = 62 - Width = 380 - Height = 70 + Width = 377 + Height = 71 Align = alClient BevelOuter = bvNone TabOrder = 2 @@ -234,7 +252,7 @@ object searchForm: TsearchForm Left = 0 Top = 0 Width = 164 - Height = 70 + Height = 71 Align = alLeft Caption = 'Search Type' ItemIndex = 0 @@ -248,7 +266,7 @@ object searchForm: TsearchForm Left = 164 Top = 0 Width = 132 - Height = 70 + Height = 71 Align = alLeft Caption = 'Search Options' TabOrder = 1 @@ -263,15 +281,15 @@ object searchForm: TsearchForm end end object Panel4: TPanel - Left = 298 + Left = 296 Top = 0 - Width = 82 - Height = 70 + Width = 81 + Height = 71 Align = alRight BevelOuter = bvNone TabOrder = 2 object searchBtn: TButton - Left = 3 + Left = 4 Top = 5 Width = 75 Height = 25 @@ -281,12 +299,11 @@ object searchForm: TsearchForm OnClick = searchBtnClick end object Button2: TButton - Left = 3 - Top = 33 + Left = 4 + Top = 45 Width = 75 Height = 25 Caption = '&Help' - Default = True TabOrder = 1 OnClick = Button2Click end @@ -295,8 +312,8 @@ object searchForm: TsearchForm end object pnlScope: TPanel Left = 0 - Top = 132 - Width = 380 + Top = 133 + Width = 377 Height = 72 Align = alTop BevelOuter = bvNone @@ -304,7 +321,7 @@ object searchForm: TsearchForm object Panel2: TPanel Left = 0 Top = 0 - Width = 380 + Width = 377 Height = 43 Align = alClient BevelOuter = bvNone @@ -312,7 +329,7 @@ object searchForm: TsearchForm object scopeGroup: TRadioGroup Left = 0 Top = 0 - Width = 380 + Width = 377 Height = 43 Align = alClient Caption = 'Scope' @@ -329,14 +346,14 @@ object searchForm: TsearchForm object Panel5: TPanel Left = 0 Top = 43 - Width = 380 + Width = 377 Height = 29 Align = alBottom TabOrder = 1 object Panel11: TPanel Left = 165 Top = 1 - Width = 214 + Width = 211 Height = 27 Align = alClient BevelOuter = bvNone @@ -345,7 +362,7 @@ object searchForm: TsearchForm object ComboBox1: TComboBox Left = 4 Top = 4 - Width = 206 + Width = 203 Height = 21 Anchors = [akLeft, akTop, akRight] Enabled = False @@ -377,8 +394,8 @@ object searchForm: TsearchForm end object progressBar: TProgressBar Left = 0 - Top = 431 - Width = 486 + Top = 432 + Width = 483 Height = 16 Align = alBottom Min = 0 diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.h b/apps/windoze/CBuilder5/BibleCS/searchfrm.h index 2b9a8ca..393e2b2 100644 --- a/apps/windoze/CBuilder5/BibleCS/searchfrm.h +++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.h @@ -52,6 +52,8 @@ __published: // IDE-managed Components TComboBox *ComboBox1; TLabel *lblChooseModule; TButton *Button2; + TPanel *Panel13; + TButton *Button3; void __fastcall searchBtnClick(TObject *Sender); void __fastcall TerminateSearch(TObject *Sender); void __fastcall ListBox1DblClick(TObject *Sender); @@ -69,6 +71,7 @@ __published: // IDE-managed Components void __fastcall FormActivate(TObject *Sender); void __fastcall modTreeViewChange(TObject *Sender, TTreeNode *Node); void __fastcall Button2Click(TObject *Sender); + void __fastcall Button3Click(TObject *Sender); private: // User declarations class TSearchThread : public TThread { ListKey results; diff --git a/apps/windoze/CBuilder5/BibleCS/sword.bpr b/apps/windoze/CBuilder5/BibleCS/sword.bpr index f9714bb..bc458e9 100644 --- a/apps/windoze/CBuilder5/BibleCS/sword.bpr +++ b/apps/windoze/CBuilder5/BibleCS/sword.bpr @@ -73,7 +73,7 @@ AutoIncBuild=1 MajorVer=1 MinorVer=5 Release=3 -Build=110 +Build=113 Debug=0 PreRelease=0 Special=0 @@ -85,13 +85,13 @@ CodePage=1252 [Version Info Keys] CompanyName=CrossWire Software & Bible Society FileDescription=Windows 32bit User Interface to The SWORD Project -FileVersion=1.5.3.110 +FileVersion=1.5.3.113 InternalName=biblecs LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License LegalTrademarks= OriginalFilename= ProductName=The SWORD Project -ProductVersion=1.5.4betaZ +ProductVersion=1.5.4rc1 Comments=Seek Him and you will find Him [HistoryLists\hlIncludePath] diff --git a/apps/windoze/CBuilder5/BibleCS/sword.cpp b/apps/windoze/CBuilder5/BibleCS/sword.cpp index cda6edf..a36edd1 100644 --- a/apps/windoze/CBuilder5/BibleCS/sword.cpp +++ b/apps/windoze/CBuilder5/BibleCS/sword.cpp @@ -15,7 +15,7 @@ USEFORM("optionfrm.cpp", Optionsfrm); USEFORM("searchfrm.cpp", searchForm); USEUNIT("biblecsmgr.cpp"); USEFORM("ModInstForm.cpp", ModInstFrm); -USEFORM("vrslstfrm.cpp", VerseListFrm); +USEFORM("vrslstfrm.cpp", VerseListForm); USEFORM("editentryfrm.cpp", EditEntryForm); USEFORM("versesel.cpp", VerseSelFrm); USELIB("swordlib.lib"); @@ -138,7 +138,7 @@ WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, in Application->CreateForm(__classid(TOptionsfrm), &Optionsfrm); Application->CreateForm(__classid(TsearchForm), &searchForm); Application->CreateForm(__classid(TModInstFrm), &ModInstFrm); - Application->CreateForm(__classid(TVerseListFrm), &VerseListFrm); + Application->CreateForm(__classid(TVerseListForm), &VerseListForm); Application->CreateForm(__classid(TEditEntryForm), &EditEntryForm); Application->CreateForm(__classid(TVerseSelFrm), &VerseSelFrm); Application->CreateForm(__classid(TRangeMaintForm), &RangeMaintForm); diff --git a/apps/windoze/CBuilder5/BibleCS/sword.res b/apps/windoze/CBuilder5/BibleCS/sword.res index b149b8c..e96e557 100644 Binary files a/apps/windoze/CBuilder5/BibleCS/sword.res and b/apps/windoze/CBuilder5/BibleCS/sword.res differ diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp index 2af7961..12e5f6a 100644 --- a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp @@ -3,10 +3,14 @@ #pragma hdrstop #include "vrslstfrm.h" +#include "rtfhintfrm.h" +#include "PrintFrm.h" +#include +#include //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" -TVerseListFrm *VerseListFrm; +TVerseListForm *VerseListForm; //--------------------------------------------------------------------------- //TODO: add toolbar @@ -19,9 +23,9 @@ TVerseListFrm *VerseListFrm; //TODO: add new verse list to mainfrm //TODO: add open verse list to mainfrm -__fastcall TVerseListFrm::TVerseListFrm(TComponent* Owner, ListKey &iVerseList) +__fastcall TVerseListForm::TVerseListForm(TComponent* Owner, ListKey &iVerseList) : TForm(Owner), verseList(iVerseList) { - pvrtf = new SWDispRTF(this); + pvrtf = new TRxRichEditX(this); pvrtf->Parent = plPreview; pvrtf->Align = alClient; @@ -30,31 +34,129 @@ __fastcall TVerseListFrm::TVerseListFrm(TComponent* Owner, ListKey &iVerseList) } //--------------------------------------------------------------------------- -void __fastcall TVerseListFrm::ListBox1Click(TObject *Sender) { +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()) { - SWKey *savekey = *(*target).second; - target->second->setKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str()); - pvrtf->Display(*(*target).second); - (*target).second->setKey(*savekey); + ListKey key; + key << ListBox1->Items->Strings[ListBox1->ItemIndex].c_str(); + pvrtf->fillWithVerses(target->second, &key, true, false); } } //--------------------------------------------------------------------------- -void __fastcall TVerseListFrm::ListBox1DblClick(TObject *Sender) +void __fastcall TVerseListForm::ListBox1DblClick(TObject *Sender) { *(Form1->DefaultVSKey) = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str(); Form1->TextKeyChanged(); } //--------------------------------------------------------------------------- -void __fastcall TVerseListFrm::FormShow(TObject *Sender) +void __fastcall TVerseListForm::FormShow(TObject *Sender) { - for (verseList = TOP; (!verseList.Error()); verseList++) - ListBox1->Items->Add((const char *)verseList); + fillWithVerseList(verseList); } //--------------------------------------------------------------------------- +void TVerseListForm::fillWithVerseList(ListKey &verseList) { + ListBox1->Items->Clear(); + for (verseList = TOP; (!verseList.Error()); verseList++) + ListBox1->Items->Add((const char *)verseList); +} + + +void __fastcall TVerseListForm::SpeedButton1Click(TObject *Sender) +{ + ListBox1->Items->Add((const char *)*(Form1->DefaultVSKey)); +} +//--------------------------------------------------------------------------- + +void __fastcall TVerseListForm::SpeedButton2Click(TObject *Sender) +{ + int item = ListBox1->ItemIndex; + if (item >=0) { + ListBox1->Items->Delete(item); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TVerseListForm::SpeedButton3Click(TObject *Sender) +{ + ListKey verses; + for (int i = 0; i < ListBox1->Items->Count; i++) { + verses << ListBox1->Items->Strings[i].c_str(); + } + + TPageControl *targetpc = Form1->TextPageControl; + + if ((Form1->ActiveControl == Form1->CommentaryPageControl) || (IsChild(Form1->CommentaryPageControl->Handle, Form1->ActiveControl->Handle))) + targetpc = Form1->CommentaryPageControl; + if ((Form1->ActiveControl == Form1->LexDictPageControl) || (IsChild(Form1->LexDictPageControl->Handle, Form1->ActiveControl->Handle))) + targetpc = Form1->LexDictPageControl; + + ModMap::iterator it = Form1->mainmgr->Modules.find(targetpc->ActivePage->Caption.c_str()); + if (it != Form1->mainmgr->Modules.end()) { + RTFHintForm->rtfDrawer->fillWithVerses(it->second, &verses, true, true); + RTFHintForm->rtfDrawer->SelectAll(); + RTFHintForm->rtfDrawer->CopyToClipboard(); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TVerseListForm::SpeedButton4Click(TObject *Sender) +{ + ListKey verses; + for (int i = 0; i < ListBox1->Items->Count; i++) { + verses << ListBox1->Items->Strings[i].c_str(); + } + PrintForm->print(&verses); +} +//--------------------------------------------------------------------------- + +void __fastcall TVerseListForm::SpeedButton5Click(TObject *Sender) +{ + if (VLSaveDialog->Execute()) { + if (FileMgr::existsFile(VLSaveDialog->FileName.c_str())) { + string message = _tr("File exists. Overwrite?"); + string header = _tr("Overwrite File"); + if (MessageBox(Handle, message.c_str(), header.c_str(), MB_YESNO) != IDYES) { + return; + } + } + FileDesc *fd; + unlink(VLSaveDialog->FileName.c_str()); + fd = FileMgr::systemFileMgr.open(VLSaveDialog->FileName.c_str(), O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE); + ListKey verses; + for (int i = 0; i < ListBox1->Items->Count; i++) { + verses << ListBox1->Items->Strings[i].c_str(); + } + const char *rangeText = verses.getRangeText(); + write(fd->getFd(), rangeText, strlen(rangeText)); + FileMgr::systemFileMgr.close(fd); + } +} +//--------------------------------------------------------------------------- +void __fastcall TVerseListForm::SpeedButton6Click(TObject *Sender) +{ + if (VLOpenDialog->Execute()) { + if (!FileMgr::existsFile(VLOpenDialog->FileName.c_str())) { + return; + } + FileDesc *fd; + fd = FileMgr::systemFileMgr.open(VLOpenDialog->FileName.c_str(), O_RDONLY|O_BINARY); + ListKey verses; + VerseKey parser; + long size = lseek(fd->getFd(), 0, SEEK_END); + lseek(fd->getFd(), 0, SEEK_SET); + char *buf = new char[size+5]; + memset(buf, 0, size+5); + read(fd->getFd(), buf, size); + FileMgr::systemFileMgr.close(fd); + verses = parser.ParseVerseList(buf, parser, false); + fillWithVerseList(verses); + delete [] buf; + } +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm index ed8fd45..5277e5b 100644 --- a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm +++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm @@ -1,6 +1,6 @@ -object VerseListFrm: TVerseListFrm - Left = 457 - Top = 100 +object VerseListForm: TVerseListForm + Left = 892 + Top = 107 Width = 256 Height = 315 Caption = 'Verse List' @@ -28,13 +28,162 @@ object VerseListFrm: TVerseListFrm end object ListBox1: TListBox Left = 0 - Top = 0 + Top = 25 Width = 248 - Height = 143 + Height = 118 Align = alClient ItemHeight = 13 TabOrder = 1 OnClick = ListBox1Click OnDblClick = ListBox1DblClick end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 248 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object SpeedButton1: TSpeedButton + Left = 64 + Top = 2 + Width = 23 + Height = 22 + Glyph.Data = { + 76010000424D7601000000000000760000002800000020000000100000000100 + 04000000000000010000130B0000130B00001000000000000000000000000000 + 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF0033333333B333 + 333B33FF33337F3333F73BB3777BB7777BB3377FFFF77FFFF77333B000000000 + 0B3333777777777777333330FFFFFFFF07333337F33333337F333330FFFFFFFF + 07333337F33333337F333330FFFFFFFF07333337F33333337F333330FFFFFFFF + 07333FF7F33333337FFFBBB0FFFFFFFF0BB37777F3333333777F3BB0FFFFFFFF + 0BBB3777F3333FFF77773330FFFF000003333337F333777773333330FFFF0FF0 + 33333337F3337F37F3333330FFFF0F0B33333337F3337F77FF333330FFFF003B + B3333337FFFF77377FF333B000000333BB33337777777F3377FF3BB3333BB333 + 3BB33773333773333773B333333B3333333B7333333733333337} + NumGlyphs = 2 + OnClick = SpeedButton1Click + end + object SpeedButton2: TSpeedButton + Left = 88 + Top = 2 + Width = 23 + Height = 22 + Glyph.Data = { + 76010000424D7601000000000000760000002800000020000000100000000100 + 04000000000000010000120B0000120B00001000000000000000000000000000 + 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333000000000 + 3333333777777777F3333330F777777033333337F3F3F3F7F3333330F0808070 + 33333337F7F7F7F7F3333330F080707033333337F7F7F7F7F3333330F0808070 + 33333337F7F7F7F7F3333330F080707033333337F7F7F7F7F3333330F0808070 + 333333F7F7F7F7F7F3F33030F080707030333737F7F7F7F7F7333300F0808070 + 03333377F7F7F7F773333330F080707033333337F7F7F7F7F333333070707070 + 33333337F7F7F7F7FF3333000000000003333377777777777F33330F88877777 + 0333337FFFFFFFFF7F3333000000000003333377777777777333333330777033 + 3333333337FFF7F3333333333000003333333333377777333333} + NumGlyphs = 2 + OnClick = SpeedButton2Click + end + object SpeedButton3: TSpeedButton + Left = 164 + Top = 2 + Width = 23 + Height = 22 + Glyph.Data = { + 76010000424D7601000000000000760000002800000020000000100000000100 + 04000000000000010000130B0000130B00001000000000000000000000000000 + 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF003333330B7FFF + FFB0333333777F3333773333330B7FFFFFB0333333777F3333773333330B7FFF + FFB0333333777F3333773333330B7FFFFFB03FFFFF777FFFFF77000000000077 + 007077777777777777770FFFFFFFF00077B07F33333337FFFF770FFFFFFFF000 + 7BB07F3FF3FFF77FF7770F00F000F00090077F77377737777F770FFFFFFFF039 + 99337F3FFFF3F7F777FF0F0000F0F09999937F7777373777777F0FFFFFFFF999 + 99997F3FF3FFF77777770F00F000003999337F773777773777F30FFFF0FF0339 + 99337F3FF7F3733777F30F08F0F0337999337F7737F73F7777330FFFF0039999 + 93337FFFF7737777733300000033333333337777773333333333} + NumGlyphs = 2 + OnClick = SpeedButton3Click + end + object SpeedButton4: TSpeedButton + Left = 188 + Top = 2 + Width = 23 + Height = 22 + Glyph.Data = { + 76010000424D7601000000000000760000002800000020000000100000000100 + 04000000000000010000130B0000130B00001000000000000000000000000000 + 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00300000000000 + 00033FFFFFFFFFFFFFFF0888888888888880777777777777777F088888888888 + 8880777777777777777F0000000000000000FFFFFFFFFFFFFFFF0F8F8F8F8F8F + 8F80777777777777777F08F8F8F8F8F8F9F0777777777777777F0F8F8F8F8F8F + 8F807777777777777F7F0000000000000000777777777777777F3330FFFFFFFF + 03333337F3FFFF3F7F333330F0000F0F03333337F77773737F333330FFFFFFFF + 03333337F3FF3FFF7F333330F00F000003333337F773777773333330FFFF0FF0 + 33333337F3FF7F3733333330F08F0F0333333337F7737F7333333330FFFF0033 + 33333337FFFF7733333333300000033333333337777773333333} + NumGlyphs = 2 + OnClick = SpeedButton4Click + end + object SpeedButton5: TSpeedButton + Left = 24 + Top = 2 + Width = 23 + Height = 22 + Glyph.Data = { + 76010000424D7601000000000000760000002800000020000000100000000100 + 04000000000000010000120B0000120B00001000000000000000000000000000 + 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333 + 333333FFFFFFFFFFFFF33000077777770033377777777777773F000007888888 + 00037F3337F3FF37F37F00000780088800037F3337F77F37F37F000007800888 + 00037F3337F77FF7F37F00000788888800037F3337777777337F000000000000 + 00037F3FFFFFFFFFFF7F00000000000000037F77777777777F7F000FFFFFFFFF + 00037F7F333333337F7F000FFFFFFFFF00037F7F333333337F7F000FFFFFFFFF + 00037F7F333333337F7F000FFFFFFFFF00037F7F333333337F7F000FFFFFFFFF + 00037F7F333333337F7F000FFFFFFFFF07037F7F33333333777F000FFFFFFFFF + 0003737FFFFFFFFF7F7330099999999900333777777777777733} + NumGlyphs = 2 + OnClick = SpeedButton5Click + end + object SpeedButton6: TSpeedButton + Left = 0 + Top = 2 + Width = 23 + Height = 22 + Glyph.Data = { + 76010000424D7601000000000000760000002800000020000000100000000100 + 04000000000000010000120B0000120B00001000000000000000000000000000 + 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00555555555555 + 5555555555555555555555555555555555555555555555555555555555555555 + 555555555555555555555555555555555555555FFFFFFFFFF555550000000000 + 55555577777777775F55500B8B8B8B8B05555775F555555575F550F0B8B8B8B8 + B05557F75F555555575F50BF0B8B8B8B8B0557F575FFFFFFFF7F50FBF0000000 + 000557F557777777777550BFBFBFBFB0555557F555555557F55550FBFBFBFBF0 + 555557F555555FF7555550BFBFBF00055555575F555577755555550BFBF05555 + 55555575FFF75555555555700007555555555557777555555555555555555555 + 5555555555555555555555555555555555555555555555555555} + NumGlyphs = 2 + OnClick = SpeedButton6Click + end + end + object VLOpenDialog: TOpenDialog + DefaultExt = 'svl' + Filter = 'SWORD Verse Lists|*.SVL' + Title = 'Open Verse List' + Left = 144 + Top = 164 + end + object VLSaveDialog: TSaveDialog + DefaultExt = 'svl' + Filter = 'SWORD Verse Lists|*.SVL' + Title = 'Save Verse List' + Left = 184 + Top = 163 + end end diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h index 7af64b9..1a8471e 100644 --- a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h +++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h @@ -8,22 +8,41 @@ #include #include #include "mainfrm.h" +#include "RxRichEditX.h" +#include +#include //--------------------------------------------------------------------------- -class TVerseListFrm : public TForm +class TVerseListForm : public TForm { __published: // IDE-managed Components TPanel *plPreview; TListBox *ListBox1; + TPanel *Panel1; + TSpeedButton *SpeedButton1; + TSpeedButton *SpeedButton2; + TSpeedButton *SpeedButton3; + TSpeedButton *SpeedButton4; + TSpeedButton *SpeedButton5; + TSpeedButton *SpeedButton6; + TOpenDialog *VLOpenDialog; + TSaveDialog *VLSaveDialog; void __fastcall ListBox1Click(TObject *Sender); void __fastcall ListBox1DblClick(TObject *Sender); void __fastcall FormShow(TObject *Sender); + void __fastcall SpeedButton1Click(TObject *Sender); + void __fastcall SpeedButton2Click(TObject *Sender); + void __fastcall SpeedButton3Click(TObject *Sender); + void __fastcall SpeedButton4Click(TObject *Sender); + void __fastcall SpeedButton5Click(TObject *Sender); + void __fastcall SpeedButton6Click(TObject *Sender); private: // User declarations - SWDispRTF *pvrtf; - ListKey &verseList; + TRxRichEditX *pvrtf; + ListKey verseList; + void fillWithVerseList(ListKey &verseList); public: // User declarations - __fastcall TVerseListFrm(TComponent* Owner, ListKey &iVerseList); + __fastcall TVerseListForm(TComponent* Owner, ListKey &iVerseList); }; //--------------------------------------------------------------------------- -extern PACKAGE TVerseListFrm *VerseListFrm; +extern PACKAGE TVerseListForm *VerseListForm; //--------------------------------------------------------------------------- #endif -- cgit