From 77a7a5e60bd9e2f4efc30399b2975dbfd722e781 Mon Sep 17 00:00:00 2001 From: danglassey Date: Tue, 17 Sep 2002 13:01:55 +0000 Subject: sync with crosswire 20020917-1300 --- apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm | 2 +- apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp | 8 +++ apps/windoze/CBuilder5/BibleCS/mainfrm.cpp | 7 +- apps/windoze/CBuilder5/BibleCS/sword.bpr | 8 +-- apps/windoze/CBuilder5/BibleCS/sword.cpp | 80 +++++++++++++++-------- apps/windoze/CBuilder5/BibleCS/sword.res | Bin 1976 -> 1968 bytes apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr | 29 ++++---- apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp | 3 + apps/windoze/swdisprtf.cpp | 17 ++++- 9 files changed, 105 insertions(+), 49 deletions(-) diff --git a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm index d79b09f..b301641 100644 --- a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm +++ b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm @@ -102,7 +102,7 @@ object AboutBox: TAboutBox Width = 213 Height = 21 AutoSize = False - Caption = 'v1.5.4rc5' + Caption = 'v1.5.4' IsControl = True end object Copyright: TLabel diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp index f42ffb1..a304b10 100644 --- a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp +++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp @@ -591,10 +591,18 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin this->SelAttributes->Link = true; } if (Visible) { + TComponent *owner = this->Owner; + TForm *parentForm = dynamic_cast(owner); + TWinControl *focus = 0; + + if (parentForm) + focus = parentForm->ActiveControl; this->SetFocus(); SelStart = 0; SelLength = 0; SendMessage(Handle, EM_SCROLLCARET, 0, 0); + if (focus) + focus->SetFocus(); } Repaint(); diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp index 3d7aec6..244c406 100644 --- a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp +++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp @@ -54,8 +54,7 @@ inline AnsiString& operator=(AnsiString& dest, const string& src) { void __fastcall TForm1::AppMessage(tagMSG &Msg, bool &Handled) { - if (Msg.message == WM_VERSE) - { + if (Msg.message == WM_VERSE) { HKEY hkey; LONG result; unsigned long verSize = 32; @@ -67,6 +66,8 @@ void __fastcall TForm1::AppMessage(tagMSG &Msg, bool &Handled) result = RegDeleteKey(HKEY_CLASSES_ROOT, "sword\\OpenVerse"); NavigateVerseURL(verStr); Handled = true; + Form1->Show(); + ::SetForegroundWindow(this->Handle); } } @@ -1493,7 +1494,7 @@ void __fastcall TForm1::FormCreate(TObject *Sender) // rv = NS_InitEmbedding(nsnull, nsnull); Application->OnMessage = AppMessage; - Application->Title = "The SWORD Project for Windows"; + Application->Title = "The SWORD Project"; } diff --git a/apps/windoze/CBuilder5/BibleCS/sword.bpr b/apps/windoze/CBuilder5/BibleCS/sword.bpr index 3fc3a45..d9468d8 100644 --- a/apps/windoze/CBuilder5/BibleCS/sword.bpr +++ b/apps/windoze/CBuilder5/BibleCS/sword.bpr @@ -72,8 +72,8 @@ IncludeVerInfo=1 AutoIncBuild=1 MajorVer=1 MinorVer=5 -Release=3 -Build=119 +Release=4 +Build=121 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.119 +FileVersion=1.5.4.121 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.4rc5 +ProductVersion=1.5.4 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 6bc578e..0bdf69a 100644 --- a/apps/windoze/CBuilder5/BibleCS/sword.cpp +++ b/apps/windoze/CBuilder5/BibleCS/sword.cpp @@ -5,6 +5,7 @@ #include #include #include "sword.h" +#include USERES("sword.res"); USEFORM("mainfrm.cpp", Form1); @@ -55,17 +56,41 @@ WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, in try { HKEY hkey; HWND otherInst; + ThMLPlain filter; // see if there's a previous instance running - otherInst = ::FindWindow(NULL, "The SWORD Project for Windows"); + otherInst = ::FindWindow(NULL, "The SWORD Project"); // if so, and we have an argument, send the argument to the other instance if (*lpCmdLine) { - if (otherInst && *lpCmdLine) { + int len = (strlen(lpCmdLine) + 1) * 5; + char *buf = new char [len + 1]; + strcpy(buf, lpCmdLine); +// filter.ProcessText(buf, len); + while (true) { + char *change = strstr(buf, "%20"); + if (change) { + change[0] = ' '; + change[1] = ' '; + change[2] = ' '; + } + else { + change = strstr(buf, "%3A"); + if (change) { + change[0] = ' '; + change[1] = ':'; + change[2] = ' '; + } + else break; + } + } + + if (otherInst != NULL) { result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\OpenVerse", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); - result = RegSetValueEx(hkey, NULL, 0, REG_SZ, lpCmdLine, strlen(lpCmdLine) + 1); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, buf, strlen(buf) + 1); result = RegCloseKey(hkey); PostMessage(otherInst, WM_VERSE, NULL, NULL); + delete [] buf; return 0; } @@ -78,6 +103,7 @@ WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, in } chdir(dir); delete [] dir; + delete [] buf; } // adjust the registry for our private protocol using the current path @@ -97,31 +123,31 @@ WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, in /* // don't override Logos' setting if it exists result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "libronixdls", 0, KEY_READ | KEY_WRITE, &hkey); - if (!result) { - char* libStr = new char[32]; - unsigned long libSize = 32; - result = RegQueryValueEx(hkey, NULL, NULL, NULL, libStr, &libSize); - if (!result) { - if (strstr(libStr, "SWORD")) { - result = 1; - } - } - } - if (result) { - result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); - result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1); - result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1); - result = RegCloseKey(hkey); - result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); - result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1); - result = RegCloseKey(hkey); - AnsiString opencommand = Application->ExeName + " \"%1\""; - result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); - result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1); - result = RegCloseKey(hkey); - } + if (!result) { + char* libStr = new char[32]; + unsigned long libSize = 32; + result = RegQueryValueEx(hkey, NULL, NULL, NULL, libStr, &libSize); + if (!result) { + if (strstr(libStr, "SWORD")) { + result = 1; + } + } + } + if (result) { + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1); + result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1); + result = RegCloseKey(hkey); + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1); + result = RegCloseKey(hkey); + AnsiString opencommand = Application->ExeName + " \"%1\""; + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1); + result = RegCloseKey(hkey); + } */ - } + } catch (Exception &exception) { Application->ShowException(&exception); } diff --git a/apps/windoze/CBuilder5/BibleCS/sword.res b/apps/windoze/CBuilder5/BibleCS/sword.res index c2d0916..935ce20 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/InstallMgr/InstallMgr.bpr b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr index 1b2a792..e6ef0c5 100644 --- a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr @@ -12,7 +12,10 @@ - + - + @@ -37,12 +40,12 @@ - - + + - - + + @@ -100,12 +103,12 @@ Item0=$(BCB)\source\vcl [HistoryLists\hlConditionals] Count=8 -Item0=VCL -Item1=VCL;__STDC__ true -Item2=VCL;__STDC__ -Item3=VCL;_MSC_VER -Item4=VCL __STDC__ -Item5=VCL;_DEBUG +Item0=VCL;_DEBUG +Item1=VCL +Item2=VCL;__STDC__ true +Item3=VCL;__STDC__ +Item4=VCL;_MSC_VER +Item5=VCL __STDC__ Item6=_DEBUG;VCL Item7=_DEBUG diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp index a269603..ce79815 100644 --- a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp @@ -12,6 +12,9 @@ USELIB("zlib.lib"); USELIB("..\..\..\..\lib\swordlib.lib"); USELIB("libcurl.lib"); USELIB("curl\lib\ws2_32.lib"); +USELIB("..\..\..\..\..\icu-sword\as_is\borland\icui18n.lib"); +USELIB("..\..\..\..\..\icu-sword\as_is\borland\icudatab.lib"); +USELIB("..\..\..\..\..\icu-sword\as_is\borland\icucommon.lib"); //--------------------------------------------------------------------------- WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { diff --git a/apps/windoze/swdisprtf.cpp b/apps/windoze/swdisprtf.cpp index f999301..64429f3 100644 --- a/apps/windoze/swdisprtf.cpp +++ b/apps/windoze/swdisprtf.cpp @@ -104,8 +104,23 @@ char SWDispRTF::Display(SWModule &Module) { this->SelAttributes->Link = true; } //{ Position control text at current verse } - this->SetFocus(); SelStart = 0; +/* + if (Visible) { + TComponent *owner = this->Owner; + TForm *parentForm = dynamic_cast(owner); + TWinControl *focus = 0; + + if (parentForm) + focus = parentForm->ActiveControl; + this->SetFocus(); + SelStart = 0; + SelLength = 0; + SendMessage(Handle, EM_SCROLLCARET, 0, 0); + if (focus) + focus->SetFocus(); + } +*/ SelLength = 0; SendMessage(Handle, EM_SCROLLCARET, 0, 0); -- cgit