aboutsummaryrefslogtreecommitdiffstats
path: root/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/windoze/CBuilder5/BibleCS/mainfrm.cpp')
-rw-r--r--apps/windoze/CBuilder5/BibleCS/mainfrm.cpp65
1 files changed, 35 insertions, 30 deletions
diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
index d064133..79fcb8a 100644
--- a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp
@@ -73,34 +73,34 @@ void __fastcall TForm1::AppMessage(tagMSG &Msg, bool &Handled)
void TForm1::NavigateVerseURL (char* verStrIN)
{
- unsigned long verSize = strlen(verStrIN) + 1;
- char * verStr = new char[verSize];
- strcpy (verStr, verStrIN);
- char * verStr2 = new char[verSize];
- unsigned long verSize2 = 0;
- if (*(verStr + verSize - 2) == '\"') {
- *(verStr + verSize - 2) = 0;
- }
+ unsigned long verSize = strlen(verStrIN) + 1;
+ char * verStr = new char[verSize];
+ strcpy (verStr, verStrIN);
+ char * verStr2 = new char[verSize];
+ unsigned long verSize2 = 0;
+ if (*(verStr + verSize - 2) == '\"') {
+ *(verStr + verSize - 2) = 0;
+ }
verSize = 0;
- if (strstr(verStr, "libronix")) {
- char* bib = strstr(verStr, "bible:");
- if (bib) {
- verSize = 6 + (unsigned long)(bib - verStr);
- }
+ if (strstr(verStr, "libronix")) {
+ char* bib = strstr(verStr, "bible:");
+ if (bib) {
+ verSize = 6 + (unsigned long)(bib - verStr);
+ }
+ }
+ else if (strstr(verStr, "sword://")) {
+ verSize = 9;
}
- else if (strstr(verStr, "sword://")) {
- verSize = 9;
- }
else if (*verStr == '\"') {
verSize = 1;
}
- while (verStr[verSize] != 0) {
- verStr2[verSize2] = verStr[verSize];
- verSize++;
- verSize2++;
- }
- verStr2[verSize2] = 0;
+ while (verStr[verSize] != 0) {
+ verStr2[verSize2] = verStr[verSize];
+ verSize++;
+ verSize2++;
+ }
+ verStr2[verSize2] = 0;
char * verse = strstr(verStr2, "/");
if (verse) {
@@ -1045,8 +1045,10 @@ void __fastcall TForm1::FormShow(TObject *Sender)
if ((sit = layoutconf->Sections.find("Screen")) != layoutconf->Sections.end()) {
- if ((eit = (*sit).second.find("MainTop")) != (*sit).second.end())
+ if ((eit = (*sit).second.find("MainTop")) != (*sit).second.end()) {
Form1->Top = atoi((*eit).second.c_str());
+// Form1->Position = poDesigned; // because we've set the values
+ }
if ((eit = (*sit).second.find("MainLeft")) != (*sit).second.end())
Form1->Left = atoi((*eit).second.c_str());
if ((eit = (*sit).second.find("MainHeight")) != (*sit).second.end())
@@ -1183,13 +1185,16 @@ void __fastcall TForm1::FormShow(TObject *Sender)
refreshAppearance();
- if (this->Tag) {
- NavigateVerseURL((char*)(this->Tag));
+ if (startVerse.Length()) {
+ NavigateVerseURL(startVerse.c_str());
}
- else if ((eit = (*sit).second.find("LastVerse")) != (*sit).second.end()) {
- freeHandLookup->Text = (*eit).second.c_str();
- char ret = '\r';
- freeHandLookupoldKeyPress(0, ret);
+ else {
+ startVerse = layoutconf->Sections["History"].getWithDefault("LastVerse", "").c_str();
+ if (startVerse.Length()) {
+ freeHandLookup->Text = startVerse.c_str();
+ char ret = '\r';
+ freeHandLookupoldKeyPress(0, ret);
+ }
}
}
@@ -1898,7 +1903,7 @@ void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
// NS_TermEmbedding();
- if ((*optionsconf)["Layout"]["AutoSaveLayout"] == "1")
+ if ((*optionsconf)["Layout"].getWithDefault("AutoSaveLayout", "1") == "1")
SaveLayout1Click(this);
}
//---------------------------------------------------------------------------