[sword-cvs] swordreader/src/gui ApplicationInterface.cpp,1.3,1.4 ApplicationInterface.h,1.3,1.4 BibleReader.rc,1.3,1.4 gui.vcl,1.20,1.21 gui.vcp,1.9,1.10 NavBooks.cpp,1.6,1.7 NavChap.cpp,1.3,1.4 NavChap.h,1.3,1.4 NavFind.cpp,1.5,1.6 NavFind.h,1.5,1.6 NavNumbers.cpp,1.5,1.6 NavRenderText.cpp,1.11,1.12 NavVerse.cpp,1.3,1.4 SimpleNavigator.cpp,1.2,1.3 SimpleNavigator.h,1.2,1.3 SwordIndex.cpp,1.10,1.11 SwordIndex.h,1.6,1.7 Utils.h,1.2,1.3 BibleReader.aps,1.4,1.5
sword@www.crosswire.org
sword@www.crosswire.org
Sat, 17 Apr 2004 11:51:49 -0700
- Previous message: [sword-cvs] sword/tests swbuftest.cpp,1.7,1.8
- Next message: [sword-cvs] swordreader/src/gui TextControl.cpp,NONE,1.1 TextControl.h,NONE,1.1 VerseTextControl.cpp,NONE,1.1 VerseTextControl.h,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvs/core/swordreader/src/gui
In directory www:/tmp/cvs-serv10254
Modified Files:
ApplicationInterface.cpp ApplicationInterface.h BibleReader.rc
gui.vcl gui.vcp NavBooks.cpp NavChap.cpp NavChap.h NavFind.cpp
NavFind.h NavNumbers.cpp NavRenderText.cpp NavVerse.cpp
SimpleNavigator.cpp SimpleNavigator.h SwordIndex.cpp
SwordIndex.h Utils.h BibleReader.aps
Log Message:
Searching works now
Index: ApplicationInterface.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/ApplicationInterface.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ApplicationInterface.cpp 3 Feb 2004 18:45:35 -0000 1.3
+++ ApplicationInterface.cpp 17 Apr 2004 18:51:47 -0000 1.4
@@ -58,11 +58,17 @@
drawRText(rt,text.c_str(), text.length());
}
+#define MARGIN 2
+
int drawVerseText(RECT* rt, UString text) {
RECT tmp=*rt;
- tmp.left+=1;
- DrawText(hdc, text.c_str(),text.length(),&tmp,DT_LEFT|DT_WORDBREAK);
+ tmp.left+=MARGIN;
DrawText(hdc, text.c_str(),text.length(),&tmp,DT_LEFT|DT_WORDBREAK|DT_CALCRECT);
+ tmp.left=rt->left;
+ tmp.right=rt->right;
+ clearRect(&tmp);
+ tmp.left+=MARGIN;
+ DrawText(hdc, text.c_str(),text.length(),&tmp,DT_LEFT|DT_WORDBREAK);
return (tmp.bottom)-(tmp.top);
}
@@ -79,12 +85,16 @@
SelectObject(hdc,newFont);
}
-void selectMenu(int mode) {
- setMenuSelected(g_hwndCB,MENU_BOOK,(mode==MENU_BOOK));
+void selectMenu(std::map<int,int>& menus, int mode) {
+ for (int i=0;i<menus.size();++i) {
+ setMenuSelected(g_hwndCB,menus[i],(mode==i));
+ }
+/* setMenuSelected(g_hwndCB,MENU_BOOK,(mode==MENU_BOOK));
setMenuSelected(g_hwndCB,MENU_CHAP,(mode==MENU_CHAP));
setMenuSelected(g_hwndCB,MENU_VERSE,(mode==MENU_VERSE));
setMenuSelected(g_hwndCB,MENU_TEXT,(mode==MENU_TEXT));
setMenuSelected(g_hwndCB,MENU_FIND,(mode==MENU_FIND));
+*/
}
void addMenu(HMENU menu, int id, UString text) {
Index: ApplicationInterface.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/ApplicationInterface.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ApplicationInterface.h 15 Mar 2004 10:44:35 -0000 1.3
+++ ApplicationInterface.h 17 Apr 2004 18:51:47 -0000 1.4
@@ -82,7 +82,8 @@
SetBkColor(hdc,color);
}
-void selectMenu(int mode);
+void selectMenu(std::map<int,int>& menus, int mode);
+//void selectMenu(int mode);
void addMenu(HMENU menu, int id, UString text);
Index: BibleReader.rc
===================================================================
RCS file: /cvs/core/swordreader/src/gui/BibleReader.rc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- BibleReader.rc 28 Feb 2004 19:43:29 -0000 1.3
+++ BibleReader.rc 17 Apr 2004 18:51:47 -0000 1.4
@@ -1,197 +1,197 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "newres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_BIBLEREADER ICON DISCARDABLE "BibleReader.ICO"
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""newres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Data
-//
-
-IDM_MENU SHMENUBAR MOVEABLE PURE
-BEGIN
- IDM_MENU, 7,
- I_IMAGENONE, MENU_BOOK, TBSTATE_ENABLED,
- TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_BOOK, 0, 0,
- I_IMAGENONE, MENU_CHAP, TBSTATE_ENABLED,
- TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_CHAP, 0, 1,
- I_IMAGENONE, MENU_VERSE, TBSTATE_ENABLED,
- TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_VERSE, 0, 2,
- I_IMAGENONE, MENU_TEXT, TBSTATE_ENABLED,
- TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_TEXT, MENU_TEXT, 3,
- I_IMAGENONE, MENU_FIND, TBSTATE_ENABLED,
- TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_FIND, 0, 4,
- I_IMAGENONE, MENU_TEXT2, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, IDS_CAP_TE2,
- 0, 5,
- I_IMAGENONE, MENU_MENU, TBSTATE_ENABLED,
- TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_MENU, 0, 6,
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menubar
-//
-
-IDM_MENU MENU DISCARDABLE
-BEGIN
- MENUITEM "Bo", MENU_BOOK
- MENUITEM "Ch", MENU_CHAP
- MENUITEM "Ve", MENU_VERSE
- MENUITEM "Te", MENU_TEXT
- MENUITEM "Fi", MENU_FIND
- MENUITEM "Te2", MENU_TEXT2
- POPUP "Menu"
- BEGIN
- MENUITEM "About", MENU_ABOUT
- MENUITEM "Shutdown", MENU_SHUTDOWN
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDC_BIBLEREADER ACCELERATORS DISCARDABLE
-BEGIN
- "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT
- "Q", IDOK, VIRTKEY, CONTROL, NOINVERT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_ERROR_NOBIBLES, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 243
- TOPMARGIN, 7
- BOTTOMMARGIN, 75
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ERROR_NOBIBLES DIALOG DISCARDABLE 0, 0, 250, 82
-STYLE WS_POPUP
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "ERROR: No bibles were installed",IDC_STATIC,7,31,229,16
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_APP_TITLE "Sword Reader"
- IDC_BIBLEREADER "BIBLEREADER"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_CAP_BOOK "Bo"
- IDS_CAP_CHAP "Ch"
- IDS_CAP_TEXT "Te"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_CAP_VERSE "Ve"
- IDS_CAP_BIBLE "Find"
- IDS_SELECTBOOK "Select a book:"
- IDS_SELECTCHAP "Select a chapter:"
- IDS_SELECTBIBLE "Select a bible"
- IDS_CAP_MENU "Menu"
- IDS_CAP_FIND "Fi"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_CAP_TE2 "Te2"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "newres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_BIBLEREADER ICON DISCARDABLE "BibleReader.ICO"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""newres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Data
+//
+
+IDM_MENU SHMENUBAR MOVEABLE PURE
+BEGIN
+ IDM_MENU, 7,
+ I_IMAGENONE, MENU_BOOK, TBSTATE_ENABLED,
+ TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_BOOK, 0, 0,
+ I_IMAGENONE, MENU_CHAP, TBSTATE_ENABLED,
+ TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_CHAP, 0, 1,
+ I_IMAGENONE, MENU_VERSE, TBSTATE_ENABLED,
+ TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_VERSE, 0, 2,
+ I_IMAGENONE, MENU_TEXT, TBSTATE_ENABLED,
+ TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_TEXT, MENU_TEXT, 3,
+ I_IMAGENONE, MENU_FIND, TBSTATE_ENABLED,
+ TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_FIND, 0, 4,
+ I_IMAGENONE, MENU_TEXT2, TBSTATE_ENABLED,
+ TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_TE2, 0, 5,
+ I_IMAGENONE, MENU_MENU, TBSTATE_ENABLED,
+ TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_MENU, 0, 6,
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menubar
+//
+
+IDM_MENU MENU DISCARDABLE
+BEGIN
+ MENUITEM "Bo", MENU_BOOK
+ MENUITEM "Ch", MENU_CHAP
+ MENUITEM "Ve", MENU_VERSE
+ MENUITEM "Te", MENU_TEXT
+ MENUITEM "Fi", MENU_FIND
+ MENUITEM "Te2", MENU_TEXT2
+ POPUP "Menu"
+ BEGIN
+ MENUITEM "About", MENU_ABOUT
+ MENUITEM "Shutdown", MENU_SHUTDOWN
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDC_BIBLEREADER ACCELERATORS DISCARDABLE
+BEGIN
+ "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT
+ "Q", IDOK, VIRTKEY, CONTROL, NOINVERT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_ERROR_NOBIBLES, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 243
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 75
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ERROR_NOBIBLES DIALOG DISCARDABLE 0, 0, 250, 82
+STYLE WS_POPUP
+FONT 8, "MS Sans Serif"
+BEGIN
+ LTEXT "ERROR: No bibles were installed",IDC_STATIC,7,31,229,16
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_APP_TITLE "Sword Reader"
+ IDC_BIBLEREADER "BIBLEREADER"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_CAP_BOOK "Bo"
+ IDS_CAP_CHAP "Ch"
+ IDS_CAP_TEXT "Te"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_CAP_VERSE "Ve"
+ IDS_CAP_BIBLE "Find"
+ IDS_SELECTBOOK "Select a book:"
+ IDS_SELECTCHAP "Select a chapter:"
+ IDS_SELECTBIBLE "Select a bible"
+ IDS_CAP_MENU "Menu"
+ IDS_CAP_FIND "Fi"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_CAP_TE2 "Te2"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
Index: gui.vcl
===================================================================
RCS file: /cvs/core/swordreader/src/gui/gui.vcl,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- gui.vcl 28 Feb 2004 19:43:29 -0000 1.20
+++ gui.vcl 17 Apr 2004 18:51:47 -0000 1.21
@@ -1,64 +1,16 @@
-<html>
-<body>
-<pre>
-<h1>Build Log</h1>
-<h3>
---------------------Configuration: gui - Win32 (WCE ARM) Release--------------------
-</h3>
-<h3>Command Lines</h3>
-Creating temporary file "E:\DOCUME~1\Johan\LOCALS~1\Temp\RSP25D.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:\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\NavChap.cpp"
-"D:\SwordReader\swordreader\src\gui\NavVerse.cpp"
-]
-Creating command line "clarm.exe @E:\DOCUME~1\Johan\LOCALS~1\Temp\RSP25D.tmp"
-Creating temporary file "E:\DOCUME~1\Johan\LOCALS~1\Temp\RSP25E.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
-.\ARMRel\NavChap.obj
-.\ARMRel\NavVerse.obj
-.\ARMRel\SimpleNavigator.obj
-]
-Creating command line "link.exe @E:\DOCUME~1\Johan\LOCALS~1\Temp\RSP25E.tmp"
-<h3>Output Window</h3>
-Compiling...
-Main.cpp
-NavBooks.cpp
-NavFind.cpp
-Navigator.cpp
-NavNumbers.cpp
-NavRenderText.cpp
-D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(112) : warning C4509: nonstandard extension used: 'load' uses SEH and 'heading' has destructor
- D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(73) : see declaration of 'heading'
-D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(112) : warning C4509: nonstandard extension used: 'load' uses SEH and 's' has destructor
- D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(72) : see declaration of 's'
-D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(112) : warning C4509: nonstandard extension used: 'load' uses SEH and 'text' has destructor
- D:\SwordReader\swordreader\src\gui\NavRenderText.cpp(68) : see declaration of 'text'
-NavChap.cpp
-NavVerse.cpp
-Linking...
-
-
-
-<h3>Results</h3>
-gui.exe - 0 error(s), 3 warning(s)
-</pre>
-</body>
-</html>
+<html>
+<body>
+<pre>
+<h1>Build Log</h1>
+<h3>
+--------------------Configuration: gui - Win32 (WCE ARM) Release--------------------
+</h3>
+<h3>Command Lines</h3>
+
+
+
+<h3>Results</h3>
+gui.exe - 0 error(s), 0 warning(s)
+</pre>
+</body>
+</html>
Index: gui.vcp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/gui.vcp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- gui.vcp 28 Feb 2004 19:43:29 -0000 1.9
+++ gui.vcp 17 Apr 2004 18:51:47 -0000 1.10
@@ -1,2201 +1,2335 @@
-# 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
[...4505 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: NavBooks.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/NavBooks.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- NavBooks.cpp 15 Mar 2004 10:44:35 -0000 1.6
+++ NavBooks.cpp 17 Apr 2004 18:51:47 -0000 1.7
@@ -1,7 +1,7 @@
#include "ApplicationInterface.h"
#include "NavBooks.h"
-#include "Navigator.h"
+#include "SimpleNavigator.h"
//RECT RECT_SCREEN = {0,0,240,294};
Index: NavChap.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/NavChap.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- NavChap.cpp 15 Mar 2004 10:44:15 -0000 1.3
+++ NavChap.cpp 17 Apr 2004 18:51:47 -0000 1.4
@@ -1,7 +1,7 @@
#include "NavChap.h"
#include "ApplicationInterface.h"
#include "NavFind.h"
-#include "Navigator.h"
+#include "SimpleNavigator.h"
NavChap::NavChap(SimpleNavigator* navigator):NavNumbers(navigator){
command=L"Select a chapter";
Index: NavChap.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/NavChap.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- NavChap.h 15 Mar 2004 10:44:35 -0000 1.3
+++ NavChap.h 17 Apr 2004 18:51:47 -0000 1.4
@@ -1,8 +1,6 @@
#ifndef NAVCHAP_H
#define NAVCHAP_H
-class Navigator;
-
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
Index: NavFind.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/NavFind.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- NavFind.cpp 20 Mar 2004 15:56:16 -0000 1.5
+++ NavFind.cpp 17 Apr 2004 18:51:47 -0000 1.6
@@ -1,24 +1,14 @@
#include "ApplicationInterface.h"
#include "NavFind.h"
-#include "Navigator.h"
+#include "SimpleNavigator.h"
#include <winuser.h>
#include <commctrl.h>
#define check(checkButtonHWND) SendMessage(checkButtonHWND,BM_SETCHECK,BST_CHECKED,0);
#define uncheck(checkButtonHWND) SendMessage(checkButtonHWND,BM_SETCHECK,BST_UNCHECKED,0);
-#define RANGEBIBLE 0
-#define RANGETESTAMENT 1
-#define RANGEBOOK 2
-
-#define METHODMULTIWORD 0
-#define METHODEXACTPHRASE 1
NavFind::NavFind(SimpleNavigator* navigator) : NavPage(navigator) {
-
- InitCommonControls(); //maybe does something for progress bar
-
- //this->navigator=navigator;
searchID=navigator->getID();
rangeBibleID=navigator->getID();
rangeTestamentID=navigator->getID();
@@ -26,6 +16,7 @@
methodMultiwordID=navigator->getID();
methodExactphraseID=navigator->getID();
goID=navigator->getID();
+ resultsID=navigator->getID();
query=L"Busy implementing, id=";
query+=toUString(searchID);
queryEdit = CreateWindow(_T("edit"), NULL,
@@ -54,14 +45,14 @@
title = CreateWindow(_T("static"),L"",
WS_CHILD,
120,72,120,24, g_hWnd, NULL, g_hInst, NULL);
- check(rangeBible);
- rangeMode=RANGEBIBLE;
+ check(rangeBook);
+ rangeMode=RANGEBOOK;
check(methodMultiword);
methodMode=METHODMULTIWORD;
results = CreateWindow(_T("listbox"),NULL,
- WS_CHILD | /*WS_VSCROLL*/ LBS_DISABLENOSCROLL | LBS_NOTIFY | WS_BORDER,
- 0,96,80,198, g_hWnd, NULL, g_hInst, NULL);
+ WS_CHILD | WS_VSCROLL | LBS_DISABLENOSCROLL | LBS_NOTIFY | WS_BORDER | LBS_NOINTEGRALHEIGHT,
+ 0,96,80,173, g_hWnd, registerID(resultsID), g_hInst, NULL); //bottom row off screen
progressBar = CreateWindow(PROGRESS_CLASS, L"",
WS_CHILD | WS_BORDER | PBS_SMOOTH,
80,96,100,24, g_hWnd, NULL, g_hInst, NULL);
@@ -69,10 +60,14 @@
WS_CHILD | BS_PUSHBUTTON,
180,96,60,24,
g_hWnd, registerID(goID), g_hInst, NULL);
-
+ preview=new TextControl(80,120,160,148);
+ preview->clearText();
+ preview->addText(UString(L"preview"));
+ preview->endOfText();
}
NavFind::~NavFind() {
+ delete preview;
}
void NavFind::show() {
@@ -89,6 +84,7 @@
ShowWindow(results,SW_SHOW);
ShowWindow(progressBar,SW_SHOW);
ShowWindow(go,SW_SHOW);
+ preview->show();
}
void NavFind::hide() {
@@ -105,13 +101,11 @@
ShowWindow(results,SW_HIDE);
ShowWindow(progressBar,SW_HIDE);
ShowWindow(go,SW_HIDE);
+ preview->hide();
}
void NavFind::paint() {
- RECT bottom=RECT_SCREEN;
- bottom.top=120;
- bottom.left=80;
- drawText(&bottom, query);
+ preview->paint();
}
void NavFind::buttonClicked(int id) {
@@ -123,41 +117,61 @@
check(rangeBible);
uncheck(rangeTestament);
uncheck(rangeBook);
+ rangeMode=RANGEBIBLE;
} else if (id==rangeTestamentID) {
uncheck(rangeBible);
check(rangeTestament);
uncheck(rangeBook);
+ rangeMode=RANGETESTAMENT;
} else if (id==rangeBookID) {
uncheck(rangeBible);
uncheck(rangeTestament);
check(rangeBook);
+ rangeMode=RANGEBOOK;
} else if (id==methodMultiwordID) {
check(methodMultiword);
uncheck(methodExactphrase);
+ methodMode=METHODMULTIWORD;
} else if (id==methodExactphraseID) {
check(methodExactphrase);
uncheck(methodMultiword);
+ methodMode=METHODEXACTPHRASE;
+ } else if (id==resultsID) {
+ int pos= SendMessage (results, LB_GETCURSEL, 0, 0);
+ if ((pos!=LB_ERR)&&(pos<verses.size())) {
+ previewVerse(&verses[pos]);
+ }
}
}
+void NavFind::previewVerse(Verse* verse) {
+ preview->clearText();
+ //preview->addText(SwordIndex::verseToString(verse));
+ preview->addText(navigator->position.verseText(verse));
+ preview->endOfText();
+}
+
void NavFind::clearResults() {
SendMessage (results, LB_RESETCONTENT,0,0);
+ preview->clearText();
+ preview->addText(UString(L"preview"));
+ preview->endOfText();
+ verses.clear();
}
void NavFind::setProgress(int percent) {
SendMessage(progressBar,PBM_SETPOS, percent, 0);
}
-void NavFind::addResult(UString verse) {
- SendMessage (results, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR)verse.c_str());
+void NavFind::addResult(UString verseStr) {
+ Verse* verse=new Verse(toCString(verseStr).c_str());
+ verses.push_back(*verse);
+ UString verseString=SwordIndex::verseToString(verse);
+ SendMessage (results, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR)verseString.c_str());
}
void NavFind::searchFor(UString query) {
clearResults();
- setProgress(0);
-
- //test
- setProgress(50);
- UString result1=L"Psa 119:172";
- addResult(result1);
+ setProgress(5);
+ navigator->position.search(query,rangeMode,methodMode,this);
}
Index: NavFind.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/NavFind.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- NavFind.h 20 Mar 2004 15:56:16 -0000 1.5
+++ NavFind.h 17 Apr 2004 18:51:47 -0000 1.6
@@ -7,10 +7,12 @@
#include "utils.h"
#include "NavPage.h"
+#include "TextControl.h"
+#include "SwordIndex.h"
class SimpleNavigator;
-class NavFind: public NavPage {
+class NavFind: public NavPage, public Searcher {
public:
NavFind(SimpleNavigator* navigator);
~NavFind();
@@ -19,20 +21,23 @@
void hide();
void buttonClicked(int id);
void searchFor(UString query);
+ virtual void setProgress(int percent);
+ virtual void addResult(UString verse);
private:
//Navigator* navigator;
+ std::vector<Verse> verses;
HWND queryEdit,search;
HWND rangeBible, rangeTestament, rangeBook;
HWND methodMultiword, methodExactphrase;
- HWND progressBar, results, title, go, preview;
+ HWND progressBar, results, title, go;
+ TextControl* preview;
int searchID;
int rangeBibleID, rangeTestamentID, rangeBookID;
int methodMultiwordID, methodExactphraseID;
- int goID;
+ int goID, resultsID;
UString query;
void clearResults();
- void setProgress(int percent);
- void addResult(UString verse);
+ void previewVerse(Verse* verse);
int rangeMode;
int methodMode;
};
Index: NavNumbers.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/NavNumbers.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- NavNumbers.cpp 28 Feb 2004 19:43:29 -0000 1.5
+++ NavNumbers.cpp 17 Apr 2004 18:51:47 -0000 1.6
@@ -1,7 +1,7 @@
#include "ApplicationInterface.h"
#include "NavNumbers.h"
-#include "Navigator.h"
+#include "SimpleNavigator.h"
//RECT RECT_SCREEN = {0,0,240,294};
Index: NavRenderText.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/NavRenderText.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- NavRenderText.cpp 15 Mar 2004 10:44:35 -0000 1.11
+++ NavRenderText.cpp 17 Apr 2004 18:51:47 -0000 1.12
@@ -1,6 +1,6 @@
#include "ApplicationInterface.h"
#include "NavRenderText.h"
-#include "Navigator.h"
+#include "SimpleNavigator.h"
#include <swordce.h>
Index: NavVerse.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/NavVerse.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- NavVerse.cpp 15 Mar 2004 10:44:35 -0000 1.3
+++ NavVerse.cpp 17 Apr 2004 18:51:47 -0000 1.4
@@ -1,7 +1,7 @@
#include "NavVerse.h"
#include "ApplicationInterface.h"
#include "NavFind.h"
-#include "Navigator.h"
+#include "SimpleNavigator.h"
NavVerse::NavVerse(SimpleNavigator* navigator):NavNumbers(navigator){
command=L"Select a verse";
Index: SimpleNavigator.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/SimpleNavigator.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- SimpleNavigator.cpp 15 Mar 2004 08:47:20 -0000 1.2
+++ SimpleNavigator.cpp 17 Apr 2004 18:51:47 -0000 1.3
@@ -62,7 +62,7 @@
void SimpleNavigator::setMode(int mode) {
if (this->mode>=0) pages[this->mode]->hide();
this->mode=mode;
- selectMenu(menus[this->mode]);
+ selectMenu(menus, mode);
pages[this->mode]->show();
updateTitle();
refresh();
Index: SimpleNavigator.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/SimpleNavigator.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- SimpleNavigator.h 15 Mar 2004 08:47:20 -0000 1.2
+++ SimpleNavigator.h 17 Apr 2004 18:51:47 -0000 1.3
@@ -9,10 +9,8 @@
#include "utils.h"
#include "SwordIndex.h"
#include "NavPage.h"
-#include <swbuf.h>
-#include <map>
-using namespace sword;
+//using namespace sword;
#define NUM_MENUS 5
Index: SwordIndex.cpp
===================================================================
RCS file: /cvs/core/swordreader/src/gui/SwordIndex.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- SwordIndex.cpp 15 Mar 2004 10:44:35 -0000 1.10
+++ SwordIndex.cpp 17 Apr 2004 18:51:47 -0000 1.11
@@ -14,6 +14,11 @@
L"1Th",L"2Th",L"1Ti",L"2Ti",L"Tit",L"Phi",L"Heb",L"Jas",L"1Pe",L"2Pe",L"1Jo",L"2Jo",L"3Jo",L"Jud",L"Rev",
};
+UString SwordIndex::verseToString(Verse* verse) {
+ return UString(defBookNames[(verse->Book()-1)+otBookCount()*(verse->Testament()-1)]) + L" "
+ + toUString(verse->Chapter()) + L":"
+ + toUString(verse->Verse());
+}
SWMgr* SwordIndex::manager;
SWModule *SwordIndex::greekLex = 0;
@@ -56,7 +61,6 @@
for (it = manager->Modules.begin(); it != manager->Modules.end(); it++) {
curMod = (*it).second;
if (!strcmp(curMod->Type(), "Biblical Texts")) {
-// curMod->AddStripFilter(new sword::ThMLHTML());
(*texts)[curMod->Name()]=curMod;
}
if (curMod->getConfig().has("Feature", "GreekDef")) {
@@ -90,12 +94,10 @@
}
UString SwordIndex::toString() {
- UString result=toUString(String(verse->getShortText()));
- return result;
+ return verseToString(verse);
}
UString SwordIndex::bookName(int book) {
-// return toUString(String(getBook(book).prefAbbrev));
return UString(defBookNames[book-1]);
}
@@ -149,6 +151,14 @@
return utf16;
}
+UString SwordIndex::verseText(sword::VerseKey* anyVerse) {
+ setMark();
+ verse->copyFrom(anyVerse);
+ UString temp=verseText();
+ jumpBack();
+ return temp;
+}
+
void SwordIndex::setMark() {
mark->copyFrom(verse);
}
@@ -164,4 +174,36 @@
void SwordIndex::setModule(Module m) {
bible=m;
bible->setKey(verse);
+}
+
+void SwordIndex::search(UString text, int range, int method, Searcher* searcher) {
+ searcher->setProgress(10);
+ Verse from=verse->clone();
+ Verse to=verse->clone();
+ if (range==RANGEBIBLE) from.Testament(1);
+ if ((range==RANGETESTAMENT)||(range==RANGEBIBLE)) from.Book(1);
+ from.Chapter(1);
+ from.Verse(1);
+ if (range==RANGEBIBLE) to.Testament(2);
+ if ((range==RANGETESTAMENT)||(range==RANGEBIBLE)) to.Book((to.Testament()==2)?bookCount()-otBookCount():otBookCount());
+ to.Chapter(to.books[to.Testament()-1][to.Book()-1].chapmax);
+ to.Verse(to.books[to.Testament()-1][to.Book()-1].versemax[to.Chapter()-1]);
+/* FOR DEBUGGING
+ searcher->addResult(verseToString(&from));
+ searcher->addResult(verseToString(&to));
+*/
+ Verse verses(from,to);
+ sword::ListKey results;
+ searcher->setProgress(20);
+ results=bible->search(
+ toCString(text).c_str(),
+ (method==METHODMULTIWORD)?-2:-1,
+ 2 /* case insensitive */,
+ &verses
+ );
+ searcher->setProgress(90);
+ for (int i=0;i<results.Count();i++) {
+ searcher->addResult(toUString(String(results.getElement(i)->getText())));
+ }
+ searcher->setProgress(100);
}
Index: SwordIndex.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/SwordIndex.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- SwordIndex.h 15 Mar 2004 10:44:35 -0000 1.6
+++ SwordIndex.h 17 Apr 2004 18:51:47 -0000 1.7
@@ -14,7 +14,6 @@
//#include <thmlplain.h>
#include <thmlhtml.h>
#include <thmlvariants.h>
-#include <map>
using namespace sword;
@@ -28,9 +27,22 @@
typedef sword::SWModule* Module;
typedef std::map<const char*, sword::SWModule*, ltstr> ModuleMap;
+typedef sword::VerseKey Verse;
-class SwordIndex
-{
+class Searcher {
+public:
+ virtual void setProgress(int percent)=0;
+ virtual void addResult(UString verse)=0;
+};
+
+#define RANGEBIBLE 0
+#define RANGETESTAMENT 1
+#define RANGEBOOK 2
+
+#define METHODMULTIWORD 0
+#define METHODEXACTPHRASE 1
+
+class SwordIndex {
private:
static void initManager();
static void leaveManager();
@@ -50,6 +62,7 @@
UString toString();
UString verseText();
+ UString verseText(sword::VerseKey* anyVerse);
ModuleMap::iterator firstModule() {return texts->begin();};
ModuleMap::iterator lastModule() {return texts->end();};
@@ -58,6 +71,9 @@
void setMark();
void jumpBack();
void next();
+
+ void search(UString text, int range, int method, Searcher* searcher);
+
static sword::SWMgr* manager;
static SWModule *greekLex;
static SWModule *hebrewLex;
@@ -70,6 +86,8 @@
UString bookName(int book);
TCHAR** getBookNames() {return bookNames;};
+
+ static UString verseToString(Verse* verse);//(Verse* verse);
static int otBookCount() {return 39;};
static int bookCount() {return 66;};
Index: Utils.h
===================================================================
RCS file: /cvs/core/swordreader/src/gui/Utils.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Utils.h 31 Jan 2004 22:43:32 -0000 1.2
+++ Utils.h 17 Apr 2004 18:51:47 -0000 1.3
@@ -5,7 +5,10 @@
#pragma once
#endif // _MSC_VER > 1000
+#include "swbuf.h"
#include <string>
+#include <map>
+#include <vector>
// This file is a library containing several utilities that can be used throughout the program
Index: BibleReader.aps
===================================================================
RCS file: /cvs/core/swordreader/src/gui/BibleReader.aps,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
Binary files /tmp/cvsuo0FBg and /tmp/cvsxRgpjG differ
- Previous message: [sword-cvs] sword/tests swbuftest.cpp,1.7,1.8
- Next message: [sword-cvs] swordreader/src/gui TextControl.cpp,NONE,1.1 TextControl.h,NONE,1.1 VerseTextControl.cpp,NONE,1.1 VerseTextControl.h,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]