diff options
Diffstat (limited to 'apps/windoze/CBuilder5/BibleCS')
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm | 2 | ||||
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp | 8 | ||||
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/mainfrm.cpp | 7 | ||||
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/sword.bpr | 8 | ||||
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/sword.cpp | 80 | ||||
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/sword.res | bin | 1976 -> 1968 bytes |
6 files changed, 70 insertions, 35 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<TForm *>(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 <winreg.h> #include <dir.h> #include "sword.h" +#include <thmlplain.h> 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 Binary files differindex c2d0916..935ce20 100644 --- a/apps/windoze/CBuilder5/BibleCS/sword.res +++ b/apps/windoze/CBuilder5/BibleCS/sword.res |