[sword-svn] r71 - trunk/src/gui

dtrotzjr at www.crosswire.org dtrotzjr at www.crosswire.org
Sat Dec 22 22:11:58 MST 2007


Author: dtrotzjr
Date: 2007-12-22 22:11:56 -0700 (Sat, 22 Dec 2007)
New Revision: 71

Modified:
   trunk/src/gui/ApplicationInterface.h
   trunk/src/gui/BibleReader.rc
   trunk/src/gui/Main.cpp
   trunk/src/gui/NavRenderText.cpp
   trunk/src/gui/TextControl.cpp
   trunk/src/gui/TextControl.h
Log:
More polish. Fixed some messaging and focus issues.

Modified: trunk/src/gui/ApplicationInterface.h
===================================================================
--- trunk/src/gui/ApplicationInterface.h	2007-12-23 01:40:38 UTC (rev 70)
+++ trunk/src/gui/ApplicationInterface.h	2007-12-23 05:11:56 UTC (rev 71)
@@ -26,8 +26,8 @@
 extern HWND			g_hWnd;		// The main window
 extern HWND			g_hwndCB;
 
-#define WM_TXT_START WM_USER + 0x0001
-#define WM_TXT_END   WM_USER + 0x0002
+#define WM_TXT_START WM_USER + 0x00F1
+#define WM_TXT_END   WM_USER + 0x00F2
 
 #define MENU_HEIGHT		26
 #define MAX_LOADSTRING	100

Modified: trunk/src/gui/BibleReader.rc
===================================================================
--- trunk/src/gui/BibleReader.rc	2007-12-23 01:40:38 UTC (rev 70)
+++ trunk/src/gui/BibleReader.rc	2007-12-23 05:11:56 UTC (rev 71)
@@ -65,17 +65,17 @@
 BEGIN
     IDM_MENU, 7,
     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, 0, 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_TEXT2, TBSTATE_ENABLED, 
-    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_TE2, 0, 5,
+    TBSTYLE_CHECK | TBSTYLE_AUTOSIZE, IDS_CAP_TEXT2, 0, NOMENU,
     I_IMAGENONE, MENU_MENU, TBSTATE_ENABLED, 
     TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_MENU, 0, 6,
 END
@@ -161,23 +161,19 @@
 BEGIN
     IDS_CAP_BOOK            "Bo"
     IDS_CAP_CHAP            "Ch"
-    IDS_CAP_TEXT            "Te"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
     IDS_CAP_VERSE           "Ve"
+    IDS_CAP_TEXT            "Te"
+    IDS_CAP_FIND            "Fi"
+    IDS_CAP_MENU            "Menu"
     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"
+    IDS_CAP_TEXT2           "Te2"
 END
 
 #endif    // English (U.S.) resources

Modified: trunk/src/gui/Main.cpp
===================================================================
--- trunk/src/gui/Main.cpp	2007-12-23 01:40:38 UTC (rev 70)
+++ trunk/src/gui/Main.cpp	2007-12-23 05:11:56 UTC (rev 71)
@@ -43,9 +43,10 @@
 		}else if(msg.message == WM_TXT_END){
 			ignoreMsgs = false;
 			ignoreTill = msg.time;
-		}else
-
-		if(ignoreMsgs || msg.time < ignoreTill)
+		}
+		// If we have a button or key event, and we are in the ignore message 
+		// window of time we ignore this message
+		if((msg.message == WM_LBUTTONDOWN || msg.message == WM_KEYDOWN) && (ignoreMsgs || msg.time < ignoreTill))
 			continue;
 
 		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 

Modified: trunk/src/gui/NavRenderText.cpp
===================================================================
--- trunk/src/gui/NavRenderText.cpp	2007-12-23 01:40:38 UTC (rev 70)
+++ trunk/src/gui/NavRenderText.cpp	2007-12-23 05:11:56 UTC (rev 71)
@@ -50,16 +50,20 @@
 }
 
 void NavRenderText::load() {
-	int i;
-	for(i = MENU_BOOK; i <= MENU_MENU; i++){
-		SendMessage(g_hwndCB, TB_ENABLEBUTTON, i, false);
-	}
-
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_BOOK, false);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_CHAP, false);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_VERSE, false);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_TEXT, false);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_FIND, false);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_MENU, false);
+	
+	
 	// Suspend user interaction until this page is fully loaded.
-	PostThreadMessage(g_tMain, WM_TXT_START, NULL, NULL); 
+	PostThreadMessage(g_tMain, WM_TXT_START, NULL, NULL);
+	
 	navigator->position.setMark();
 	navigator->position.setVerse(1);
-	textControl->addText(UString(L"<html><head><title></title></head><body>")); // a <style> section presumably gets skipped
+	textControl->addText(UString(L"<html><head><meta name=\"MobileOptimized\" content=\"240\"><title></title></head><body>")); // a <style> section presumably gets skipped
 	UString s;
 	UString heading;
 	char buf[10];
@@ -91,10 +95,18 @@
 	textControl->endOfText();
 	// Suspend user interaction until this page is fully loaded.
 	PostThreadMessage(g_tMain, WM_TXT_END, NULL, NULL);
-	for(i = MENU_BOOK; i <= MENU_MENU; i++){
-		SendMessage(g_hwndCB, TB_ENABLEBUTTON, i, true);
-	}
+	
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_BOOK, true);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_CHAP, true);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_VERSE, true);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_TEXT, true);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_FIND, true);
+	SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_MENU, true);
+	
+	
+	textControl->focus();
 	refreshScreen();
+	textControl->paint();
 }
 
 void NavRenderText::hide() {

Modified: trunk/src/gui/TextControl.cpp
===================================================================
--- trunk/src/gui/TextControl.cpp	2007-12-23 01:40:38 UTC (rev 70)
+++ trunk/src/gui/TextControl.cpp	2007-12-23 05:11:56 UTC (rev 71)
@@ -65,6 +65,13 @@
 
 }
 
+void TextControl::focus() {
+	if(primed)
+		SetFocus(htmlControl2);
+	else
+		SetFocus(htmlControl1);
+}
+
 void TextControl::hide() {
 	ShowWindow(htmlControl1,SW_HIDE);
 	ShowWindow(htmlControl2,SW_HIDE);

Modified: trunk/src/gui/TextControl.h
===================================================================
--- trunk/src/gui/TextControl.h	2007-12-23 01:40:38 UTC (rev 70)
+++ trunk/src/gui/TextControl.h	2007-12-23 05:11:56 UTC (rev 71)
@@ -15,6 +15,7 @@
 
 	void show();
 	void hide();
+	void focus();
 	virtual void paint();
 
 	virtual void clearText();




More information about the sword-cvs mailing list