[sword-cvs] swordreader/src/gui Main.cpp,1.3,1.4 Navigator.cpp,1.3,1.4 Navigator.h,1.3,1.4 SwordIndex.cpp,1.6,1.7 SwordIndex.h,1.3,1.4 gui.vcl,1.13,1.14

sword@www.crosswire.org sword@www.crosswire.org
Wed, 28 Jan 2004 23:47:58 -0700


Update of /cvs/core/swordreader/src/gui
In directory www:/tmp/cvs-serv712/src/gui

Modified Files:
	Main.cpp Navigator.cpp Navigator.h SwordIndex.cpp SwordIndex.h 
	gui.vcl 
Log Message:
Added basic support for showing footnotes, strongs, and morph in a simple message box

Index: Main.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/Main.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Main.cpp	24 Jan 2004 22:29:59 -0000	1.3
+++ Main.cpp	29 Jan 2004 06:47:55 -0000	1.4
@@ -3,6 +3,7 @@
 #include "Navigator.h"
 
 #include <aygshell.h>
+#include <htmlctrl.h>
 
 Navigator* g_navigator;
 static SHACTIVATEINFO s_sai;
@@ -119,9 +120,17 @@
 {
 	int wmId, wmEvent;
 	PAINTSTRUCT ps;
+	NMHDR *nm;
 
 	switch (message) 
 	{
+		case WM_NOTIFY:
+			nm = (NMHDR *)lParam;
+			switch (nm->code) {
+			case NM_HOTSPOT:
+				g_navigator->urlClicked(((NM_HTMLVIEW *)lParam)->szTarget);
+			}
+		break;
 		case WM_LBUTTONDOWN:
 			g_navigator->mouseDown(LOWORD(lParam),HIWORD(lParam));//x,y
 			break;
@@ -129,6 +138,8 @@
 /*		case WM_HOTKEY:
 */			g_navigator->keyDown(wParam, lParam);
 			break;
+
+		
 		case WM_COMMAND:
 			wmId    = LOWORD(wParam); 
 			wmEvent = HIWORD(wParam); 

Index: Navigator.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/Navigator.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Navigator.cpp	24 Jan 2004 22:29:59 -0000	1.3
+++ Navigator.cpp	29 Jan 2004 06:47:55 -0000	1.4
@@ -237,4 +237,60 @@
 			checkMenu(menuOptions, i, (val == "On"));
 		}
 	}
-}
\ No newline at end of file
+}
+
+void Navigator::urlClicked(const WCHAR *target) {
+	const char * t = wstrtostr(target);
+	if (strstr(t, "type=morph")) {
+		const char *val = strstr(t, "value=");
+		if ((val) && (strlen(val) > 6)) {
+			val += 6;
+			SWModule *mod = (position.verse->Testament() == 1) ? position.hebrewMorph : position.greekMorph;
+			if (mod) {
+				mod->SetKey(val);
+				MessageBox(0, strtowstr(mod->StripText()), L"Morphology", MB_OK);
+			}
+		}
+	}
+	else if (strstr(t, "type=Strongs")) {
+		const char *val = strstr(t, "value=G");
+		if ((val) && (strlen(val) > 7)) {
+			val += 7;
+			if (position.greekLex) {
+				position.greekLex->SetKey(val);
+				MessageBox(0, strtowstr(position.greekLex->StripText()), L"Greek Strong's", MB_OK);
+			}
+		}
+		val = strstr(t, "value=H");
+		if ((val) && (strlen(val) > 7)) {
+			val += 7;
+			if (position.hebrewLex) {
+				position.hebrewLex->SetKey(val);
+				MessageBox(0, strtowstr(position.hebrewLex->StripText()), L"Hebrew Strong's", MB_OK);
+			}
+		}
+	}
+	else if (strstr(t, "noteID=")) {
+		const char *val = strstr(t, "noteID=");
+		if ((val) && (strlen(val) > 7)) {
+			val += 7;
+			SWBuf buf = val;
+			const char *tmp = buf.c_str();
+			val = strstr(tmp, ".n.");
+			if (val) {
+				buf.setSize(val - tmp);
+				SWBuf saveKey = position.bible->KeyText();
+				position.bible->setKey(buf.c_str());
+				position.bible->StripText();	// force lookup
+				const char *n = strstr(t, ".n.");
+				if (n) {
+					SWBuf body = position.bible->getEntryAttributes()["Footnote"][n+3]["body"];
+					MessageBox(0, strtowstr(body), L"Footnote", MB_OK);
+				}
+				position.bible->KeyText(saveKey);
+			}
+		}
+	}
+	else MessageBox(0, target, L"url clicked", MB_OK);
+
+}

Index: Navigator.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/Navigator.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Navigator.h	24 Jan 2004 22:29:59 -0000	1.3
+++ Navigator.h	29 Jan 2004 06:47:55 -0000	1.4
@@ -73,6 +73,7 @@
 	void paint();
 	void buttonClicked(int id);
 	void keyDown(WPARAM id, LPARAM lparam);
+	void urlClicked(const WCHAR *target);
 	void mouseDown(int x, int y);
 	bool initialized() {return position.initialized();}
 };

Index: SwordIndex.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/SwordIndex.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- SwordIndex.cpp	21 Jan 2004 06:15:33 -0000	1.6
+++ SwordIndex.cpp	29 Jan 2004 06:47:55 -0000	1.7
@@ -27,7 +27,12 @@
 };
 
 
-sword::SWMgr* SwordIndex::manager;
+SWMgr* SwordIndex::manager;
+SWModule *SwordIndex::greekLex = 0;
+SWModule *SwordIndex::hebrewLex = 0;
+SWModule *SwordIndex::greekMorph = 0;
+SWModule *SwordIndex::hebrewMorph = 0;
+
 int SwordIndex::indices=0;
 std::map<const char*, sword::SWModule*, ltstr>* SwordIndex::texts;
 
@@ -84,6 +89,18 @@
 				if (!strcmp(curMod->Type(), "Biblical Texts")) {
 //					curMod->AddStripFilter(new sword::ThMLHTML());
 					(*texts)[curMod->Name()]=curMod;
+				}
+				if (curMod->getConfig().has("Feature", "GreekDef")) {
+					greekLex = curMod;
+				}
+				if (curMod->getConfig().has("Feature", "GreekParse")) {
+					greekMorph = curMod;
+				}
+				if (curMod->getConfig().has("Feature", "HebrewDef")) {
+					hebrewLex = curMod;
+				}
+				if (curMod->getConfig().has("Feature", "HebrewParse")) {
+					hebrewMorph = curMod;
 				}
 			}
 		} 

Index: SwordIndex.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/SwordIndex.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- SwordIndex.h	24 Jan 2004 19:45:52 -0000	1.3
+++ SwordIndex.h	29 Jan 2004 06:47:55 -0000	1.4
@@ -20,6 +20,8 @@
 #include <thmlvariants.h>
 #include <map>
 
+using namespace sword;
+
 struct ltstr
 {
   bool operator()(const char* s1, const char* s2) const
@@ -41,9 +43,6 @@
 
 	sword::sbook getBook(int book);
 
-	sword::SWModule* bible;
-	sword::VerseKey* verse;
-
 	sword::VerseKey* mark;
 
 	int book;
@@ -64,7 +63,12 @@
 	void jumpBack();
 	void next();
 	static sword::SWMgr* manager;
-
+	static SWModule *greekLex;
+	static SWModule *hebrewLex;
+	static SWModule *greekMorph;
+	static SWModule *hebrewMorph;
+	SWModule* bible;
+	VerseKey* verse;
 	bool initialized() { return (bible!=0);};
 
 	UString bookName(int book);

Index: gui.vcl
===================================================================
RCS file: /cvs/core/swordreader/src/gui/gui.vcl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- gui.vcl	25 Jan 2004 01:03:24 -0000	1.13
+++ gui.vcl	29 Jan 2004 06:47:55 -0000	1.14
@@ -6,21 +6,13 @@
 --------------------Configuration: gui - Win32 (WCE ARM) Release--------------------
 </h3>
 <h3>Command Lines</h3>
-Creating command line "rc.exe /l 0x409 /fo"ARMRel/BibleReader.res" /i "..\dll1\sword\include" /i "..\dll1\wincesword\include" /i "..\STL_eVC" /d UNDER_CE=300 /d _WIN32_WCE=300 /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "WIN32_PLATFORM_PSPC=310" /d "ARM" /d "_ARM_" /r "D:\src\swordreader\src\gui\BibleReader.rc"" 
-Creating temporary file "C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP115.tmp" with contents
+Creating temporary file "C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP1576.tmp" with contents
 [
 /nologo /W3 /I "..\STL_eVC" /I "..\..\..\sword\include" /I "..\dll1\wincesword\include" /D _WIN32_WCE=300 /D "WIN32_PLATFORM_PSPC=310" /D "ARM" /D "_ARM_" /D UNDER_CE=300 /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /Fp"ARMRel/gui.pch" /YX /Fo"ARMRel/" /Oxs /MC /c 
-"D:\src\swordreader\src\gui\ApplicationInterface.cpp"
-"D:\src\swordreader\src\gui\Main.cpp"
-"D:\src\swordreader\src\gui\NavBooks.cpp"
 "D:\src\swordreader\src\gui\Navigator.cpp"
-"D:\src\swordreader\src\gui\NavNumbers.cpp"
-"D:\src\swordreader\src\gui\NavRenderText.cpp"
-"D:\src\swordreader\src\gui\SwordIndex.cpp"
-"D:\src\swordreader\src\gui\Utils.cpp"
 ]
-Creating command line "clarm.exe @C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP115.tmp" 
-Creating temporary file "C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP116.tmp" with contents
+Creating command line "clarm.exe @C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP1576.tmp" 
+Creating temporary file "C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP1577.tmp" with contents
 [
 ..\Dll1\ARMRel\sword.lib htmlview.lib oleaut32.lib commctrl.lib coredll.lib aygshell.lib ..\Dll1\ARMRel\sword.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /incremental:no /pdb:"ARMRel/gui.pdb" /nodefaultlib:"libc.lib /nodefaultlib:libcd.lib /nodefaultlib:libcmt.lib /nodefaultlib:libcmtd.lib /nodefaultlib:msvcrt.lib /nodefaultlib:msvcrtd.lib /nodefaultlib:oldnames.lib" /out:"ARMRel/gui.exe" /libpath:"..\STL_eVC" /libpath:"C:\IpaqProgs\SwordReader\src\STL_eVC\\" /subsystem:windowsce,3.00 /align:"4096" /MACHINE:ARM 
 .\ARMRel\ApplicationInterface.obj
@@ -33,43 +25,17 @@
 .\ARMRel\Utils.obj
 .\ARMRel\BibleReader.res
 ]
-Creating command line "link.exe @C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP116.tmp"
+Creating command line "link.exe @C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP1577.tmp"
 <h3>Output Window</h3>
-Compiling resources...
 Compiling...
-ApplicationInterface.cpp
-Main.cpp
-..\..\..\sword\include\swbuf.h(206) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-..\..\..\sword\include\swbuf.h(213) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-NavBooks.cpp
-..\..\..\sword\include\swbuf.h(206) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-..\..\..\sword\include\swbuf.h(213) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
 Navigator.cpp
-..\..\..\sword\include\swbuf.h(206) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-..\..\..\sword\include\swbuf.h(213) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-NavNumbers.cpp
-..\..\..\sword\include\swbuf.h(206) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-..\..\..\sword\include\swbuf.h(213) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-NavRenderText.cpp
-..\..\..\sword\include\swbuf.h(206) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-..\..\..\sword\include\swbuf.h(213) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-D:\src\swordreader\src\gui\NavRenderText.cpp(114) : warning C4509: nonstandard extension used: 'load' uses SEH and 'heading' has destructor
-        D:\src\swordreader\src\gui\NavRenderText.cpp(87) : see declaration of 'heading'
-D:\src\swordreader\src\gui\NavRenderText.cpp(114) : warning C4509: nonstandard extension used: 'load' uses SEH and 's' has destructor
-        D:\src\swordreader\src\gui\NavRenderText.cpp(86) : see declaration of 's'
-D:\src\swordreader\src\gui\NavRenderText.cpp(114) : warning C4509: nonstandard extension used: 'load' uses SEH and 'text' has destructor
-        D:\src\swordreader\src\gui\NavRenderText.cpp(80) : see declaration of 'text'
-SwordIndex.cpp
-..\..\..\sword\include\swbuf.h(206) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-..\..\..\sword\include\swbuf.h(213) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
-Utils.cpp
 Linking...
 
 
 
 
 <h3>Results</h3>
-gui.exe - 0 error(s), 15 warning(s)
+gui.exe - 0 error(s), 0 warning(s)
 </pre>
 </body>
 </html>