[sword-svn] r49 - in trunk: . src/gui

bdrake at www.crosswire.org bdrake at www.crosswire.org
Sun Dec 9 01:59:57 MST 2007


Author: bdrake
Date: 2007-12-09 01:59:55 -0700 (Sun, 09 Dec 2007)
New Revision: 49

Modified:
   trunk/INSTALL
   trunk/INSTALL.TXT
   trunk/src/gui/Main.cpp
   trunk/src/gui/TextControl.cpp
   trunk/src/gui/TextControl.h
   trunk/src/gui/VerseTextControl.cpp
Log:


Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL	2007-12-08 11:35:30 UTC (rev 48)
+++ trunk/INSTALL	2007-12-09 08:59:55 UTC (rev 49)
@@ -2,7 +2,9 @@
 
 - Build the ARM release version of sword.dll and the ARM release version of simplegui.exe
 
+- Either:
 - Copy both files to your Pocket PC under \Program Files (making the directory '\Program files\sword' on your system memory).
+
 - OR copy both files to a directory called 'sword' on your Storage Card.
 
 The directory into which they are placed is your Sword Home directory
@@ -16,7 +18,6 @@
 - make a link to start the program using the Windows Mobile file manager (Start/Programs/File Explorer).  To do this, first browse to your Sword home directory.  Use the cursor keys to highlight simplegui.exe (don't tap on it).  Then do menu/edit/copy. Next, browse to My Device/Windows/Start Menu/Programs and do Menu/Edit/Paste Shortcut (NOT Paste!).  This will produce a link that you can use to fire up the application.
 
 Known problems: We need a means of installation that will run on a PC and do all of the above automatically using Sword Install Manager to get the modules.  This is work in progress.  Also, GUI.exe is intended to have two text window so that two different versions or a version and a commentary can be looked at.  Currently, simplegui.exe is the same as GUI.exe but without the extra button which currently does nothing useful!
-Also, currently the footnotes do not display correctly nor do the Strongs numbers in versions that use them.
 
 Any offers of help appreciated.
 

Modified: trunk/INSTALL.TXT
===================================================================
--- trunk/INSTALL.TXT	2007-12-08 11:35:30 UTC (rev 48)
+++ trunk/INSTALL.TXT	2007-12-09 08:59:55 UTC (rev 49)
@@ -2,7 +2,9 @@
 
 - Build the ARM release version of sword.dll and the ARM release version of simplegui.exe
 
+- Either:
 - Copy both files to your Pocket PC under \Program Files (making the directory '\Program files\sword' on your system memory).
+
 - OR copy both files to a directory called 'sword' on your Storage Card.
 
 The directory into which they are placed is your Sword Home directory
@@ -16,7 +18,6 @@
 - make a link to start the program using the Windows Mobile file manager (Start/Programs/File Explorer).  To do this, first browse to your Sword home directory.  Use the cursor keys to highlight simplegui.exe (don't tap on it).  Then do menu/edit/copy. Next, browse to My Device/Windows/Start Menu/Programs and do Menu/Edit/Paste Shortcut (NOT Paste!).  This will produce a link that you can use to fire up the application.
 
 Known problems: We need a means of installation that will run on a PC and do all of the above automatically using Sword Install Manager to get the modules.  This is work in progress.  Also, GUI.exe is intended to have two text window so that two different versions or a version and a commentary can be looked at.  Currently, simplegui.exe is the same as GUI.exe but without the extra button which currently does nothing useful!
-Also, currently the footnotes do not display correctly nor do the Strongs numbers in versions that use them.
 
 Any offers of help appreciated.
 

Modified: trunk/src/gui/Main.cpp
===================================================================
--- trunk/src/gui/Main.cpp	2007-12-08 11:35:30 UTC (rev 48)
+++ trunk/src/gui/Main.cpp	2007-12-09 08:59:55 UTC (rev 49)
@@ -92,7 +92,7 @@
 	RECT	rect;
 	GetClientRect(g_hWnd, &rect);
 
-	CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
+	g_hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
 		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
 	if (!g_hWnd)
 	{	
@@ -120,6 +120,7 @@
 
 	ShowWindow(g_hWnd, nCmdShow);
 	g_navigator->setMode(MODE_TEXT);
+	SetForegroundWindow((HWND)((ULONG) g_hWnd | 0x00000001));
 	UpdateWindow(g_hWnd);
 
 	return TRUE;
@@ -156,7 +157,7 @@
 					SendMessage (hWnd, WM_CLOSE, 0, 0);
 					break;
 				case MENU_ABOUT:
-					MessageBox(0, L"Sword reader program for Pocket PC\n\nsee: http://www.crosswire.org/sword/swordreader/\n\nGUI by Johan Gorter, 2004\nNow being maintained by B. Drake and Robin Randall\nProverbs 16:3", L"About", MB_OK);
+					MessageBox(0, L"Sword reader program for IPAQ\n\nsee: http://www.crosswire.org/sword/swordreader/\n\nGUI by Johan Gorter, 2004\nProverbs 16:3", L"About", MB_OK);
 					break;
 				case MENU_SHUTDOWN:
 					SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)hWnd);
@@ -209,6 +210,9 @@
 		case WM_SETTINGCHANGE:
 			SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai);
      		break;
+		case WM_SIZE:
+			
+			break;
 		default:
 			return DefWindowProc(hWnd, message, wParam, lParam);
    }

Modified: trunk/src/gui/TextControl.cpp
===================================================================
--- trunk/src/gui/TextControl.cpp	2007-12-08 11:35:30 UTC (rev 48)
+++ trunk/src/gui/TextControl.cpp	2007-12-09 08:59:55 UTC (rev 49)
@@ -27,6 +27,9 @@
 #define controlToVerse(window,versenr) SendMessage(window, DTM_ANCHORW, FALSE, (LPARAM)(toUString(versenr).c_str()))
 
 TextControl::TextControl(int x, int y, int width, int height){
+	if(width < height) 
+		portrait = true;
+	
 	VERIFY(InitHTMLControl(g_hInst));
 	htmlControl = CreateWindowEx(WS_EX_NOACTIVATE, WC_HTML, NULL, 
 		WS_CHILD | HS_CLEARTYPE | HS_NOSCRIPTING | 
@@ -48,6 +51,17 @@
 }
 
 void TextControl::paint() {
+	// Detect if we switched from portrait to landscape. If so lets resize the window appropiately.
+	int width = GetSystemMetrics(SM_CXSCREEN);
+	int height = GetSystemMetrics(SM_CYSCREEN);
+	if(width < height && !portrait){
+		portrait = true;
+		MoveWindow(htmlControl,0,0,width,height, TRUE);
+
+	}else if(width > height && portrait){
+		portrait = false;
+		MoveWindow(htmlControl,0,0,width,height, TRUE);
+	}
 }
 
 void TextControl::clearText() {

Modified: trunk/src/gui/TextControl.h
===================================================================
--- trunk/src/gui/TextControl.h	2007-12-08 11:35:30 UTC (rev 48)
+++ trunk/src/gui/TextControl.h	2007-12-09 08:59:55 UTC (rev 49)
@@ -23,6 +23,7 @@
 	HWND htmlControl;					// in case of HTML
 	UString buffer;
 	RECT area;
+	bool portrait;
 };
 
 #endif

Modified: trunk/src/gui/VerseTextControl.cpp
===================================================================
--- trunk/src/gui/VerseTextControl.cpp	2007-12-08 11:35:30 UTC (rev 48)
+++ trunk/src/gui/VerseTextControl.cpp	2007-12-09 08:59:55 UTC (rev 49)
@@ -23,7 +23,9 @@
 	controlToVerse(htmlControl,anchor);
 }
 
-void VerseTextControl::paint() {}
+void VerseTextControl::paint() {
+	TextControl::paint();
+}
 
 void VerseTextControl::clearText() {
 	TextControl::clearText();




More information about the sword-cvs mailing list