[sword-cvs] swordreader/src/gui ApplicationInterface.cpp,1.2,1.3 BibleReader.aps,1.2,1.3 BibleReader.rc,1.1.1.1,1.2 Main.cpp,1.5,1.6 Navigator.cpp,1.5,1.6 gui.vcl,1.15,1.16 gui.vcp,1.5,1.6 resource.h,1.1.1.1,1.2

sword@www.crosswire.org sword@www.crosswire.org
Tue, 3 Feb 2004 11:45:38 -0700


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

Modified Files:
	ApplicationInterface.cpp BibleReader.aps BibleReader.rc 
	Main.cpp Navigator.cpp gui.vcl gui.vcp resource.h 
Log Message:
Stripped footnote tags.  Added Shutdown so we can replace .exe while coding without always going to settings to shut the app down.  Added support for footnotes and xrefs

Index: ApplicationInterface.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/ApplicationInterface.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ApplicationInterface.cpp	31 Jan 2004 22:43:32 -0000	1.2
+++ ApplicationInterface.cpp	3 Feb 2004 18:45:35 -0000	1.3
@@ -87,21 +87,26 @@
 	setMenuSelected(g_hwndCB,MENU_FIND,(mode==MENU_FIND));
 }
 
-void addMenu(HMENU menu, int id, UString text) {
-	AppendMenu(menu,0,USERBUTTONS+id,text.c_str());
-}
-
-HMENU registerID(int id) {
-	return (HMENU) (USERBUTTONS+id);
-}
-
+void addMenu(HMENU menu, int id, UString text) {
+	AppendMenu(menu,0,USERBUTTONS+id,text.c_str());
+}
+
+
+
+HMENU registerID(int id) {
+	return (HMENU) (USERBUTTONS+id);
+}
+
+
+
 void checkMenu(HMENU menu, int id, bool checked) {
 	CheckMenuItem(menu,USERBUTTONS+id,checked?MF_CHECKED:MF_UNCHECKED);
 }
-
-UString getText(HWND edit) {
-	TCHAR chars[MAX_LOADSTRING];
-	SendMessage(edit,WM_GETTEXT,(WPARAM)MAX_LOADSTRING,(LPARAM)chars);
-	chars[MAX_LOADSTRING-1]=0; // in case the buffer was exceeded
-	return UString(chars);
+
+
+UString getText(HWND edit) {
+	TCHAR chars[MAX_LOADSTRING];
+	SendMessage(edit,WM_GETTEXT,(WPARAM)MAX_LOADSTRING,(LPARAM)chars);
+	chars[MAX_LOADSTRING-1]=0; // in case the buffer was exceeded
+	return UString(chars);
 }

Index: BibleReader.aps
===================================================================
RCS file: /cvs/core/swordreader/src/gui/BibleReader.aps,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvs0eCO7K and /tmp/cvsTHh1jm differ

Index: BibleReader.rc
===================================================================
RCS file: /cvs/core/swordreader/src/gui/BibleReader.rc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- BibleReader.rc	16 Jan 2004 17:34:18 -0000	1.1.1.1
+++ BibleReader.rc	3 Feb 2004 18:45:35 -0000	1.2
@@ -65,15 +65,15 @@
 BEGIN
     IDM_MENU, 6,
     I_IMAGENONE, MENU_BOOK, TBSTATE_ENABLED, 
-    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_BOOK, 0, 0,
+    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_BOOK, 0, NOMENU,
     I_IMAGENONE, MENU_CHAP, TBSTATE_ENABLED, 
-    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_CHAP, 0, 1,
+    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_CHAP, 0, NOMENU,
     I_IMAGENONE, MENU_VERSE, TBSTATE_ENABLED, 
-    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_VERSE, 0, 2,
+    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_VERSE, 0, NOMENU,
     I_IMAGENONE, MENU_TEXT, TBSTATE_ENABLED, 
-    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_TEXT, MENU_TEXT, 3,
+    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_TEXT, MENU_TEXT, NOMENU,
     I_IMAGENONE, MENU_FIND, TBSTATE_ENABLED, 
-    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_FIND, 0, 4,
+    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_FIND, 0, NOMENU,
     I_IMAGENONE, MENU_MENU, TBSTATE_ENABLED, 
     TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_MENU, 0, 5,
 END
@@ -94,6 +94,7 @@
     POPUP "Menu"
     BEGIN
         MENUITEM "About",                       MENU_ABOUT
+        MENUITEM "Shutdown",                    MENU_SHUTDOWN
     END
 END
 

Index: Main.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/Main.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Main.cpp	31 Jan 2004 22:43:32 -0000	1.5
+++ Main.cpp	3 Feb 2004 18:45:35 -0000	1.6
@@ -163,6 +163,10 @@
 					SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)hWnd);
 					SendMessage (hWnd, WM_CLOSE, 0, 0);
 					break;
+				case MENU_SHUTDOWN:
+					SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)hWnd);
+					SendMessage (hWnd, WM_CLOSE, 0, 0);
+					exit(0);
 				default:
 					if ((wmId>=USERBUTTONS)&&(wmId<USERBUTTONS+1000)) {
 						g_navigator->buttonClicked(wmId-USERBUTTONS);

Index: Navigator.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/Navigator.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Navigator.cpp	31 Jan 2004 22:43:32 -0000	1.5
+++ Navigator.cpp	3 Feb 2004 18:45:35 -0000	1.6
@@ -2,7 +2,8 @@
 #include "Navigator.h"
 #include "NavNumbers.h"
 #include "NavBooks.h"
-#include "NavRenderText.h"
+#include "NavRenderText.h"
+
 #include "NavFind.h"
 #include <swordce.h>
 #include <swmgr.h>
@@ -25,7 +26,8 @@
 	mode=-1;
 	numbers=new NavNumbers(this);
 	books=new NavBooks(this);
-	text=new NavRenderText(this);
+	text=new NavRenderText(this);
+
 	find=new NavFind(this);
 	nextID = 1;
 	optStartID = 0;
@@ -39,7 +41,8 @@
 Navigator::~Navigator() {
 	delete numbers;
 	delete books;
-	delete text;
+	delete text;
+
 	delete find;
 	if (options)
 		delete options;
@@ -50,9 +53,12 @@
 }
 
 void Navigator::setMode(int mode) {
-	switch (this->mode) {
-		case MODE_TEXT: text->hide(); break;
-		case MODE_FIND: find->hide(); break;
+	switch (this->mode) {
+
+		case MODE_TEXT: text->hide(); break;
+
+		case MODE_FIND: find->hide(); break;
+
 	}
 	this->mode=mode;
 	switch (mode) {
@@ -76,7 +82,8 @@
 	if (mode==MODE_TEXT) {
 		text->paint();
 	}
-	if (mode==MODE_FIND) {
+	if (mode==MODE_FIND) {
+
 		find->paint();
 	}
 }
@@ -105,8 +112,10 @@
 		toggleOptionMenu(id);
 		setMode(MODE_TEXT);
 		text->show(true);
-	}
-	else if (mode==MODE_FIND) 
+	}
+
+	else if (mode==MODE_FIND) 
+
 		find->buttonClicked(id);
 }
 
@@ -277,21 +286,40 @@
 			val = strstr(tmp, ".n.");
 			if (val) {
 				buf.setSize(val - tmp);
-				SWBuf saveKey = position.bible->KeyText();
-				position.bible->setKey(buf.c_str());
+				SWBuf saveKey = position.verse->getText();
+				position.verse->setText(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"];
+					body = position.bible->StripText(body.c_str());
 					MessageBox(0, strtowstr(body), L"Footnote", MB_OK);
 				}
-				position.bible->KeyText(saveKey);
+				position.verse->setText(saveKey);
+			}
+			else {
+				val = strstr(tmp, ".x.");
+				if (val) {
+					buf.setSize(val - tmp);
+					SWBuf saveKey = position.verse->getText();
+					position.verse->setText(buf.c_str());
+					position.bible->StripText();	// force lookup
+					const char *n = strstr(t, ".x.");
+					if (n) {
+						SWBuf body = position.bible->getEntryAttributes()["Footnote"][n+3]["body"];
+						body = position.bible->StripText(body.c_str());
+						MessageBox(0, strtowstr(body), L"CrossReference", MB_OK);
+					}
+					position.verse->setText(saveKey);
+				}
 			}
 		}
 	}
 	else MessageBox(0, target, L"url clicked", MB_OK);
 
 }
-int Navigator::getID() {
-	return nextID++;
+int Navigator::getID() {
+
+	return nextID++;
+
 }

Index: gui.vcl
===================================================================
RCS file: /cvs/core/swordreader/src/gui/gui.vcl,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- gui.vcl	31 Jan 2004 22:43:32 -0000	1.15
+++ gui.vcl	3 Feb 2004 18:45:35 -0000	1.16
@@ -1,79 +1,47 @@
-<html>
-<body>
-<pre>
-<h1>Build Log</h1>
-<h3>
---------------------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:\SwordReader\swordreader\src\gui\BibleReader.rc"" 
-Creating temporary file "E:\DOCUME~1\Johan\LOCALS~1\Temp\RSP194.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:\SwordReader\swordreader\src\gui\ApplicationInterface.cpp"
-"D:\SwordReader\swordreader\src\gui\Main.cpp"
-"D:\SwordReader\swordreader\src\gui\NavBooks.cpp"
-"D:\SwordReader\swordreader\src\gui\NavFind.cpp"
-"D:\SwordReader\swordreader\src\gui\Navigator.cpp"
-"D:\SwordReader\swordreader\src\gui\NavNumbers.cpp"
-"D:\SwordReader\swordreader\src\gui\NavRenderText.cpp"
-"D:\SwordReader\swordreader\src\gui\SwordIndex.cpp"
-"D:\SwordReader\swordreader\src\gui\Utils.cpp"
-]
-Creating command line "clarm.exe @E:\DOCUME~1\Johan\LOCALS~1\Temp\RSP194.tmp" 
-Creating temporary file "E:\DOCUME~1\Johan\LOCALS~1\Temp\RSP195.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
-.\ARMRel\Main.obj
-.\ARMRel\NavBooks.obj
-.\ARMRel\NavFind.obj
-.\ARMRel\Navigator.obj
-.\ARMRel\NavNumbers.obj
-.\ARMRel\NavRenderText.obj
-.\ARMRel\SwordIndex.obj
-.\ARMRel\Utils.obj
-.\ARMRel\BibleReader.res
-]
-Creating command line "link.exe @E:\DOCUME~1\Johan\LOCALS~1\Temp\RSP195.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)
-NavFind.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:\SwordReader\swordreader\src\gui\NavRenderText.cpp(103) : warning C4509: nonstandard extension used: 'load' uses SEH and 'heading' has destructor
-        D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(76) : see declaration of 'heading'
-D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(103) : warning C4509: nonstandard extension used: 'load' uses SEH and 's' has destructor
-        D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(75) : see declaration of 's'
-D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(103) : warning C4509: nonstandard extension used: 'load' uses SEH and 'text' has destructor
-        D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(71) : 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), 17 warning(s)
-</pre>
-</body>
-</html>
+<html>
+<body>
+<pre>
+<h1>Build Log</h1>
+<h3>
+--------------------Configuration: gui - Win32 (WCE ARM) Release--------------------
+</h3>
+<h3>Command Lines</h3>
+Creating temporary file "C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP5F.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" /FR"ARMRel/" /Fp"ARMRel/gui.pch" /YX /Fo"ARMRel/" /Oxs /MC /c 
+"D:\src\swordreader\src\gui\Navigator.cpp"
+]
+Creating command line "clarm.exe @C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP5F.tmp" 
+Creating temporary file "C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP60.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
+.\ARMRel\Main.obj
+.\ARMRel\NavBooks.obj
+.\ARMRel\NavFind.obj
+.\ARMRel\Navigator.obj
+.\ARMRel\NavNumbers.obj
+.\ARMRel\NavRenderText.obj
+.\ARMRel\SwordIndex.obj
+.\ARMRel\Utils.obj
+.\ARMRel\BibleReader.res
+]
+Creating command line "link.exe @C:\DOCUME~1\scribe\LOCALS~1\Temp\RSP60.tmp"
+<h3>Output Window</h3>
+Compiling...
+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)
+Linking...
+Creating command line "bscmake.exe /nologo /o"ARMRel/gui.bsc"  .\ARMRel\ApplicationInterface.sbr .\ARMRel\Main.sbr .\ARMRel\NavBooks.sbr .\ARMRel\NavFind.sbr .\ARMRel\Navigator.sbr .\ARMRel\NavNumbers.sbr .\ARMRel\NavRenderText.sbr .\ARMRel\SwordIndex.sbr .\ARMRel\Utils.sbr"
+Creating browse info file...
+<h3>Output Window</h3>
+
+
+
+
+<h3>Results</h3>
+gui.exe - 0 error(s), 2 warning(s)
+</pre>
+</body>
+</html>

Index: gui.vcp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/gui.vcp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gui.vcp	31 Jan 2004 22:43:32 -0000	1.5
+++ gui.vcp	3 Feb 2004 18:45:35 -0000	1.6
@@ -1,1384 +1,1580 @@
-# Microsoft eMbedded Visual Tools Project File - Name="gui" - Package Owner=<4>
-# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (WCE x86) Application" 0x8301
-# TARGTYPE "Win32 (WCE ARM) Application" 0x8501
-
-CFG=gui - Win32 (WCE ARM) Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
[...2933 lines suppressed...]
+SOURCE=.\BibleReader.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\BibleReader.rc
+
+!IF  "$(CFG)" == "gui - Win32 (WCE ARM) Release"
+
+!ELSEIF  "$(CFG)" == "gui - Win32 (WCE ARM) Debug"
+
+!ELSEIF  "$(CFG)" == "gui - Win32 (WCE x86) Release"
+
+!ELSEIF  "$(CFG)" == "gui - Win32 (WCE x86) Debug"
+
+!ENDIF 
+
+# End Source File
+# End Group
+# End Target
+# End Project

Index: resource.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/resource.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- resource.h	16 Jan 2004 17:34:19 -0000	1.1.1.1
+++ resource.h	3 Feb 2004 18:45:35 -0000	1.2
@@ -30,6 +30,7 @@
 #define IDS_CAP_MENU                    40023
 #define MENU_FIND                       40029
 #define IDS_CAP_FIND                    40030
+#define MENU_SHUTDOWN                   40031
 #define USERBUTTONS                     41000
 
 // Next default values for new objects
@@ -37,7 +38,7 @@
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        109
-#define _APS_NEXT_COMMAND_VALUE         40031
+#define _APS_NEXT_COMMAND_VALUE         40032
 #define _APS_NEXT_CONTROL_VALUE         1002
 #define _APS_NEXT_SYMED_VALUE           102
 #endif